From b5203343bd7d4e34546ce2701f4daeefc5081596 Mon Sep 17 00:00:00 2001 From: guido Date: Mon, 19 Jun 2006 17:48:50 +0000 Subject: [PATCH] add new script for test evaluation git-svn-id: https://svn.dealii.org/trunk@13274 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/common/scripts/diffsearch | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 deal.II/common/scripts/diffsearch diff --git a/deal.II/common/scripts/diffsearch b/deal.II/common/scripts/diffsearch new file mode 100755 index 0000000000..2d7a0b9090 --- /dev/null +++ b/deal.II/common/scripts/diffsearch @@ -0,0 +1,54 @@ +#!/bin/bash +# $Id$ + +###################################################################### +# +# Compare the file $1/output with files in $1/cmp +# +# Upon success, store the name of the successful file in $1/cmp +# in the file $1/OK +# +###################################################################### + +# Process command line arguments. +# $1 is the name of the test. +# +# options may be +# -v for verbose output of diff + +diffout="/dev/null" +diffopt="" + +for arg in $* ; do + if test "x$arg" = "x-v" ; then + diffout="/dev/stdout" ; + fi +done + +# First, we check if $1/OK exists. If so, it hopefully contains the +# name of the successful comparison file in $1/cmp + +if test -r $1/OK; then + okname=`cat $1/OK` + if test "x$okname" != "x" ; then + echo -n " $1/cmp/$okname" + if diff $diffopt $1/output $1/cmp/$okname > $diffout ; then + exit 0 ; + fi + fi +fi + +# If this round failed, check all files in this directory +# If successful, write the name into $1/OK + +for file in `cd $1/cmp ; ls` ; do + echo -n " $1/cmp/$file" + if diff $diffopt $1/output $1/cmp/$file > $diffout ; then + echo $file > $1/OK + exit 0 ; + fi +done + +# All files failed +exit 1 + -- 2.39.5