From b427c6084311f0c620bf4afe7746739e8c887977 Mon Sep 17 00:00:00 2001 From: Jag Raman Date: Tue, 17 May 2022 09:30:55 -0400 Subject: tests: add checks to confirm test environment (#688) test-lspci.sh: some test platforms don't include the lspci command, as such skip this test if lspci is not found test-linkage.sh: specify the source and build root paths of the subproject instead of the root paths of the master project Signed-off-by: Jagannathan Raman Reviewed-by: John Levon --- test/meson.build | 6 +++--- test/test-lspci.sh | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/test/meson.build b/test/meson.build index ba6f7c5..1c3aef5 100644 --- a/test/meson.build +++ b/test/meson.build @@ -83,14 +83,14 @@ test( timeout: 90, ) -if opt_sanitizers == 'none' +if opt_sanitizers == 'none' and meson.version().version_compare('>=0.56.0') test( 'test-linkage.sh', find_program('test-linkage.sh'), suite: 'functional', args: [ - meson.source_root(), - meson.build_root(), + meson.project_source_root(), + meson.project_build_root(), ' '.join(cc.cmd_array()), ] ) diff --git a/test/test-lspci.sh b/test/test-lspci.sh index 91adb13..9cf402f 100755 --- a/test/test-lspci.sh +++ b/test/test-lspci.sh @@ -7,6 +7,11 @@ LSPCI=../samples/lspci +if ! command -v lspci &> /dev/null +then + exit 77 +fi + test -n "$1" && LSPCI="$1" $LSPCI | lspci -vv -F /dev/stdin >lspci.out -- cgit v1.1