]> rtime.felk.cvut.cz Git - wvtest.git/commitdiff
Added a Makefile to dotnet as an example of how to run tests.
authorAvery Pennarun <apenwarr@gmail.com>
Fri, 1 May 2009 01:28:26 +0000 (21:28 -0400)
committerAvery Pennarun <apenwarr@gmail.com>
Fri, 1 May 2009 01:28:45 +0000 (21:28 -0400)
...and call it from the top level 'make test' too.

Makefile
dotnet/.gitignore [new file with mode: 0644]
dotnet/Makefile [new file with mode: 0644]
dotnet/t/wvtest.t.cs [moved from dotnet/wvtest.t.cs with 100% similarity]
dotnet/wvtestmain.cs [new file with mode: 0644]
dotnet/wvtestrules.mk [moved from dotnet/monorules.mk with 52% similarity]
python/Makefile

index 42f5a4b6ce7d845b6a04c256967c3114af94525d..3755d3c1cb4c03508f4379493928fb981bc2dd14 100644 (file)
--- 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 (file)
index 0000000..cd79073
--- /dev/null
@@ -0,0 +1 @@
+*.cs.E
diff --git a/dotnet/Makefile b/dotnet/Makefile
new file mode 100644 (file)
index 0000000..77a8663
--- /dev/null
@@ -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
+
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 (file)
index 0000000..272a128
--- /dev/null
@@ -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();
+    }
+}
similarity index 52%
rename from dotnet/monorules.mk
rename to dotnet/wvtestrules.mk
index e066ec985cea65bfa910f2ed418b4b59fafaae33..c78bd558986555a5ae01afc3a6a5873ae2cb56b9 100644 (file)
@@ -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
index 5593e98380e96653ea4d8f472f380bce710e8eab..d12f1dd45940b8fe93752a8bdf9f30af401d412e 100644 (file)
@@ -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