2 # SPDX-License-Identifier: GPL-2.0+
4 # Runs the C-language litmus tests having a maximum number of processes
5 # to run, defaults to 6.
9 # Run from the Linux kernel tools/memory-model directory. See the
10 # parseargs.sh scripts for arguments.
12 .
scripts
/parseargs.sh
14 T
=/tmp
/checkghlitmus.sh.$$
18 # Clone the repository if it is not already present.
23 git clone https
://github.com
/paulmckrcu
/litmus
24 ( cd litmus
; git checkout origin
/master
)
27 # Create any new directories that have appeared in the github litmus
28 # repo since the last run.
29 if test "$LKMM_DESTDIR" != "."
31 find litmus
-type d
-print |
32 ( cd "$LKMM_DESTDIR"; sed -e 's/^/mkdir -p /' | sh
)
35 # Create a list of the C-language litmus tests previously run.
36 ( cd $LKMM_DESTDIR; find litmus
-name '*.litmus.out' -print ) |
38 xargs -r egrep -l '^ \* Result: (Never|Sometimes|Always|DEADLOCK)' |
39 xargs -r grep -L "^P${LKMM_PROCS}"> $T/list-C-already
41 # Create a list of C-language litmus tests with "Result:" commands and
42 # no more than the specified number of processes.
43 find litmus
-name '*.litmus' -exec grep -l -m 1 "^C " {} \
; > $T/list-C
44 xargs < $T/list-C
-r egrep -l '^ \* Result: (Never|Sometimes|Always|DEADLOCK)' > $T/list-C-result
45 xargs < $T/list-C-result
-r grep -L "^P${LKMM_PROCS}" > $T/list-C-result-short
47 # Form list of tests without corresponding .litmus.out files
48 sort $T/list-C-already
$T/list-C-result-short |
uniq -u > $T/list-C-needed
50 # Run any needed tests.
51 if scripts
/runlitmushist.sh
< $T/list-C-needed
> $T/run.stdout
2> $T/run.stderr
58 sed < $T/list-C-result-short
-e 's,^,scripts/judgelitmus.sh ,' |
59 sh
> $T/judge.stdout
2> $T/judge.stderr
63 cat $T/run.stderr
1>&2
65 grep '!!!' $T/judge.stdout