2 # SPDX-License-Identifier: GPL-2.0+
4 # Runs the C-language litmus tests matching the specified criteria
5 # that do not already have a corresponding .litmus.out file, and does
6 # not judge the result.
10 # Run from the Linux kernel tools/memory-model directory.
11 # See scripts/parseargs.sh for list of arguments.
13 # Copyright IBM Corporation, 2018
15 # Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
17 .
scripts
/parseargs.sh
19 T
=/tmp
/newlitmushist.sh.$$
27 echo Run
scripts
/initlitmushist.sh first
, need litmus repo.
31 # Create any new directories that have appeared in the github litmus
32 # repo since the last run.
33 if test "$LKMM_DESTDIR" != "."
35 find litmus
-type d
-print |
36 ( cd "$LKMM_DESTDIR"; sed -e 's/^/mkdir -p /' | sh
)
39 # Create a list of the C-language litmus tests previously run.
40 ( cd $LKMM_DESTDIR; find litmus
-name '*.litmus.out' -print ) |
42 xargs -r grep -L "^P${LKMM_PROCS}"> $T/list-C-already
44 # Form full list of litmus tests with no more than the specified
45 # number of processes (per the --procs argument).
46 find litmus
-name '*.litmus' -exec grep -l -m 1 "^C " {} \
; > $T/list-C-all
47 xargs < $T/list-C-all
-r grep -L "^P${LKMM_PROCS}" > $T/list-C-short
49 # Form list of new tests. Note: This does not handle litmus-test deletion!
50 sort $T/list-C-already
$T/list-C-short |
uniq -u > $T/list-C-new
52 # Form list of litmus tests that have changed since the last run.
53 sed < $T/list-C-short
-e 's,^.*$,if test & -nt '"$LKMM_DESTDIR"'/&.out; then echo &; fi,' > $T/list-C-script
54 sh
$T/list-C-script
> $T/list-C-newer
56 # Merge the list of new and of updated litmus tests: These must be (re)run.
57 sort -u $T/list-C-new
$T/list-C-newer
> $T/list-C-needed
59 scripts
/runlitmushist.sh
< $T/list-C-needed