tests: short-circuit tests that require cmake, faster

We have two ways of marking a test as skipped:
- raise MESON_SKIP_TEST
- declare that the tools it needs in test.json are unavailable

Doing the former requires performing the configure stage including e.g.
language setup.

In several cases we weren't even getting this far anyway since we used
both mechanisms (the cmake category has a category-wide skip for this,
in fact). In some case, we were missing test.json declaring it skippable;
add this.
pull/13434/head
Eli Schwartz 4 months ago
parent 2fd7d64a50
commit 2a8bb3b9f1
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 4
      test cases/cmake/11 cmake_module_path/meson.build
  2. 5
      test cases/cmake/22 cmake module/meson.build
  3. 4
      test cases/failing build/3 cmake subproject isolation/meson.build
  4. 4
      test cases/failing/109 cmake executable dependency/meson.build
  5. 2
      test cases/failing/109 cmake executable dependency/test.json
  6. 4
      test cases/failing/119 cmake subproject error/meson.build
  7. 2
      test cases/failing/119 cmake subproject error/test.json
  8. 5
      test cases/linuxlike/13 cmake dependency/meson.build
  9. 5
      test cases/linuxlike/13 cmake dependency/test.json
  10. 4
      test cases/osx/9 framework recasting/meson.build
  11. 5
      test cases/osx/9 framework recasting/test.json

@ -3,10 +3,6 @@
project('user CMake find_package module using cmake_module_path', ['c', 'cpp'],
meson_version: '>= 0.55.0')
if not find_program('cmake', required: false).found()
error('MESON_SKIP_TEST cmake binary not available.')
endif
# NOTE: can't request Python3 via dependency('Python3', method: 'cmake')
# Meson intercepts and wants "method: auto"

@ -4,11 +4,6 @@ if build_machine.system() == 'cygwin'
error('MESON_SKIP_TEST CMake is broken on Cygwin.')
endif
cmake_bin = find_program('cmake', required: false)
if not cmake_bin.found()
error('MESON_SKIP_TEST CMake not installed.')
endif
cc = meson.get_compiler('c')
if cc.get_id() == 'clang-cl' and meson.backend() == 'ninja' and build_machine.system() == 'windows'
error('MESON_SKIP_TEST CMake installation nor operational for vs2017 clangclx64ninja')

@ -1,9 +1,5 @@
project('subproject isolation', ['c', 'cpp'])
if not find_program('cmake', required: false).found()
error('MESON_SKIP_TEST CMake is not installed')
endif
incdir = meson.source_root() / 'incDir'
cm = import('cmake')

@ -1,9 +1,5 @@
project('cmake-executable-dependency', 'c')
if not find_program('cmake', required: false).found()
error('MESON_SKIP_TEST CMake is not installed')
endif
cmake = import('cmake')
cmlib = cmake.subproject('cmlib')
maind = cmlib.dependency('main')

@ -1,7 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/109 cmake executable dependency/meson.build:9:14: ERROR: main is an executable and does not support the dependency() method. Use target() instead."
"line": "test cases/failing/109 cmake executable dependency/meson.build:5:14: ERROR: main is an executable and does not support the dependency() method. Use target() instead."
}
],
"tools": {

@ -1,8 +1,4 @@
project('cmake-executable-dependency')
if not find_program('cmake', required: false).found()
error('MESON_SKIP_TEST CMake is not installed')
endif
cmake = import('cmake')
cmlib = cmake.subproject('cmlib')

@ -1,7 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/119 cmake subproject error/meson.build:8:14: ERROR: Failed to configure the CMake subproject: Fancy error message"
"line": "test cases/failing/119 cmake subproject error/meson.build:4:14: ERROR: Failed to configure the CMake subproject: Fancy error message"
}
],
"tools": {

@ -2,10 +2,7 @@
# due to use of setup_env.json
project('external CMake dependency', ['c', 'cpp'])
cmake = find_program('cmake', required: false)
if not cmake.found()
error('MESON_SKIP_TEST cmake binary not available.')
endif
cmake = find_program('cmake')
# Zlib is probably on all dev machines.

@ -10,5 +10,8 @@
{
"line": " ['CMMesonTESTf1::evil_non_standard_target']"
}
]
],
"tools": {
"cmake": ">=3.11"
}
}

@ -1,9 +1,5 @@
project('framework recasting', 'c', 'cpp')
if not find_program('cmake', required: false).found()
error('MESON_SKIP_TEST cmake binary not available.')
endif
x = dependency('OpenAL', method: 'cmake')
y = executable('tt', files('main.cpp'), dependencies: x)

@ -0,0 +1,5 @@
{
"tools": {
"cmake": ">=3.11"
}
}
Loading…
Cancel
Save