hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/tools/memory-model/scripts/checkalllitmus.sh
....@@ -1,48 +1,41 @@
11 #!/bin/sh
2
+# SPDX-License-Identifier: GPL-2.0+
23 #
3
-# Run herd tests on all .litmus files in the specified directory (which
4
-# defaults to litmus-tests) and check each file's result against a "Result:"
5
-# comment within that litmus test. If the verification result does not
6
-# match that specified in the litmus test, this script prints an error
7
-# message prefixed with "^^^". It also outputs verification results to
8
-# a file whose name is that of the specified litmus test, but with ".out"
9
-# appended.
4
+# Run herd7 tests on all .litmus files in the litmus-tests directory
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.
1010 #
1111 # Usage:
12
-# checkalllitmus.sh [ directory ]
12
+# checkalllitmus.sh
1313 #
14
-# The LINUX_HERD_OPTIONS environment variable may be used to specify
15
-# arguments to herd, whose default is defined by the checklitmus.sh script.
16
-# Thus, one would normally run this in the directory containing the memory
17
-# model, specifying the pathname of the litmus test to check.
14
+# Run this in the directory containing the memory model.
1815 #
1916 # This script makes no attempt to run the litmus tests concurrently.
20
-#
21
-# This program is free software; you can redistribute it and/or modify
22
-# it under the terms of the GNU General Public License as published by
23
-# the Free Software Foundation; either version 2 of the License, or
24
-# (at your option) any later version.
25
-#
26
-# This program is distributed in the hope that it will be useful,
27
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
28
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29
-# GNU General Public License for more details.
30
-#
31
-# You should have received a copy of the GNU General Public License
32
-# along with this program; if not, you can access it online at
33
-# http://www.gnu.org/licenses/gpl-2.0.html.
3417 #
3518 # Copyright IBM Corporation, 2018
3619 #
3720 # Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
3821
39
-litmusdir=${1-litmus-tests}
22
+. scripts/parseargs.sh
23
+
24
+litmusdir=litmus-tests
4025 if test -d "$litmusdir" -a -r "$litmusdir" -a -x "$litmusdir"
4126 then
4227 :
4328 else
4429 echo ' --- ' error: $litmusdir is not an accessible directory
4530 exit 255
31
+fi
32
+
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 )
4639 fi
4740
4841 # Find the checklitmus script. If it is not where we expect it, then
....@@ -57,7 +50,7 @@
5750
5851 # Run the script on all the litmus tests in the specified directory
5952 ret=0
60
-for i in litmus-tests/*.litmus
53
+for i in $litmusdir/*.litmus
6154 do
6255 if ! $clscript $i
6356 then
....@@ -66,8 +59,8 @@
6659 done
6760 if test "$ret" -ne 0
6861 then
69
- echo " ^^^ VERIFICATION MISMATCHES"
62
+ echo " ^^^ VERIFICATION MISMATCHES" 1>&2
7063 else
71
- echo All litmus tests verified as was expected.
64
+ echo All litmus tests verified as was expected. 1>&2
7265 fi
7366 exit $ret