From bbadd00d572129d2cc212b44d2f4ab10956a8a2b Mon Sep 17 00:00:00 2001 From: Huub Van Dam Date: Fri, 17 Jan 2014 01:54:19 +0000 Subject: [PATCH] HvD: Extended the validate script so that one can choose the diff program to be used in generating the results for the user. The default still is tkdiff which represents the diff output graphically. However, one can set the environment variable VAL_DIFF to select something else. --- contrib/validate/validate | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/contrib/validate/validate b/contrib/validate/validate index fdb44c6f3b..6703404c8a 100755 --- a/contrib/validate/validate +++ b/contrib/validate/validate @@ -24,6 +24,17 @@ else path="`which \"$0\"`" path="`dirname \"$path\"`" fi +if [ ${#VAL_DIFF} -eq 0 ] ; then + VAL_DIFF=`which tkdiff` +fi +if [ ${#VAL_DIFF} -eq 0 ] ; then + VAL_DIFF=`which diff` +fi +if [ ${#VAL_DIFF} -eq 0 ] ; then + echo "Found no diff program. Giving up..." + exit 10 +fi +export VAL_DIFF testlist=`$path/get_tests.bash $1` for tcase in $testlist; do if [ -f testoutputs/${tcase}.out.nwparse ] ; then @@ -33,7 +44,7 @@ for tcase in $testlist; do stat=$? if [ ${stat} -ne 0 ] ; then echo " ... failed ... diffing ..." - tkdiff testoutputs/${tcase}.ok.out.nwparse testoutputs/${tcase}.out.nwparse + ${VAL_DIFF} testoutputs/${tcase}.ok.out.nwparse testoutputs/${tcase}.out.nwparse else echo " ... OK" fi @@ -45,7 +56,7 @@ for tcase in $testlist; do stat=$? if [ ${stat} -ne 0 ] ; then echo " ... failed ... diffing ..." - tkdiff testoutputs/${tcase}.ok.tst testoutputs/${tcase}.top + ${VAL_DIFF} testoutputs/${tcase}.ok.tst testoutputs/${tcase}.top else echo " ... OK" fi @@ -55,7 +66,7 @@ for tcase in $testlist; do stat=$? if [ ${stat} -ne 0 ] ; then echo " ... failed ... diffing ..." - tkdiff testoutputs/${tcase}.ok.tst testoutputs/${tcase}.tst + ${VAL_DIFF} testoutputs/${tcase}.ok.tst testoutputs/${tcase}.tst else echo " ... OK" fi @@ -63,7 +74,7 @@ for tcase in $testlist; do else # This is a regular test case that crashed. echo "Test:" ${tcase} " ... failed ... diffing ..." - tkdiff testoutputs/${tcase}.ok.out testoutputs/${tcase}.out + ${VAL_DIFF} testoutputs/${tcase}.ok.out testoutputs/${tcase}.out fi done echo "... All Done ..."