tests: do not use a GNU bash script to check the minimum version of programs

find_program() can check that for us already, there's no need to
require GNU bash on systems that default to other POSIX shells.

Even though this is the *linuxlike* tests and a POSIX shell is
guaranteed, there is actually no need to require a shell at all. It's
*easier* to use the meson builtin functionality here.
pull/10010/head
Eli Schwartz 3 years ago
parent 62a6c95c13
commit ed262cad97
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 6
      test cases/linuxlike/13 cmake dependency/cmVers.sh
  2. 5
      test cases/linuxlike/13 cmake dependency/meson.build

@ -1,6 +0,0 @@
#!/usr/bin/env bash
VERS=$(cmake --version | grep "cmake version")
VERS=${VERS//cmake version/}
echo -n $VERS

@ -6,9 +6,6 @@ if not find_program('cmake', required: false).found()
error('MESON_SKIP_TEST cmake binary not available.')
endif
# CMake version
cm_vers = run_command(find_program('./cmVers.sh'), check: true).stdout().strip()
# Zlib is probably on all dev machines.
dep = dependency('ZLIB', version : '>=1.2', method : 'cmake')
@ -69,7 +66,7 @@ test('zlibtest4', exe4)
# Test some edge cases with spaces, etc. (but only for CMake >= 3.15)
if cm_vers.version_compare('>=3.15')
if find_program('cmake', required: false, version: '>=3.15').found()
testDep1 = dependency('ImportedTarget', required : true, method : 'cmake', cmake_module_path : 'cmake', modules: 'mesonTestLibDefs')
testDep2 = dependency('ImportedTarget', required : true, method : 'cmake', cmake_module_path : 'cmake', modules : ['MesonTest::TestLibDefs'])
testFlagSet1 = executable('testFlagSet1', ['testFlagSet.c'], dependencies: [testDep1])

Loading…
Cancel
Save