diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2017-04-16 12:18:16 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2017-04-16 12:18:16 -0400 |
commit | f32f83727bd2cef39998bcc9e74653d3a5ccd18f (patch) | |
tree | 575ae2949e8783c77c7e38ef165635307f531718 /tests.sh | |
parent | e42e0f1012229e4473919c738ab7e4bcaff8033a (diff) | |
download | bfs-f32f83727bd2cef39998bcc9e74653d3a5ccd18f.tar.xz |
tests.sh: Allow individual tests to be specified on the command line
Diffstat (limited to 'tests.sh')
-rwxr-xr-x | tests.sh | 26 |
1 files changed, 16 insertions, 10 deletions
@@ -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- |