aboutgitcodebugslistschat
path: root/test/lib/test
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-07-06 17:29:05 +1000
committerStefano Brivio <sbrivio@redhat.com>2022-07-14 01:32:42 +0200
commit544f790bf837ebe7d7e25fa59a5790e5dbb412a1 (patch)
tree6cf91d9935fbe6e4c98575a2d6d66ae2b3a05d49 /test/lib/test
parent5d7688d26f616831731a550f4a422f67aed9d21f (diff)
downloadpasst-544f790bf837ebe7d7e25fa59a5790e5dbb412a1.tar
passt-544f790bf837ebe7d7e25fa59a5790e5dbb412a1.tar.gz
passt-544f790bf837ebe7d7e25fa59a5790e5dbb412a1.tar.bz2
passt-544f790bf837ebe7d7e25fa59a5790e5dbb412a1.tar.lz
passt-544f790bf837ebe7d7e25fa59a5790e5dbb412a1.tar.xz
passt-544f790bf837ebe7d7e25fa59a5790e5dbb412a1.tar.zst
passt-544f790bf837ebe7d7e25fa59a5790e5dbb412a1.zip
tests: Don't automatically traverse directories of test files
The top level listing control of which tests to run is in test/run, however it uses the test() function which runs an entire directory of test files, filtered by some criteria. This makes it awkward to narrow down to a subset of tests when debugging a specific failure. To make this easier, have test() take an explicit list of test files to run, and have the caller in test/run handle the directory traversal. The construct we use for this is pretty awkward to handle the fact that we're in the source tree root directory rather than test/ at this point in test/run. Later cleanups will improve that. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'test/lib/test')
-rwxr-xr-xtest/lib/test4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/lib/test b/test/lib/test
index ae42864..12f2588 100755
--- a/test/lib/test
+++ b/test/lib/test
@@ -415,12 +415,12 @@ test_one() {
}
# test() - Build list of tests to run, in order, then issue test_one()
-# $1: Name of directory containing set of test files, relative to test/
+# $@: Test files to run, relative to test/
test() {
__list=
cd test
- for __f in "${1}"/*; do
+ for __f; do
__type="$(file -b --mime-type ${__f})"
if [ "${__type}" = "text/x-shellscript" ]; then
__list="$(list_add "${__list}" "${__f}")"