source: git/tests/aven.tst @ 34f9067

debug-cidebug-ci-sanitisersfaster-cavernlogwalls-datawalls-data-hanging-as-warning
Last change on this file since 34f9067 was 43e8c72, checked in by Olly Betts <olly@…>, 3 years ago

Suppress lsan leak checking on exit

If the tree is built with LeakSanitiser? then some tests fail due to
us not releasing all memory explicitly on exit (doing so would mean
extra work for no reason as the OS reclaims all memory when the
process exits). If LeakSanitiser? isn't in use then setting LSAN_OPTIONS
should be harmless.

  • Property mode set to 100755
File size: 2.2 KB
Line 
1#!/bin/sh
2#
3# Survex test suite - aven tests
4# Copyright (C) 1999-2021 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
29# Suppress checking for leaks on exit if we're build with lsan - we don't
30# generally waste effort to free all allocations as the OS will reclaim
31# memory on exit.
32LSAN_OPTIONS=leak_check_at_exit=0
33export LSAN_OPTIONS
34
35vg_error=123
36vg_log=vg.log
37if [ -n "$VALGRIND" ] ; then
38  rm -f "$vg_log"
39  AVEN="$VALGRIND --log-file=$vg_log --error-exitcode=$vg_error $AVEN"
40fi
41
42# Regression test - aven in 1.2.6 segfaulted.
43echo "SURVEXLANG=nosuch aven --help"
44if test -n "$VERBOSE"; then
45  DISPLAY= SURVEXLANG=nosuch $AVEN --help
46  exitcode=$?
47else
48  DISPLAY= SURVEXLANG=nosuch $AVEN --help > /dev/null 2>&1
49  exitcode=$?
50fi
51if [ -n "$VALGRIND" ] ; then
52  if [ $exitcode = "$vg_error" ] ; then
53    cat "$vg_log"
54    rm "$vg_log"
55    exit 1
56  fi
57  rm "$vg_log"
58fi
59[ "$exitcode" = 1 ] || exit 1
60
61# Regression test - aven in 1.2.6 segfaulted.
62echo "SURVEXLANG= LANG=nosuch aven --help"
63if test -n "$VERBOSE"; then
64  DISPLAY= SURVEXLANG= LANG=nosuch $AVEN --help
65  exitcode=$?
66else
67  DISPLAY= SURVEXLANG= LANG=nosuch $AVEN --help > /dev/null 2>&1
68  exitcode=$?
69fi
70if [ -n "$VALGRIND" ] ; then
71  if [ $exitcode = "$vg_error" ] ; then
72    cat "$vg_log"
73    rm "$vg_log"
74    exit 1
75  fi
76  rm "$vg_log"
77fi
78[ "$exitcode" = 0 ] || exit 1
79
80test -n "$VERBOSE" && echo "Test passed"
81exit 0
Note: See TracBrowser for help on using the repository browser.