Skip to content
Snippets Groups Projects
Select Git revision
  • 31f7e826195fe65acd150a5f516f56a36abbe235
  • master default protected
  • 9.0
  • 8.0
  • nt-tools
  • 7.8
  • 7.6
  • 7.4
  • 7.2
  • 7.0
  • 0.6
  • rosuav/latex-markdown-renderer
  • rxnpatch/rxnpatch
  • marcus/gobject-introspection
  • rxnpatch/8.0
  • rosuav/pre-listening-ports
  • rosuav/async-annotations
  • rosuav/pgsql-ssl
  • rxnpatch/rxnpatch-broken/2023-10-06T094250
  • grubba/fdlib
  • grubba/wip/sakura/8.0
  • v8.0.2020
  • v8.0.2018
  • v8.0.2016
  • v8.0.2014
  • v8.0.2012
  • v8.0.2008
  • v8.0.2006
  • v8.0.2004
  • v8.0.2002
  • v8.0.2000
  • v8.0.1998
  • v8.0.1996
  • v8.0.1994
  • v8.0.1992
  • v8.0.1990
  • v8.0.1988
  • v8.0.1986
  • rxnpatch/clusters/8.0/2025-04-29T124414
  • rxnpatch/2025-04-29T124414
  • v8.0.1984
41 results

cpp.h

Blame
  • run-tests 2.70 KiB
    #! /bin/sh
    
    # Copyright (C) 2000, 2001, 2002, 2004, 2005, 2011, 2012  Niels Möller
    #
    # This program is free software; you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation; either version 2 of the License, or
    # (at your option) any later version.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License along
    # with this program; if not, write to the Free Software Foundation, Inc.,
    # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
    
    failed=0
    all=0
    
    debug='no'
    testflags=''
    
    if [ -z "$srcdir" ] ; then
      srcdir=`pwd`
    fi
    
    export srcdir
    
    if [ -n "$TEST_SHLIB_DIR" ] ; then
      # Prepend to LD_LIBRARY_PATH, if it is alredy set.
      LD_LIBRARY_PATH="${TEST_SHLIB_DIR}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
      # For MACOS
      DYLD_LIBRARY_PATH="$TEST_SHLIB_DIR"
      # For Windows
      PATH="${TEST_SHLIB_DIR}:${PATH}"
      # For Wine
      WINEPATH="${TEST_SHLIB_DIR}"
    
      export LD_LIBRARY_PATH
      export DYLD_LIBRARY_PATH
      export PATH
      export WINEPATH
    fi
    
    # When used in make rules, we sometimes get the filenames VPATH
    # expanded, but usually not.
    find_program () {
        case "$1" in
    	*/*)
    	  echo "$1"
    	  ;;
    	*)
    	  if [ -x "$1" ] ; then
    	      echo "./$1"
    	  else
    	      echo "$srcdir/$1"
    	  fi
    	  ;;
        esac
    }
    
    env_program () {
      if [ -x "$1" ] ; then
        if "$1"; then : ; else
          echo FAIL: $1
          exit 1
        fi
      fi
    }
    
    test_program () {
      testname=`basename "$1" .exe`
      testname=`basename "$testname" -test`
      if [ -z "$EMULATOR" ] || head -1 "$1" | grep '^#!' > /dev/null; then
        "$1" $testflags
      else
        $EMULATOR "$1" $testflags
      fi
      case "$?" in
          0)
    	echo PASS: $testname
    	all=`expr $all + 1`
    	;;
          77)
    	echo SKIP: $testname
          ;;
          *)
    	echo FAIL: $testname
    	failed=`expr $failed + 1`
    	all=`expr $all + 1`
    	;;
      esac
    }
    
    env_program `find_program setup-env`
    
    while test $# != 0
    do
      case "$1" in
      --debug)
        debug=yes
        ;;
      -v)
        testflags='-v'
        ;;
      -*)
        echo >&2 'Unknown option `'"$1'"
        exit 1
        ;;
      *)
        break
        ;;
      esac
      shift
    done
    
    if [ $# -eq 0 ] ; then
      for f in *-test; do test_program "./$f"; done
    else
      for f in "$@" ; do test_program `find_program "$f"`; done
    fi
    
    if [ $failed -eq 0 ] ; then
      banner="All $all tests passed"
    else
      banner="$failed of $all tests failed"
    fi
    dashes=`echo "$banner" | sed s/./=/g`
    echo "$dashes"
    echo "$banner"
    echo "$dashes"
    
    if [ "x$debug" = xno ] ; then
      env_program `find_program teardown-env`
    fi
    
    [ "$failed" -eq 0 ]