aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJag Raman <jag.raman@oracle.com>2022-05-17 09:30:55 -0400
committerGitHub <noreply@github.com>2022-05-17 14:30:55 +0100
commitb427c6084311f0c620bf4afe7746739e8c887977 (patch)
treec70da99a2bd677ceb7b2fc2e7c940f1b58e65794
parent7dc1c72dfaa79fd627c80db4ff4f1ea98ff97c4d (diff)
downloadlibvfio-user-b427c6084311f0c620bf4afe7746739e8c887977.zip
libvfio-user-b427c6084311f0c620bf4afe7746739e8c887977.tar.gz
libvfio-user-b427c6084311f0c620bf4afe7746739e8c887977.tar.bz2
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 <jag.raman@oracle.com> Reviewed-by: John Levon <john.levon@nutanix.com>
-rw-r--r--test/meson.build6
-rwxr-xr-xtest/test-lspci.sh5
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