Skip to content

Commit

Permalink
Require CMake 3.14 for all tests that use the cmake module
Browse files Browse the repository at this point in the history
Older versions are not supported by the cmake module since 0.62.

This avoids having to hard-code the linux-bionic-gcc CI job as being
unable to run these tests, which leaves other older environments like
Debian 10 still trying to run them (and failing).

Signed-off-by: Simon McVittie <[email protected]>
  • Loading branch information
smcv authored and eli-schwartz committed May 10, 2022
1 parent 7650f32 commit 65ea833
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 20 deletions.
6 changes: 5 additions & 1 deletion run_project_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,10 @@ def detect_tests_to_run(only: T.Dict[str, T.List[str]], use_tmp: bool) -> T.List
shutil.which('nagfor') or
shutil.which('ifort'))

skip_cmake = ((os.environ.get('compiler') == 'msvc2015' and under_ci) or
'cmake' not in tool_vers_map or
not mesonlib.version_compare(tool_vers_map['cmake'], '>=3.14'))

class TestCategory:
def __init__(self, category: str, subdir: str, skip: bool = False, stdout_mandatory: bool = False):
self.category = category # category name
Expand All @@ -1069,7 +1073,7 @@ def __init__(self, category: str, subdir: str, skip: bool = False, stdout_mandat
self.stdout_mandatory = stdout_mandatory # expected stdout is mandatory for tests in this category

all_tests = [
TestCategory('cmake', 'cmake', not shutil.which('cmake') or (os.environ.get('compiler') == 'msvc2015' and under_ci) or (os.environ.get('MESON_CI_JOBNAME') == 'linux-bionic-gcc')),
TestCategory('cmake', 'cmake', skip_cmake),
TestCategory('common', 'common'),
TestCategory('native', 'native'),
TestCategory('warning-meson', 'warning', stdout_mandatory=True),
Expand Down
5 changes: 0 additions & 5 deletions test cases/cmake/11 cmake_module_path/test.json

This file was deleted.

5 changes: 1 addition & 4 deletions test cases/cmake/19 advanced options/test.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"installed": [
{"type": "exe", "file": "usr/bin/testEXE"}
],
"tools": {
"cmake": ">=3.11"
}
]
}
5 changes: 1 addition & 4 deletions test cases/cmake/2 advanced/test.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"installed": [
{"type": "exe", "file": "usr/bin/testEXE"}
],
"tools": {
"cmake": ">=3.11"
}
]
}
5 changes: 1 addition & 4 deletions test cases/cmake/3 advanced no dep/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@
{"type": "exe", "file": "usr/bin/cm_meson_testEXE"},
{"type": "pdb", "file": "usr/bin/cm_benchmark"},
{"type": "exe", "file": "usr/bin/cm_benchmark"}
],
"tools": {
"cmake": ">=3.11"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
project('nested subproject regenerate depends', 'c')

if not find_program('cmake', required: false, version: '>=3.14').found()
error('MESON_SKIP_TEST cmake >= 3.14 not available.')
endif

s = subproject('sub1')

# This is needed to make msbuild noop check work correctly
Expand Down
2 changes: 0 additions & 2 deletions unittests/allplatformstests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3740,8 +3740,6 @@ def test_nested_cmake_rebuild(self) -> None:
# This checks a bug where if a non-meson project is used as a third
# level (or deeper) subproject it doesn't cause a rebuild if the build
# files for that project are changed
if os.environ.get('MESON_CI_JOBNAME') == 'linux-bionic-gcc':
raise SkipTest('Unsupported CMake version')
testdir = os.path.join(self.unit_test_dir, '84 nested subproject regenerate depends')
cmakefile = Path(testdir) / 'subprojects' / 'sub2' / 'CMakeLists.txt'
self.init(testdir)
Expand Down

0 comments on commit 65ea833

Please sign in to comment.