source: git/tests/compare.tst @ c4456f5

RELEASE/1.0RELEASE/1.2debug-cidebug-ci-sanitisersstereowalls-data
Last change on this file since c4456f5 was 6ae626d, checked in by Olly Betts <olly@…>, 22 years ago

Compare results of two different versions of cavern on the same data.

git-svn-id: file:///home/survex-svn/survex/trunk@2049 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

  • Property mode set to 100755
File size: 1.3 KB
Line 
1#!/bin/sh
2
3testdir=`echo $0 | sed 's!/[^/]*$!!' || echo '.'`
4
5# allow us to run tests standalone more easily
6: ${srcdir="$testdir"}
7
8# force VERBOSE if we're run on a subset of tests
9#test -n "$*" && VERBOSE=1
10
11test -x "$testdir"/../src/cavern || testdir=.
12
13: ${CAVERN="$testdir"/../src/cavern}
14: ${CAVERN_ORIG=cavern}
15: ${DIFFPOS="$testdir"/../src/diffpos}
16
17: ${TESTS=${*-""}}
18
19for file in $TESTS ; do
20 
21  if test -n "$file" ; then
22    echo "$file"
23    rm -f tmp.* tmp_orig.*
24    if test -n "$VERBOSE" ; then
25      $CAVERN_ORIG $file --output=tmp_orig | tee tmp_orig.out || exit 1
26      $CAVERN $file --output=tmp | tee tmp.out || exit 1
27    else
28      $CAVERN_ORIG $file --output=tmp_orig > tmp_orig.out || exit 1
29      $CAVERN $file --output=tmp > tmp.out || exit 1
30    fi
31    warn_orig=`sed '$!d;$s/^Done.*/0/;s/[^0-9]*\([0-9]*\).*/\1/' tmp_orig.out`
32    warn=`sed '$!d;$s/^Done.*/0/;s/[^0-9]*\([0-9]*\).*/\1/' tmp.out`
33    if test x"$warn_orig" != x"$warn" ; then
34      echo "$CAVERN_ORIG gave $warn_orig warning(s)"
35      echo "$CAVERN gave $warn warning(s)"
36      exit 1
37    fi
38    if test -n "$VERBOSE" ; then
39      $DIFFPOS tmp.3d tmp_orig.3d || exit 1
40    else
41      $DIFFPOS tmp.3d tmp_orig.3d > /dev/null || exit 1
42    fi
43  fi
44done
45test -n "$VERBOSE" && echo "Test passed"
46exit 0
Note: See TracBrowser for help on using the repository browser.