Loading...
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0+
3#
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.
10#
11# Usage:
12# checkalllitmus.sh
13#
14# Run this in the directory containing the memory model.
15#
16# This script makes no attempt to run the litmus tests concurrently.
17#
18# Copyright IBM Corporation, 2018
19#
20# Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
21
22. scripts/parseargs.sh
23
24litmusdir=litmus-tests
25if test -d "$litmusdir" -a -r "$litmusdir" -a -x "$litmusdir"
26then
27 :
28else
29 echo ' --- ' error: $litmusdir is not an accessible directory
30 exit 255
31fi
32
33# Create any new directories that have appeared in the github litmus
34# repo since the last run.
35if test "$LKMM_DESTDIR" != "."
36then
37 find $litmusdir -type d -print |
38 ( cd "$LKMM_DESTDIR"; sed -e 's/^/mkdir -p /' | sh )
39fi
40
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.
44if test -x scripts/checklitmus.sh
45then
46 clscript=scripts/checklitmus.sh
47else
48 clscript=checklitmus.sh
49fi
50
51# Run the script on all the litmus tests in the specified directory
52ret=0
53for i in $litmusdir/*.litmus
54do
55 if ! $clscript $i
56 then
57 ret=1
58 fi
59done
60if test "$ret" -ne 0
61then
62 echo " ^^^ VERIFICATION MISMATCHES" 1>&2
63else
64 echo All litmus tests verified as was expected. 1>&2
65fi
66exit $ret
1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0+
3#
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.
10#
11# If the --hw argument is specified, this script translates the .litmus
12# C-language file to the specified type of assembly and verifies that.
13# But in this case, litmus tests using complex synchronization (such as
14# locking, RCU, and SRCU) are cheerfully ignored.
15#
16# Usage:
17# checkalllitmus.sh
18#
19# Run this in the directory containing the memory model.
20#
21# This script makes no attempt to run the litmus tests concurrently.
22#
23# Copyright IBM Corporation, 2018
24#
25# Author: Paul E. McKenney <paulmck@linux.ibm.com>
26
27. scripts/parseargs.sh
28
29litmusdir=litmus-tests
30if test -d "$litmusdir" -a -r "$litmusdir" -a -x "$litmusdir"
31then
32 :
33else
34 echo ' --- ' error: $litmusdir is not an accessible directory
35 exit 255
36fi
37
38# Create any new directories that have appeared in the litmus-tests
39# directory since the last run.
40if test "$LKMM_DESTDIR" != "."
41then
42 find $litmusdir -type d -print |
43 ( cd "$LKMM_DESTDIR"; sed -e 's/^/mkdir -p /' | sh )
44fi
45
46# Run the script on all the litmus tests in the specified directory
47ret=0
48for i in $litmusdir/*.litmus
49do
50 if test -n "$LKMM_HW_MAP_FILE" && ! scripts/simpletest.sh $i
51 then
52 continue
53 fi
54 if ! scripts/checklitmus.sh $i
55 then
56 ret=1
57 fi
58done
59if test "$ret" -ne 0
60then
61 echo " ^^^ VERIFICATION MISMATCHES" 1>&2
62else
63 echo All litmus tests verified as was expected. 1>&2
64fi
65exit $ret