blob: dd08801a30b0511b029cadb7bfdbe99a6089f78c [file] [log] [blame]
Paul E. McKenney2fb6ae12018-05-14 16:33:47 -07001#!/bin/sh
Paul E. McKenneyb02eb5b2018-12-03 15:04:50 -08002# SPDX-License-Identifier: GPL-2.0+
Paul E. McKenney2fb6ae12018-05-14 16:33:47 -07003#
Paul E. McKenneyb02eb5b2018-12-03 15:04:50 -08004# Run a herd test and invokes judgelitmus.sh to check the result against
5# a "Result:" comment within the litmus test. It also outputs verification
Paul E. McKenney2fb6ae12018-05-14 16:33:47 -07006# results to a file whose name is that of the specified litmus test, but
7# with ".out" appended.
8#
9# Usage:
Paul E. McKenney24675bb2018-07-16 11:05:58 -070010# checklitmus.sh file.litmus
Paul E. McKenney2fb6ae12018-05-14 16:33:47 -070011#
Paul E. McKenneyb02eb5b2018-12-03 15:04:50 -080012# Run this in the directory containing the memory model, specifying the
13# pathname of the litmus test to check. The caller is expected to have
14# properly set up the LKMM environment variables.
Paul E. McKenney2fb6ae12018-05-14 16:33:47 -070015#
16# Copyright IBM Corporation, 2018
17#
18# Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
19
20litmus=$1
Paul E. McKenneyb02eb5b2018-12-03 15:04:50 -080021herdoptions=${LKMM_HERD_OPTIONS--conf linux-kernel.cfg}
Paul E. McKenney2fb6ae12018-05-14 16:33:47 -070022
23if test -f "$litmus" -a -r "$litmus"
24then
25 :
26else
27 echo ' --- ' error: \"$litmus\" is not a readable file
28 exit 255
29fi
Paul E. McKenney2fb6ae12018-05-14 16:33:47 -070030
Paul E. McKenneyb02eb5b2018-12-03 15:04:50 -080031echo Herd options: $herdoptions > $LKMM_DESTDIR/$litmus.out
32/usr/bin/time $LKMM_TIMEOUT_CMD herd7 $herdoptions $litmus >> $LKMM_DESTDIR/$litmus.out 2>&1
33
34scripts/judgelitmus.sh $litmus