source: git/tests/aven.tst @ 5a45706

RELEASE/1.2debug-cidebug-ci-sanitisersstereowalls-data
Last change on this file since 5a45706 was f723062, checked in by Olly Betts <olly@…>, 11 years ago

tests/Makefile.am,tests/aven.tst: Add new testsuite script (aven.tst)
which currently has regression tests for the recently fixed segfault
when aven didn't have messages for the requested language.

  • Property mode set to 100755
File size: 1.9 KB
Line 
1#!/bin/sh
2#
3# Survex test suite - aven tests
4# Copyright (C) 1999-2003,2005,2011,2012 Olly Betts
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
19
20testdir=`echo $0 | sed 's!/[^/]*$!!' || echo '.'`
21
22# allow us to run tests standalone more easily
23: ${srcdir="$testdir"}
24
25test -x "$testdir"/../src/cavern || testdir=.
26
27: ${AVEN="$testdir"/../src/aven}
28
29vg_error=123
30vg_log=vg.log
31if [ -n "$VALGRIND" ] ; then
32  rm -f "$vg_log"
33  AVEN="$VALGRIND --log-file=$vg_log --error-exitcode=$vg_error $AVEN"
34fi
35
36# Regression test - aven in 1.2.6 segfaulted.
37if test -n "$VERBOSE"; then
38  DISPLAY= SURVEXLANG=nosuch $AVEN
39  exitcode=$?
40else
41  DISPLAY= SURVEXLANG=nosuch $AVEN > /dev/null 2>&1
42  exitcode=$?
43fi
44if [ -n "$VALGRIND" ] ; then
45  if [ $exitcode = "$vg_error" ] ; then
46    cat "$vg_log"
47    rm "$vg_log"
48    exit 1
49  fi
50  rm "$vg_log"
51fi
52[ "$exitcode" = 1 ] || exit 1
53
54# Regression test - aven in 1.2.6 segfaulted.
55if test -n "$VERBOSE"; then
56  DISPLAY= SURVEXLANG= LANG=nosuch $AVEN
57  exitcode=$?
58else
59  DISPLAY= SURVEXLANG= LANG=nosuch $AVEN > /dev/null 2>&1
60  exitcode=$?
61fi
62if [ -n "$VALGRIND" ] ; then
63  if [ $exitcode = "$vg_error" ] ; then
64    cat "$vg_log"
65    rm "$vg_log"
66    exit 1
67  fi
68  rm "$vg_log"
69fi
70[ "$exitcode" = 255 ] || exit 1
71
72test -n "$VERBOSE" && echo "Test passed"
73exit 0
Note: See TracBrowser for help on using the repository browser.