1 #!/bin/bash 1 #!/bin/bash 2 # SPDX-License-Identifier: GPL-2.0+ 2 # SPDX-License-Identifier: GPL-2.0+ 3 # 3 # 4 # Run herd7 tests on all .litmus files in the 4 # Run herd7 tests on all .litmus files in the litmus-tests directory 5 # and check each file's result against a "Resu 5 # and check each file's result against a "Result:" comment within that 6 # litmus test. If the verification result doe 6 # litmus test. If the verification result does not match that specified 7 # in the litmus test, this script prints an er 7 # in the litmus test, this script prints an error message prefixed with 8 # "^^^". It also outputs verification results 8 # "^^^". It also outputs verification results to a file whose name is 9 # that of the specified litmus test, but with 9 # that of the specified litmus test, but with ".out" appended. 10 # 10 # 11 # If the --hw argument is specified, this scri 11 # If the --hw argument is specified, this script translates the .litmus 12 # C-language file to the specified type of ass 12 # C-language file to the specified type of assembly and verifies that. 13 # But in this case, litmus tests using complex 13 # But in this case, litmus tests using complex synchronization (such as 14 # locking, RCU, and SRCU) are cheerfully ignor 14 # locking, RCU, and SRCU) are cheerfully ignored. 15 # 15 # 16 # Usage: 16 # Usage: 17 # checkalllitmus.sh 17 # checkalllitmus.sh 18 # 18 # 19 # Run this in the directory containing the mem 19 # Run this in the directory containing the memory model. 20 # 20 # 21 # This script makes no attempt to run the litm 21 # This script makes no attempt to run the litmus tests concurrently. 22 # 22 # 23 # Copyright IBM Corporation, 2018 23 # Copyright IBM Corporation, 2018 24 # 24 # 25 # Author: Paul E. McKenney <paulmck@linux.ibm.c 25 # Author: Paul E. McKenney <paulmck@linux.ibm.com> 26 26 27 . scripts/parseargs.sh 27 . scripts/parseargs.sh 28 28 29 litmusdir=litmus-tests 29 litmusdir=litmus-tests 30 if test -d "$litmusdir" -a -r "$litmusdir" -a 30 if test -d "$litmusdir" -a -r "$litmusdir" -a -x "$litmusdir" 31 then 31 then 32 : 32 : 33 else 33 else 34 echo ' --- ' error: $litmusdir is not 34 echo ' --- ' error: $litmusdir is not an accessible directory 35 exit 255 35 exit 255 36 fi 36 fi 37 37 38 # Create any new directories that have appeare 38 # Create any new directories that have appeared in the litmus-tests 39 # directory since the last run. 39 # directory since the last run. 40 if test "$LKMM_DESTDIR" != "." 40 if test "$LKMM_DESTDIR" != "." 41 then 41 then 42 find $litmusdir -type d -print | 42 find $litmusdir -type d -print | 43 ( cd "$LKMM_DESTDIR"; sed -e 's/^/mkdi 43 ( cd "$LKMM_DESTDIR"; sed -e 's/^/mkdir -p /' | sh ) 44 fi 44 fi 45 45 46 # Run the script on all the litmus tests in th 46 # Run the script on all the litmus tests in the specified directory 47 ret=0 47 ret=0 48 for i in $litmusdir/*.litmus 48 for i in $litmusdir/*.litmus 49 do 49 do 50 if test -n "$LKMM_HW_MAP_FILE" && ! sc 50 if test -n "$LKMM_HW_MAP_FILE" && ! scripts/simpletest.sh $i 51 then 51 then 52 continue 52 continue 53 fi 53 fi 54 if ! scripts/checklitmus.sh $i 54 if ! scripts/checklitmus.sh $i 55 then 55 then 56 ret=1 56 ret=1 57 fi 57 fi 58 done 58 done 59 if test "$ret" -ne 0 59 if test "$ret" -ne 0 60 then 60 then 61 echo " ^^^ VERIFICATION MISMATCHES" 1> 61 echo " ^^^ VERIFICATION MISMATCHES" 1>&2 62 else 62 else 63 echo All litmus tests verified as was 63 echo All litmus tests verified as was expected. 1>&2 64 fi 64 fi 65 exit $ret 65 exit $ret
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.