source: git/tests/smoke.tst @ cde0214

Last change on this file since cde0214 was f96a8a84, checked in by Olly Betts <olly@…>, 2 months ago

Turn off aven+survexport tests on mingw

We can't seem to run these programs during the build now. This
appears to be due to some change in the Github CI images or a
dependency, as rebuilding the last good commit now fails. There
is no error message, but bash shows exit code 127 which means it
failed to run the command.

  • Property mode set to 100755
File size: 2.4 KB
Line 
1#!/bin/sh
2#
3# Survex test suite - smoke tests
4# Copyright (C) 1999-2025 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"}
24if [ -z "$SURVEXLIB" ] ; then
25  SURVEXLIB=`cd "$srcdir/../lib" && pwd`
26  export SURVEXLIB
27fi
28
29test -x "$testdir"/../src/cavern || testdir=.
30
31# Ensure that --version and --help work without an X display.
32DISPLAY=
33export DISPLAY
34
35PROGS="cavern diffpos extend sorterr"
36
37# FIXME aven and survexport are failing to run in CI on msys+mingw.
38[ "$OSTYPE" = "msys" ] || PROGS="$PROGS survexport aven"
39
40# Suppress checking for leaks on exit if we're build with lsan - we don't
41# generally waste effort to free all allocations as the OS will reclaim
42# memory on exit.
43LSAN_OPTIONS=leak_check_at_exit=0
44export LSAN_OPTIONS
45
46vgrun=
47vg_error=123
48vg_log=vg.log
49if [ -n "$VALGRIND" ] ; then
50  rm -f "$vg_log"
51  vgrun="$VALGRIND --log-file=$vg_log --error-exitcode=$vg_error"
52fi
53
54for p in ${PROGS}; do
55  echo $p
56  for o in version help ; do
57    if test "$VERBOSE" = 1; then
58      $vgrun "$testdir/../src/$p" --$o > stdout.log
59      exitcode=$?
60      test $exitcode = 0 || cat stdout.log
61      rm stdout.log
62    elif test -n "$VERBOSE"; then
63      $vgrun "$testdir/../src/$p" --$o
64      exitcode=$?
65    else
66      $vgrun "$testdir/../src/$p" --$o > /dev/null
67      exitcode=$?
68    fi 2> stderr.log
69    if [ -s stderr.log ] ; then
70      echo "$p --$o produced output on stderr:"
71      cat stderr.log
72      rm stderr.log
73      exit 1
74    fi
75    rm stderr.log
76    if [ -n "$VALGRIND" ] ; then
77      if [ $exitcode = "$vg_error" ] ; then
78        cat "$vg_log"
79        rm "$vg_log"
80        exit 1
81      fi
82      rm "$vg_log"
83    fi
84    [ "$exitcode" = 0 ] || exit 1
85  done
86done
87
88test -n "$VERBOSE" && echo "Test passed"
89exit 0
Note: See TracBrowser for help on using the repository browser.