3 # Rules for building unit tests.
5 # Includers of this file must define the following values:
14 TEST_COMPILE
= $(CSCOMPILE
)
19 test_nunit_lib
= nunit.framework.dll nunit.core.dll nunit.util.dll nunit.mocks.dll
20 test_nunit_dep
= $(test_nunit_lib
:%=$(topdir
)/class
/lib
/$(PROFILE
)/%)
21 test_nunit_ref
= $(test_nunit_dep
:%=-r
:%)
22 tests_CLEAN_FILES
+= TestResult
*.xml
24 test_lib
= $(ASSEMBLY
:$(ASSEMBLY_EXT
)=_test_
$(PROFILE
).dll
)
25 test_sourcefile
= $(ASSEMBLY
:$(ASSEMBLY_EXT
)=_test.dll.sources
)
26 test_pdb
= $(test_lib
:.dll
=.pdb
)
27 test_response
= $(depsdir
)/$(test_lib
).response
28 test_makefrag
= $(depsdir
)/$(test_lib
).makefrag
29 test_flags
= -r
:$(the_assembly
) $(test_nunit_ref
) $(TEST_MCS_FLAGS
)
30 tests_CLEAN_FILES
+= $(ASSEMBLY
:$(ASSEMBLY_EXT
)=_test
*.dll
) $(ASSEMBLY
:$(ASSEMBLY_EXT
)=_test
*.pdb
) $(test_response
) $(test_makefrag
)
33 HAVE_CS_TESTS
:= $(wildcard $(test_sourcefile
))
39 $(test_nunit_dep
): $(topdir
)/build
/deps
/nunit-
$(PROFILE
).stamp
40 @if
test -f
$@
; then
:; else rm -f
$<; $(MAKE
) $<; fi
41 $(topdir
)/build
/deps
/nunit-
$(PROFILE
).stamp
:
42 cd
${topdir}/nunit24
&& $(MAKE
)
44 tests_CLEAN_FILES
+= $(topdir
)/build
/deps
/nunit-
$(PROFILE
).stamp
50 test_assemblies
+= $(test_lib
)
55 test-local
: $(test_assemblies
)
56 run-test-local
: run-test-lib
57 run-test-ondotnet-local
: run-test-ondotnet-lib
59 TEST_HARNESS_EXCLUDES
= -exclude
=$(PLATFORM_TEST_HARNESS_EXCLUDES
)NotWorking
,ValueAdd
,CAS
,InetAccess
60 TEST_HARNESS_EXCLUDES_ONDOTNET
= /exclude
:$(PLATFORM_TEST_HARNESS_EXCLUDES
)NotDotNet
,CAS
62 ifdef TEST_HARNESS_VERBOSE
63 TEST_HARNESS_OUTPUT
= -labels
64 TEST_HARNESS_OUTPUT_ONDOTNET
= -labels
65 TEST_HARNESS_POSTPROC
= :
66 TEST_HARNESS_POSTPROC_ONDOTNET
= :
68 TEST_HARNESS_OUTPUT
= -output
=TestResult-
$(PROFILE
).log
69 TEST_HARNESS_OUTPUT_ONDOTNET
= -output
=TestResult-ondotnet-
$(PROFILE
).log
70 TEST_HARNESS_POSTPROC
= (echo
''; cat TestResult-
$(PROFILE
).log
) | sed
'1,/^Tests run: /d'; xsltproc
$(topdir
)/build
/nunit-summary.xsl TestResult-
$(PROFILE
).xml
>> TestResult-
$(PROFILE
).log
71 TEST_HARNESS_POSTPROC_ONDOTNET
= (echo
''; cat TestResult-ondotnet-
$(PROFILE
).log
) | sed
'1,/^Tests run: /d'; xsltproc
$(topdir
)/build
/nunit-summary.xsl TestResult-ondotnet-
$(PROFILE
).xml
>> TestResult-ondotnet-
$(PROFILE
).log
75 FIXTURE_ARG
= -fixture
=MonoTests.
$(FIXTURE
)
79 TESTNAME_ARG
= -run
=MonoTests.
$(TESTNAME
)
82 ## FIXME: i18n problem in the 'sed' command below
83 run-test-lib
: test-local
85 MONO_REGISTRY_PATH
="$(HOME)/.mono/registry" $(TEST_RUNTIME
) $(RUNTIME_FLAGS
) $(TEST_HARNESS
) $(test_assemblies
) -noshadow
$(TEST_HARNESS_FLAGS
) $(LOCAL_TEST_HARNESS_FLAGS
) $(TEST_HARNESS_EXCLUDES
) $(TEST_HARNESS_OUTPUT
) -xml
=TestResult-
$(PROFILE
).xml
$(FIXTURE_ARG
) $(TESTNAME_ARG
)|| ok
=false
; \
86 $(TEST_HARNESS_POSTPROC
) ; $$ok
88 run-test-ondotnet-lib
: test-local
90 $(TEST_HARNESS
) $(test_assemblies
) -noshadow
$(TEST_HARNESS_FLAGS
) $(LOCAL_TEST_HARNESS_ONDOTNET_FLAGS
) $(TEST_HARNESS_EXCLUDES_ONDOTNET
) $(TEST_HARNESS_OUTPUT_ONDOTNET
) -xml
=TestResult-ondotnet-
$(PROFILE
).xml
$(FIXTURE_ARG
) $(TESTNAME_ARG
) || ok
=false
; \
91 $(TEST_HARNESS_POSTPROC_ONDOTNET
) ; $$ok
92 endif # test_assemblies
97 TEST_FILES
+= `sed -e '/^$$/d' -e 's,^../,,' -et -e 's,^,Test/,' $(test_sourcefile)`
102 $(test_lib
): $(the_assembly
) $(test_response
) $(test_nunit_dep
)
103 $(TEST_COMPILE
) -target
:library
-out
:$@
$(test_flags
) @
$(test_response
)
105 $(test_response
): $(test_sourcefile
)
106 @echo Creating
$@ ...
107 @sed
-e
'/^$$/d' -e
's,^,Test/,' $(test_sourcefile
) |
$(PLATFORM_CHANGE_SEPARATOR_CMD
) >$@
109 $(test_makefrag
): $(test_response
)
110 @echo Creating
$@ ...
111 @sed
's,^,$(test_lib): ,' $< >$@
113 -include $(test_makefrag
)