build: Look for sh just once

This commit is contained in:
Marco Trevisan (Treviño)
2024-02-20 08:22:42 +01:00
parent 5ada931ede
commit 4b72f27de6
2 changed files with 6 additions and 5 deletions

View File

@@ -91,6 +91,7 @@ gusb_dep = dependency('gusb', version: '>= 0.2.0')
mathlib_dep = cc.find_library('m', required: false) mathlib_dep = cc.find_library('m', required: false)
# The following dependencies are only used for tests # The following dependencies are only used for tests
sh = find_program('sh', required: true)
cairo_dep = dependency('cairo', required: false) cairo_dep = dependency('cairo', required: false)
# introspection scanning and Gio-2.0.gir # introspection scanning and Gio-2.0.gir

View File

@@ -151,7 +151,7 @@ if get_option('introspection')
endif endif
else else
test(vdtest, test(vdtest,
find_program('sh'), sh,
args: ['-c', 'exit 77'] args: ['-c', 'exit 77']
) )
endif endif
@@ -205,7 +205,7 @@ if get_option('introspection')
endif endif
else else
test(driver_test, test(driver_test,
find_program('sh'), sh,
args: ['-c', 'exit 77'] args: ['-c', 'exit 77']
) )
endif endif
@@ -224,13 +224,13 @@ if get_option('introspection')
else else
warning('Skipping all driver tests as introspection bindings are missing') warning('Skipping all driver tests as introspection bindings are missing')
test('virtual-image', test('virtual-image',
find_program('sh'), sh,
args: ['-c', 'exit 77'] args: ['-c', 'exit 77']
) )
foreach driver_test: drivers_tests foreach driver_test: drivers_tests
test(driver_test, test(driver_test,
find_program('sh'), sh,
args: ['-c', 'exit 77'] args: ['-c', 'exit 77']
) )
endforeach endforeach
@@ -273,7 +273,7 @@ foreach test_name: unit_tests
# Create a dummy test that always skips instead # Create a dummy test that always skips instead
warning('Test @0@ cannot be compiled due to missing dependencies'.format(test_name)) warning('Test @0@ cannot be compiled due to missing dependencies'.format(test_name))
test(test_name, test(test_name,
find_program('sh'), sh,
suite: ['unit-tests'], suite: ['unit-tests'],
args: ['-c', 'exit 77'], args: ['-c', 'exit 77'],
) )