diff --git a/contrib/validate/get_tests.bash b/contrib/validate/get_tests.bash new file mode 100755 index 0000000000..e066213f5b --- /dev/null +++ b/contrib/validate/get_tests.bash @@ -0,0 +1,20 @@ +#!/bin/bash +# +# get_tests.bash +# -------------- +# +# Go through the output of the QA run and extract the names of all the test +# cases that were run. The list of tests run is echoed to standard output. +# +# Arguments: +# +# - $0: The name of this script +# - $1: The log filename from the QA test suite run +# +job_list=`grep -v 'QM: Running' $1 | grep Running` +for job in $job_list; do + if [ $job != "Running" ] ; then + testname=`basename $job` + echo $testname + fi +done diff --git a/contrib/validate/validate b/contrib/validate/validate new file mode 100755 index 0000000000..3a25e8ac44 --- /dev/null +++ b/contrib/validate/validate @@ -0,0 +1,47 @@ +#!/bin/bash +# +# Validate +# ======== +# +# Go through the output of the QA test suite run, and for every test case +# that failed summarize the differences. +# +# Command line arguments: +# +# - $0: this script +# - $1: the name of the log file +# +# First we want to know where we are so that we can invoke the scripts we +# need. The scripts we need live in the same location as this file. +# +if [ -f "$0" ] ; then + # The first item on the command line is an actual file so it must have + # been specified including the path. + path="`dirname \"$0\"`" +else + # The first item on the command line is not a file so it must have been + # found in PATH. + path="`which \"$0\"`" + path="`dirname \"$path\"`" +fi +testlist=`$path/get_tests.bash $1` +for tcase in $testlist; do + if [ -f testoutputs/${tcase}.out.nwparse ] ; then + # This is a regular test case that completed. + diff testoutputs/${tcase}.ok.out.nwparse testoutputs/${tcase}.out.nwparse > /dev/null + stat=$? + if [ ${stat} -ne 0 ] ; then + tkdiff testoutputs/${tcase}.ok.out.nwparse testoutputs/${tcase}.out.nwparse + fi + elif [ -f testoutputs/${tcase}.ok.tst ] ; then + # This is a molecular dynamics simulation. + diff testoutputs/${tcase}.ok.tst testoutputs/${tcase}.top > /dev/null + stat=$? + if [ ${stat} -ne 0 ] ; then + tkdiff testoutputs/${tcase}.ok.tst testoutputs/${tcase}.top + fi + else + # This is a regular test case that crashed. + tkdiff testoutputs/${tcase}.ok.out testoutputs/${tcase}.out + fi +done