~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/tools/runtest

Version: ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 #!/bin/sh
  2 #
  3 # Wrapper script to run tests from inside the Wine tree
  4 #
  5 # Usage: runtest [options] input_file
  6 #
  7 # Copyright 2002 Alexandre Julliard
  8 # Copyright 2002 Dimitrie O. Paun
  9 #
 10 # This library is free software; you can redistribute it and/or
 11 # modify it under the terms of the GNU Lesser General Public
 12 # License as published by the Free Software Foundation; either
 13 # version 2.1 of the License, or (at your option) any later version.
 14 #
 15 # This library is distributed in the hope that it will be useful,
 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 18 # Lesser General Public License for more details.
 19 #
 20 # You should have received a copy of the GNU Lesser General Public
 21 # License along with this library; if not, write to the Free Software
 22 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 23 #
 24 
 25 usage()
 26 {
 27     cat >&2 <<EOF
 28 
 29 Usage: $0 [options] [input_file]
 30 
 31 input_file:  the source code for the test program
 32 
 33 Options:
 34     -q       quiet mode
 35     -v       verbose mode (can be specified multiple times)
 36     -i       interactive mode (runs even more tests)
 37     -s       announce successful tests
 38     -p prog  name of the program to run for C tests
 39     -P name  set the current platform name
 40     -M names set the module names to be tested
 41     -T dir   set Wine tree top directory (autodetected if not specified)
 42 
 43 EOF
 44     exit 1
 45 }
 46 
 47 # Default values
 48 platform=$WINETEST_PLATFORM
 49 WINETEST_DEBUG=${WINETEST_DEBUG:-1}
 50 
 51 # parse command-line options
 52 while [ "$#" -gt 0 ]; do
 53     case "$1" in
 54     -h)
 55         usage
 56     ;;
 57     -p)
 58         shift; program="$1"
 59     ;;
 60     -q)
 61         WINETEST_DEBUG=0
 62     ;;
 63     -v)
 64         WINETEST_DEBUG=`expr $WINETEST_DEBUG + 1`
 65     ;;
 66     -i)
 67         WINETEST_INTERACTIVE=1
 68         export WINETEST_INTERACTIVE
 69     ;;
 70     -s)
 71         WINETEST_REPORT_SUCCESS=1
 72         export WINETEST_REPORT_SUCCESS
 73     ;;
 74     -P)
 75         shift; platform="$1"
 76     ;;
 77     -M)
 78         shift; modules="$1"
 79     ;;
 80     -T)
 81         shift; topobjdir="$1"
 82         if [ ! -d "$topobjdir" ]; then usage; fi
 83     ;;
 84     *)
 85         break
 86     ;;
 87     esac
 88     shift
 89 done        
 90         
 91 if [ -z "$program" ]; then
 92     # try to autodetect the test program name based on the working directory
 93     working_path=`pwd`
 94     working_basename=`basename "$working_path"`
 95     if [ "$working_basename" = "tests" ]; then
 96         parent_path=`dirname "$working_path"`
 97         parent_basename=`basename "$parent_path"`
 98         program="${parent_basename}_test.exe.so"
 99     elif [ -d "tests" ]; then
100         program="tests/${working_basename}_test.exe.so"
101     fi
102 fi
103 if [ ! -f "$program" ]; then
104     echo "Can't find the test program, use the -p argument to specify one" 1>&2
105     usage
106 fi
107 
108 # check/detect topobjdir
109 if [ -n "$topobjdir" ]; then
110     if [ ! -f "$topobjdir/server/wineserver" ]
111     then
112         echo "Wrong -T argument, $topobjdir/server/wineserver does not exist" 1>&2
113         usage
114     fi
115 else
116     if [ -f "./server/wineserver" ]; then topobjdir="."
117     elif [ -f "../server/wineserver" ]; then topobjdir=".."
118     elif [ -f "../../server/wineserver" ]; then topobjdir="../.."
119     elif [ -f "../../../server/wineserver" ]; then topobjdir="../../.."
120     else
121         echo "Can't find the top of the Wine tree (use the -T argument)" 1>&2
122         usage
123     fi
124 fi
125 
126 # set environment variables needed for Wine
127 
128 if [ -n "$modules" ]; then
129     WINEDLLOVERRIDES="$WINEDLLOVERRIDES;$modules=b"
130     export WINEDLLOVERRIDES
131 fi
132 WINETEST_PLATFORM=${platform:-wine}
133 export WINETEST_PLATFORM WINETEST_DEBUG
134 
135 # WINETEST_WRAPPER is normally empty, but can be set by caller, e.g.
136 #  WINETEST_WRAPPER=time
137 # would give data about how long each test takes, and
138 #  WINETEST_WRAPPER=valgrind
139 # would run the tests under valgrind to look for memory errors.
140 
141 exec $WINETEST_WRAPPER "$topobjdir/wine" "$program" "$@"

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.