From e39e8a172b862f6feb6540570843811a595bc182 Mon Sep 17 00:00:00 2001 From: "Dimitrie O. Paun" Date: Mon, 11 Nov 2002 20:25:54 +0000 Subject: [PATCH] Rewrite make_ctests and runtest in shell. --- Make.rules.in | 7 +-- dlls/Maketest.rules.in | 2 +- tools/make_ctests | 60 +++++++++++++++++++++ tools/runtest | 116 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 179 insertions(+), 6 deletions(-) create mode 100755 tools/make_ctests create mode 100755 tools/runtest diff --git a/Make.rules.in b/Make.rules.in index 4076da6af7a..8174c1d7231 100644 --- a/Make.rules.in +++ b/Make.rules.in @@ -64,7 +64,7 @@ ALLLINTFLAGS = $(LINTFLAGS) $(DEFS) $(OPTIONS) $(DIVINCL) MKINSTALLDIRS= $(TOPSRCDIR)/tools/mkinstalldirs WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi_check/winapi_check WINEWRAPPER = $(TOPSRCDIR)/tools/winewrapper -RUNTEST = $(TOPSRCDIR)/programs/winetest/runtest +RUNTEST = $(TOPSRCDIR)/tools/runtest WINEBUILD = $(TOOLSDIR)/tools/winebuild/winebuild MAKEDEP = $(TOOLSDIR)/tools/makedep WRC = $(TOOLSDIR)/tools/wrc/wrc @@ -105,7 +105,7 @@ LINTS = $(C_SRCS:.c=.ln) # Implicit rules -.SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.c .spec.def .pl .ok .cross.o +.SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.c .spec.def .ok .cross.o .c.o: $(CC) -c $(ALLCFLAGS) -o $@ $< @@ -137,9 +137,6 @@ LINTS = $(C_SRCS:.c=.ln) .c.ok: $(RUNTEST) $(RUNTESTFLAGS) $< && touch $@ -.pl.ok: - $(RUNTEST) $(RUNTESTFLAGS) $< && touch $@ - # 'all' target first in case the enclosing Makefile didn't define any target all: Makefile diff --git a/dlls/Maketest.rules.in b/dlls/Maketest.rules.in index 4c7a77fd617..08ab0ccc97b 100644 --- a/dlls/Maketest.rules.in +++ b/dlls/Maketest.rules.in @@ -45,7 +45,7 @@ $(MODULE): $(OBJS) $(RCOBJS) Makefile.in # Rules for building test list $(TESTLIST): Makefile.in - $(TOPSRCDIR)/programs/winetest/make_ctests $(CTESTS) >$(TESTLIST) || $(RM) $(TESTLIST) + $(TOPSRCDIR)/tools/make_ctests $(CTESTS) >$(TESTLIST) || $(RM) $(TESTLIST) # Rules for checking that no imports are missing diff --git a/tools/make_ctests b/tools/make_ctests new file mode 100755 index 00000000000..0a9d5caa033 --- /dev/null +++ b/tools/make_ctests @@ -0,0 +1,60 @@ +#!/bin/sh +# +# Script to generate a C file containing a list of tests +# +# Copyright 2002 Alexandre Julliard +# Copyright 2002 Dimitrie O. Paun +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +cat < +#include +#include "winbase.h" + +EOF + +for file in "$@"; do + test=`basename "$file" .c` + echo "extern void func_$test(void);" +done + +cat <2 <&1 + usage + fi +else + if [ -f "./server/wineserver" ]; then topobjdir="." + elif [ -f "../server/wineserver" ]; then topobjdir=".." + elif [ -f "../../server/wineserver" ]; then topobjdir="../.." + elif [ -f "../../../server/wineserver" ]; then topobjdir="../../.." + fi +fi + +# set environment variables needed for Wine + +if [ -n "$modules" ]; then + WINEOPTIONS="$WINEOPTIONS --dll $modules=b" + export WINEOPTIONS +fi +WINETEST_PLATFORM=${platform:-wine} +export WINETEST_PLATFORM WINETEST_DEBUG + +exec "$topobjdir/wine" "$program" "$infile" "$@"