tests/installed: support TESTS filter

Lifted from rpm-ostree. Makes iterating on a single test much faster.
Example use:

    TESTS=label-selinux ./ostree/tests/installed/run.sh

Closes: #1442
Approved by: cgwalters
This commit is contained in:
Jonathan Lebon authored and Atomic Bot committed 2018-02-02 22:36:49 +00:00
1 parent 5cba67520e
commit 6b95d51132
1 file changed
+8
+8
View File
@@ -4,6 +4,14 @@ set -xeuo pipefail
dn=$(dirname $0)
for tn in ${dn}/itest-*.sh; do
if [ -n "${TESTS+ }" ]; then
tbn=$(basename "$tn" .sh)
tbn=" ${tbn#itest-} "
if [[ " $TESTS " != *$tbn* ]]; then
echo "Skipping: ${tn}"
continue
fi
fi
echo Executing: ${tn}
${tn}
done