2005-06-09 Lluis Sanchez Gual <lluis@novell.com>
[mono.git] / mono / tests / Makefile.am
index 9efa267c59aa7cee7ebbd09e0dc86ff3a74d20af..7b3f5b4e54c009d3b5c4a405f3ab20ce46d13999 100644 (file)
@@ -10,11 +10,20 @@ RUNTIME_ARGS=--config tests-config --optimize=all
 
 RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/default $(top_builddir)/runtime/mono-wrapper
 
-CSC = $(RUNTIME) $(mcs_topdir)/class/lib/default/mcs.exe --unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
+CSC = $(RUNTIME) $(mcs_topdir)/class/lib/default/mcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
 ILASM = $(RUNTIME) $(mcs_topdir)/ilasm/ilasm.exe
 
 BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
 
+STRESS_TESTS_SRC=      \
+       abort-stress-1.cs       \
+       abort-stress-2.cs       \
+       domain-stress.cs        \
+       gchandle-stress.cs      \
+       monitor-stress.cs       \
+       thread-stress.cs        \
+       gc-stress.cs
+
 TEST_CS_SRC=                   \
        array-init.cs           \
        arraylist.cs            \
@@ -55,10 +64,8 @@ TEST_CS_SRC=                 \
        pinvoke1.cs             \
        pinvoke2.cs             \
        pinvoke3.cs             \
-       pinvoke10.cs            \
        pinvoke11.cs            \
        pinvoke13.cs            \
-       pinvoke15.cs            \
        pinvoke17.cs            \
        pinvoke18.cs            \
        invoke.cs               \
@@ -125,12 +132,10 @@ TEST_CS_SRC=                      \
        appdomain-unload.cs \
        loader.cs       \
        pointer.cs              \
-       rounding.cs             \
        hashcode.cs             \
        delegate1.cs            \
        delegate2.cs            \
        delegate3.cs            \
-       delegate4.cs            \
        delegate5.cs            \
        delegate6.cs            \
        delegate7.cs            \
@@ -195,6 +200,7 @@ TEST_CS_SRC=                        \
        main-returns-background-abort-resetabort.cs     \
        main-returns-background-resetabort.cs   \
        main-returns-background.cs      \
+       main-returns-background-change.cs       \
        main-returns.cs \
        subthread-exit.cs       \
        desweak.cs
@@ -235,8 +241,9 @@ TEST_IL_SRC=                        \
 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
 TESTBS=$(BENCHSRC:.cs=.exe)
+STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
 
-EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_IL_SRC) $(BENCHSRC)
+EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_IL_SRC) $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl
 
 %.exe: %.il
        $(ILASM) -out:$@ $<
@@ -247,7 +254,7 @@ EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_IL_SRC) $(BENCHSRC)
 test:  testjit
 
 TestDriver.dll:
-       $(CSC) -target:library -o $@ $(srcdir)/../mini/TestDriver.cs
+       $(CSC) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
 
 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
        @failed=0; \
@@ -324,6 +331,9 @@ testaot: $(TESTSI_CS) $(TESTBS) libtest.la
        if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
          for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
 
+testtrace:
+       $(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" testjit
+
 testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
        @failed=0; \
        passed=0; \
@@ -349,16 +359,36 @@ testjitspeed: $(JITTEST_PROG) $(TESTBS)
                time $(JITTEST_PROG) $$i;       \
        done
 
+stresstest: $(STRESS_TESTS)
+       @failed=0; \
+       passed=0; \
+       failed_tests="";\
+       for i in $(STRESS_TESTS); do    \
+               if $(srcdir)/stress-runner.pl $$i ../mini/mono $(RUNTIME_ARGS); \
+               then \
+                       passed=`expr $${passed} + 1`; \
+               else \
+                       if [ $$? = 2 ]; then break; fi; \
+                       failed=`expr $${failed} + 1`; \
+                       failed_tests="$${failed_tests} $$i"; \
+               fi \
+       done; \
+       echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
+       if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
+         for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
+
 noinst_LTLIBRARIES = libtest.la
 
 INCLUDES = $(GLIB_CFLAGS)
 
 if PLATFORM_WIN32
-libtest_la_LDFLAGS=-no-undefined -rpath `pwd`
+# the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
+# can't find them. So we use --kill-at to remove the @ suffix as well.
+libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
 else
 libtest_la_LDFLAGS = -rpath `pwd`
 endif
 libtest_la_SOURCES = libtest.c
 libtest_la_LIBADD = $(GLIB_LIBS)
 
-CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) *.dll *.stdout *.exe stest.dat
+CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.exe stest.dat