diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2019-03-19 17:44:49 -0700 |
---|---|---|
committer | Eryu Guan <guaneryu@gmail.com> | 2019-03-23 21:27:12 +0800 |
commit | 97fd33c767409c382fd8a7b368f7d1fc23fe75a4 (patch) | |
tree | b01eb1c103c4445cda47a673fef45cb009f3fcef /check | |
parent | 07094a9652c0ce002138fef69a0d8c973e539bde (diff) |
check: really improve test list randomization
coreutils provides the shuf(1) utility that randomizes the order of a
list and seeds its random number generator with /dev/urandom. It's a
bit speedier than awk, so use it if available.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Diffstat (limited to 'check')
-rwxr-xr-x | check | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -243,7 +243,11 @@ _prepare_test_list() # sort the list of tests into numeric order if $randomize; then - sorter="awk -v seed=$RANDOM -f randomize.awk" + if type shuf >& /dev/null; then + sorter="shuf" + else + sorter="awk -v seed=$RANDOM -f randomize.awk" + fi else sorter="cat" fi |