summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-04-16 12:18:16 -0400
committerTavian Barnes <tavianator@tavianator.com>2017-04-16 12:18:16 -0400
commitf32f83727bd2cef39998bcc9e74653d3a5ccd18f (patch)
tree575ae2949e8783c77c7e38ef165635307f531718 /tests.sh
parente42e0f1012229e4473919c738ab7e4bcaff8033a (diff)
downloadbfs-f32f83727bd2cef39998bcc9e74653d3a5ccd18f.tar.xz
tests.sh: Allow individual tests to be specified on the command line
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh26
1 files changed, 16 insertions, 10 deletions
diff --git a/tests.sh b/tests.sh
index 61aab2a..5fed800 100755
--- a/tests.sh
+++ b/tests.sh
@@ -324,6 +324,12 @@ BSD=yes
GNU=yes
ALL=yes
+function enable_tests() {
+ for test; do
+ eval run_$test=yes
+ done
+}
+
for arg; do
case "$arg" in
--bfs=*)
@@ -352,6 +358,10 @@ for arg; do
--update)
UPDATE=yes
;;
+ test_*)
+ EXPLICIT=yes
+ enable_tests "$arg"
+ ;;
*)
echo "Unrecognized option '$arg'." >&2
exit 1
@@ -359,16 +369,12 @@ for arg; do
esac
done
-function enable_tests() {
- for test; do
- eval run_$test=yes
- done
-}
-
-enable_tests "${posix_tests[@]}"
-[ "$BSD" ] && enable_tests "${bsd_tests[@]}"
-[ "$GNU" ] && enable_tests "${gnu_tests[@]}"
-[ "$ALL" ] && enable_tests "${bfs_tests[@]}"
+if [ -z "$EXPLICIT" ]; then
+ enable_tests "${posix_tests[@]}"
+ [ "$BSD" ] && enable_tests "${bsd_tests[@]}"
+ [ "$GNU" ] && enable_tests "${gnu_tests[@]}"
+ [ "$ALL" ] && enable_tests "${bfs_tests[@]}"
+fi
function bfs_sort() {
awk -F/ '{ print NF - 1 " " $0 }' | sort -n | cut -d' ' -f2-