]>
Commit | Line | Data |
---|---|---|
2fb6ae16 | 1 | #!/bin/sh |
b02eb5b0 | 2 | # SPDX-License-Identifier: GPL-2.0+ |
2fb6ae16 | 3 | # |
37c600a3 | 4 | # Run herd7 tests on all .litmus files in the litmus-tests directory |
b02eb5b0 PM |
5 | # and check each file's result against a "Result:" comment within that |
6 | # litmus test. If the verification result does not match that specified | |
7 | # in the litmus test, this script prints an error message prefixed with | |
8 | # "^^^". It also outputs verification results to a file whose name is | |
9 | # that of the specified litmus test, but with ".out" appended. | |
2fb6ae16 PM |
10 | # |
11 | # Usage: | |
b02eb5b0 | 12 | # checkalllitmus.sh |
2fb6ae16 | 13 | # |
b02eb5b0 | 14 | # Run this in the directory containing the memory model. |
2fb6ae16 PM |
15 | # |
16 | # This script makes no attempt to run the litmus tests concurrently. | |
17 | # | |
2fb6ae16 PM |
18 | # Copyright IBM Corporation, 2018 |
19 | # | |
20 | # Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | |
21 | ||
b02eb5b0 PM |
22 | . scripts/parseargs.sh |
23 | ||
24 | litmusdir=litmus-tests | |
2fb6ae16 PM |
25 | if test -d "$litmusdir" -a -r "$litmusdir" -a -x "$litmusdir" |
26 | then | |
27 | : | |
28 | else | |
29 | echo ' --- ' error: $litmusdir is not an accessible directory | |
30 | exit 255 | |
31 | fi | |
32 | ||
b02eb5b0 PM |
33 | # Create any new directories that have appeared in the github litmus |
34 | # repo since the last run. | |
35 | if test "$LKMM_DESTDIR" != "." | |
36 | then | |
37 | find $litmusdir -type d -print | | |
38 | ( cd "$LKMM_DESTDIR"; sed -e 's/^/mkdir -p /' | sh ) | |
39 | fi | |
40 | ||
2fb6ae16 PM |
41 | # Find the checklitmus script. If it is not where we expect it, then |
42 | # assume that the caller has the PATH environment variable set | |
43 | # appropriately. | |
44 | if test -x scripts/checklitmus.sh | |
45 | then | |
46 | clscript=scripts/checklitmus.sh | |
47 | else | |
48 | clscript=checklitmus.sh | |
49 | fi | |
50 | ||
51 | # Run the script on all the litmus tests in the specified directory | |
52 | ret=0 | |
b02eb5b0 | 53 | for i in $litmusdir/*.litmus |
2fb6ae16 PM |
54 | do |
55 | if ! $clscript $i | |
56 | then | |
57 | ret=1 | |
58 | fi | |
59 | done | |
60 | if test "$ret" -ne 0 | |
61 | then | |
b02eb5b0 | 62 | echo " ^^^ VERIFICATION MISMATCHES" 1>&2 |
2fb6ae16 | 63 | else |
b02eb5b0 | 64 | echo All litmus tests verified as was expected. 1>&2 |
2fb6ae16 PM |
65 | fi |
66 | exit $ret |