Introduce a new --exact-order switch to disable all sorting, filtering
of repeated lines, and shuffling of test order. The goal of this is to
be able to run tests in a specific order, namely to try to reproduce
test failures that could be the result of a -r(andomize) run getting
lucky.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
showme=false
have_test_arg=false
randomize=false
showme=false
have_test_arg=false
randomize=false
export here=`pwd`
xfile=""
subdir_xfile=""
export here=`pwd`
xfile=""
subdir_xfile=""
-n show me, do not run tests
-T output timestamps
-r randomize test order
-n show me, do not run tests
-T output timestamps
-r randomize test order
+ --exact-order run tests in the exact order specified
-i <n> iterate the test list <n> times
-d dump test output to stdout
-b brief test summary
-i <n> iterate the test list <n> times
-d dump test output to stdout
-b brief test summary
trim_test_list $list
done
trim_test_list $list
done
- # sort the list of tests into numeric order
- if $randomize; then
- if type shuf >& /dev/null; then
- sorter="shuf"
+ # sort the list of tests into numeric order unless we're running tests
+ # in the exact order specified
+ if ! $exact_order; then
+ if $randomize; then
+ if type shuf >& /dev/null; then
+ sorter="shuf"
+ else
+ sorter="awk -v seed=$RANDOM -f randomize.awk"
+ fi
- sorter="awk -v seed=$RANDOM -f randomize.awk"
+ list=`sort -n $tmp.list | uniq | $sorter`
- list=`sort -n $tmp.list | uniq | $sorter`
-udiff) diff="$diff -u" ;;
-n) showme=true ;;
-udiff) diff="$diff -u" ;;
-n) showme=true ;;
+ -r)
+ if $exact_order; then
+ echo "Cannot specify -r and --exact-order."
+ exit 1
+ fi
+ randomize=true
+ ;;
+ --exact-order)
+ if $randomize; then
+ echo "Cannnot specify --exact-order and -r."
+ exit 1
+ fi
+ exact_order=true
+ ;;
-i) iterations=$2; shift ;;
-T) timestamp=true ;;
-d) DUMP_OUTPUT=true ;;
-i) iterations=$2; shift ;;
-T) timestamp=true ;;
-d) DUMP_OUTPUT=true ;;