From: Avery Pennarun Date: Fri, 1 May 2009 01:28:26 +0000 (-0400) Subject: Added a Makefile to dotnet as an example of how to run tests. X-Git-Url: http://rtime.felk.cvut.cz/gitweb/wvtest.git/commitdiff_plain/d19369aa51ae562215578a45772166a1a4b24ce3 Added a Makefile to dotnet as an example of how to run tests. ...and call it from the top level 'make test' too. --- diff --git a/Makefile b/Makefile index 42f5a4b..3755d3c 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,12 @@ all: - @echo "There's nothing to build here, really." + @echo "There's nothing to build here except the tests." @echo @echo "Try: make test" runtests: - make -C python test + make -C python runtests + make -C dotnet runtests test: ./wvtestrunner.pl $(MAKE) runtests diff --git a/dotnet/.gitignore b/dotnet/.gitignore new file mode 100644 index 0000000..cd79073 --- /dev/null +++ b/dotnet/.gitignore @@ -0,0 +1 @@ +*.cs.E diff --git a/dotnet/Makefile b/dotnet/Makefile new file mode 100644 index 0000000..77a8663 --- /dev/null +++ b/dotnet/Makefile @@ -0,0 +1,20 @@ +all: + @echo "Try: make test" + @false + +include wvtestrules.mk + +CPPFLAGS=-I. + +t/test.exe: wvtest.cs wvtestmain.cs t/wvtest.t.cs.E + gmcs /out:$@ /debug $^ + +runtests: t/test.exe + cd t && mono --debug test.exe + +test: + ../wvtestrunner.pl $(MAKE) runtests + +clean:: + rm -f *~ t/*~ *.E t/*.E *.d t/*.d t/*.exe t/*.mdb + diff --git a/dotnet/wvtest.t.cs b/dotnet/t/wvtest.t.cs similarity index 100% rename from dotnet/wvtest.t.cs rename to dotnet/t/wvtest.t.cs diff --git a/dotnet/wvtestmain.cs b/dotnet/wvtestmain.cs new file mode 100644 index 0000000..272a128 --- /dev/null +++ b/dotnet/wvtestmain.cs @@ -0,0 +1,15 @@ +/* + * Versaplex: + * Copyright (C)2007-2008 Versabanq Innovations Inc. and contributors. + * See the included file named LICENSE for license information. + */ +using System; +using Wv.Test; + +public class WvTestMain +{ + public static void Main() + { + WvTest.DoMain(); + } +} diff --git a/dotnet/monorules.mk b/dotnet/wvtestrules.mk similarity index 52% rename from dotnet/monorules.mk rename to dotnet/wvtestrules.mk index e066ec9..c78bd55 100644 --- a/dotnet/monorules.mk +++ b/dotnet/wvtestrules.mk @@ -7,20 +7,6 @@ SHELL=/bin/bash # our C# (.cs) files CSCPP=cpp -# Cygwin supports symlinks, but they aren't actually useful outside cygwin, -# so let's just copy instead. We also use Microsoft's .net compiler instead -# of mono. -ifeq ($(OS),Windows_NT) - CSC?=csc - SYMLINK=cp - MONORUN= -else - CSC?=gmcs -langversion:linq - SYMLINK=ln -sf - PKGS += /r:Mono.Posix - MONORUN=mono --debug -endif - CSFLAGS=/warn:4 /debug #CSFLAGS += /warnaserror @@ -46,38 +32,3 @@ include $(patsubst %.cs.E,%.d,$(filter %.cs.E,$(FILES))) | sed -e 's,^#include,//#include,' \ | grep -v '^# [0-9]' \ >$@ || (rm -f $@ && exit 1) - - -define csbuild - @for d in $(filter ../%.dll,$^); do \ - rm -f $$(basename $$d); \ - $(SYMLINK) -v $$d .; \ - done - $(CSC) $(CSFLAGS) /target:$1 /out:$@ \ - $(PKGS) \ - $(filter %.cs.E %.cs,$^) \ - $(patsubst %.dll,/r:%.dll,$(filter %.dll,$^)) -endef - - -%.dll: assemblyinfo.cs - $(call csbuild,library) - -# This must come before the %.cs rule, since %.cs.E files are better. -%.exe: %.cs.E - $(call csbuild,exe) - -%.exe: %.cs - $(call csbuild,exe) - -%: %.exe - rm -f $@ - $(SYMLINK) $< $@ - -%.pass: %.exe - rm -f $@ - $(TESTRUNNER) $(MONORUN) ./$^ - touch $@ - -clean:: - rm -f *~ *.E *.d *.exe *.dll *.mdb *.pdb diff --git a/python/Makefile b/python/Makefile index 5593e98..d12f1dd 100644 --- a/python/Makefile +++ b/python/Makefile @@ -3,7 +3,9 @@ all: @echo "Try: make test" @false -test: - ../wvtestrunner.pl python wvtestmain.py \ +runtests: + python wvtestmain.py \ $(patsubst ./%t,%t/*.py,$(shell find -type d -name t)) +test: + ../wvtestrunner.pl $(MAKE) runtests