From a0f51a380344065651abb0d07763350303680247 Mon Sep 17 00:00:00 2001 From: Marcos Henrich Date: Fri, 5 Aug 2016 14:44:51 +0100 Subject: [PATCH] [bcl] Replace nunit24 with nunit-lite Get rid of TEST_HARNESS_VERBOSE and enable verbose logging by default nunit-lite doesn't have the "dot when test runs" progress indicator anymore, so we need to enable "verbose" output by default otherwise we don't get any progress until the test run is over. Also remove the TestResult_$(PROFILE).log and nunit-summary.xsl files, they're not needed anymore. --- mcs/build/Makefile | 1 - mcs/build/config-default.make | 2 +- mcs/build/profiles/mobile_static.make | 1 - mcs/build/rules.make | 16 ----- mcs/build/tests.make | 58 ++----------------- mcs/class/Mono.Reactive.Testing/Makefile | 2 +- .../Test/tools/sockethell/Makefile | 2 +- mcs/class/System.Data.Linq/build/Makefile | 3 +- mcs/tools/linker/Tests/Makefile | 2 +- 9 files changed, 9 insertions(+), 78 deletions(-) diff --git a/mcs/build/Makefile b/mcs/build/Makefile index f33fcccf2d7..14ad0cbd10c 100644 --- a/mcs/build/Makefile +++ b/mcs/build/Makefile @@ -41,7 +41,6 @@ DISTFILES = \ executable.make \ gensources.sh \ library.make \ - nunit-summary.xsl \ rules.make \ tests.make \ $(COMMON_SRCS:%=common/%) \ diff --git a/mcs/build/config-default.make b/mcs/build/config-default.make index 145665799cc..9e4fcf64a30 100644 --- a/mcs/build/config-default.make +++ b/mcs/build/config-default.make @@ -10,7 +10,7 @@ CODEPAGE = 65001 RUNTIME_FLAGS = -TEST_HARNESS = $(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)nunit-console.exe +TEST_HARNESS = $(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)nunit-lite-console.exe MCS_FLAGS = MBAS_FLAGS = $(PLATFORM_DEBUG_FLAGS) LIBRARY_FLAGS = /noconfig diff --git a/mcs/build/profiles/mobile_static.make b/mcs/build/profiles/mobile_static.make index d9ff3b67dc9..bf52c7e791e 100644 --- a/mcs/build/profiles/mobile_static.make +++ b/mcs/build/profiles/mobile_static.make @@ -32,7 +32,6 @@ PROFILE_MCS_FLAGS = \ $(PLATFORM_DEBUG_FLAGS) FRAMEWORK_VERSION = 2.1 -NUNIT_LITE = yes # the tuner takes care of the install NO_INSTALL = yes diff --git a/mcs/build/rules.make b/mcs/build/rules.make index ac3a476dfb1..d25eb35f6e8 100644 --- a/mcs/build/rules.make +++ b/mcs/build/rules.make @@ -116,22 +116,6 @@ endif include $(topdir)/build/profiles/$(PROFILE).make -# If the profile is using nunit-lite, use it -ifdef NUNIT_LITE -TEST_HARNESS=$(topdir)/class/lib/$(PROFILE)/nunit-lite-console.exe -endif - -# Make sure propagates -export TEST_HARNESS - -# If the profile is using nunit-lite, use it -ifdef NUNIT_LITE -TEST_HARNESS=$(topdir)/class/lib/$(PROFILE)/nunit-lite-console.exe -endif - -# Make sure propagates -export TEST_HARNESS - ifdef BCL_OPTIMIZE PROFILE_MCS_FLAGS += -optimize endif diff --git a/mcs/build/tests.make b/mcs/build/tests.make index 749b5a0faf4..054f37a02af 100644 --- a/mcs/build/tests.make +++ b/mcs/build/tests.make @@ -19,11 +19,7 @@ TEST_RUNTIME_WRAPPERS_PATH = $(shell dirname $(RUNTIME))/_tmpinst/bin ## Unit test support ifndef NO_TEST -ifdef NUNIT_LITE test_nunit_lib = nunitlite.dll -else -test_nunit_lib = nunit.framework.dll nunit.core.dll nunit.util.dll nunit.mocks.dll -endif TEST_LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(TEST_LIB_REFS)) @@ -58,19 +54,11 @@ ifndef NO_TEST $(test_nunit_dep): $(topdir)/build/deps/nunit-$(PROFILE).stamp @if test -f $@; then :; else rm -f $<; $(MAKE) $<; fi -ifdef NUNIT_LITE $(topdir)/build/deps/nunit-$(PROFILE).stamp: ifndef PARENT_PROFILE cd ${topdir}/tools/nunit-lite && $(MAKE) endif echo "stamp" >$@ -else -$(topdir)/build/deps/nunit-$(PROFILE).stamp: -ifndef PARENT_PROFILE - cd ${topdir}/nunit24 && $(MAKE) -endif - echo "stamp" >$@ -endif tests_CLEAN_FILES += $(topdir)/build/deps/nunit-$(PROFILE).stamp endif @@ -90,52 +78,14 @@ run-test-ondotnet-local: run-test-ondotnet-lib TEST_HARNESS_EXCLUDES = -exclude=$(PLATFORM_TEST_HARNESS_EXCLUDES)$(PROFILE_TEST_HARNESS_EXCLUDES)NotWorking,ValueAdd,CAS,InetAccess TEST_HARNESS_EXCLUDES_ONDOTNET = /exclude:$(PLATFORM_TEST_HARNESS_EXCLUDES)$(PROFILE_TEST_HARNESS_EXCLUDES)NotDotNet,CAS -ifdef NUNIT_LITE NOSHADOW_FLAG = -NUNIT_XML_FLAG = -format:nunit2 -result: -OUTPUT_FILE_FLAG=-out -else -OUTPUT_FILE_FLAG=-output -NOSHADOW_FLAG = -noshadow -NUNIT_XML_FLAG = -xml= -endif - -ifdef NUNIT_LITE -NOSHADOW_FLAG = -NUNIT_XML_FLAG = -format:nunit2 -result: -OUTPUT_FILE_FLAG=-out -else -OUTPUT_FILE_FLAG=-output -NOSHADOW_FLAG = -noshadow -NUNIT_XML_FLAG = -xml= -endif - -ifdef TEST_HARNESS_VERBOSE -TEST_HARNESS_OUTPUT = -labels -TEST_HARNESS_OUTPUT_ONDOTNET = -labels -TEST_HARNESS_POSTPROC = : -TEST_HARNESS_POSTPROC_ONDOTNET = : -else -TEST_HARNESS_OUTPUT = $(OUTPUT_FILE_FLAG)=TestResult-$(PROFILE).log -TEST_HARNESS_OUTPUT_ONDOTNET = $(OUTPUT_FILE_FLAG)=TestResult-ondotnet-$(PROFILE).log -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 -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 -endif ifdef FIXTURE -ifdef NUNIT_LITE FIXTURE_ARG = -test=MonoTests.$(FIXTURE) -else -FIXTURE_ARG = -fixture=MonoTests.$(FIXTURE) -endif endif ifdef TESTNAME -ifdef NUNIT_LITE TESTNAME_ARG = -test=MonoTests.$(TESTNAME) -else -TESTNAME_ARG = -run=MonoTests.$(TESTNAME) -endif endif ifdef ALWAYS_AOT @@ -150,16 +100,16 @@ endif # ALWAYS_AOT ## FIXME: i18n problem in the 'sed' command below run-test-lib: test-local test-local-aot-compile ok=:; \ - PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(AOT_RUN_FLAGS) $(TEST_HARNESS) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(TEST_HARNESS_OUTPUT) $(NUNIT_XML_FLAG)TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \ + PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(AOT_RUN_FLAGS) $(TEST_HARNESS) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) -labels -format:nunit2 -result:TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \ if [ ! -f "TestResult-$(PROFILE).xml" ]; then echo "The test runner didn't produce a test result XML, probably due to a crash of the runtime. Check the log for more details." > TestResult-$(PROFILE).xml; fi; \ - $(TEST_HARNESS_POSTPROC) ; $$ok + $$ok ## Instructs compiler to compile to target .net execution, it can be usefull in rare cases when runtime detection is not possible run-test-ondotnet-lib: LOCAL_TEST_COMPILER_ONDOTNET_FLAGS:=-d:RUN_ONDOTNET run-test-ondotnet-lib: test-local ok=:; \ - $(TEST_HARNESS) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_ONDOTNET_FLAGS) $(TEST_HARNESS_EXCLUDES_ONDOTNET) $(TEST_HARNESS_OUTPUT_ONDOTNET) $(NUNIT_XML_FLAG)=TestResult-ondotnet-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG) || ok=false; \ - $(TEST_HARNESS_POSTPROC_ONDOTNET) ; $$ok + $(TEST_HARNESS) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_ONDOTNET_FLAGS) $(TEST_HARNESS_EXCLUDES_ONDOTNET) -labels -format:nunit2 -result:TestResult-ondotnet-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG) || ok=false; \ + $$ok endif # test_assemblies diff --git a/mcs/class/Mono.Reactive.Testing/Makefile b/mcs/class/Mono.Reactive.Testing/Makefile index ae7afa670cb..aa931ee9db7 100644 --- a/mcs/class/Mono.Reactive.Testing/Makefile +++ b/mcs/class/Mono.Reactive.Testing/Makefile @@ -3,7 +3,7 @@ SUBDIRS = include ../../build/rules.make LIBRARY = Mono.Reactive.Testing.dll -LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq System.Reactive.PlatformServices System.Reactive.Providers System.Reactive.Runtime.Remoting System.Reactive.Experimental System.Reactive.Windows.Forms System.Reactive.Windows.Threading System.Reactive.Observable.Aliases System.Windows.Forms WindowsBase nunit.framework +LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq System.Reactive.PlatformServices System.Reactive.Providers System.Reactive.Runtime.Remoting System.Reactive.Experimental System.Reactive.Windows.Forms System.Reactive.Windows.Threading System.Reactive.Observable.Aliases System.Windows.Forms WindowsBase nunitlite LIB_MCS_FLAGS = \ @more_build_args \ -d:NUNIT -d:MONO -d:DESKTOPCLR diff --git a/mcs/class/Mono.Security/Test/tools/sockethell/Makefile b/mcs/class/Mono.Security/Test/tools/sockethell/Makefile index 0ad21f2c436..6557bccc3e5 100644 --- a/mcs/class/Mono.Security/Test/tools/sockethell/Makefile +++ b/mcs/class/Mono.Security/Test/tools/sockethell/Makefile @@ -2,7 +2,7 @@ thisdir = class/Mono.Security/Test/tools/sockethell SUBDIRS = include ../../../../../build/rules.make -LOCAL_MCS_FLAGS = -r:System.dll -r:Mono.Security.dll -r:../../../../lib/net_4_x/nunit.framework.dll +LOCAL_MCS_FLAGS = -r:System.dll -r:Mono.Security.dll -r:../../../../lib/net_4_x/nunitlite.dll all-local install-local uninstall-local: diff --git a/mcs/class/System.Data.Linq/build/Makefile b/mcs/class/System.Data.Linq/build/Makefile index bf28637588c..27b0c9e70c8 100644 --- a/mcs/class/System.Data.Linq/build/Makefile +++ b/mcs/class/System.Data.Linq/build/Makefile @@ -32,8 +32,7 @@ $(sqlite_tests): $(sqlite_tests_dep) test-sqlite: $(sqlite_tests) RUN_TEST_COMMAND = \ - MONO_REGISTRY_PATH="$(HOME)/.mono/registry" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(TEST_HARNESS) $(1) -noshadow $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(TEST_HARNESS_OUTPUT) -xml=TestResult-$(1:.dll=)-$(PROFILE).xml -out:TestResult-$(1:.dll=)-$(PROFILE).out $(FIXTURE_ARG) $(TESTNAME_ARG) ; \ - xsltproc $(topdir)/build/nunit-summary.xsl TestResult-$(1)-$(PROFILE).xml > TestResult-$(1:.dll=)-$(PROFILE).log + MONO_REGISTRY_PATH="$(HOME)/.mono/registry" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(TEST_HARNESS) $(1) -noshadow $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(TEST_HARNESS_OUTPUT) -xml=TestResult-$(1:.dll=)-$(PROFILE).xml -out:TestResult-$(1:.dll=)-$(PROFILE).out $(FIXTURE_ARG) $(TESTNAME_ARG) ; run-test-sqlite: $(call RUN_TEST_COMMAND,$(sqlite_tests)) diff --git a/mcs/tools/linker/Tests/Makefile b/mcs/tools/linker/Tests/Makefile index 8b87256f6a7..769a38ad5b2 100644 --- a/mcs/tools/linker/Tests/Makefile +++ b/mcs/tools/linker/Tests/Makefile @@ -12,7 +12,7 @@ Mono.Linker.Tests.dll.sources: find Mono.Linker.Tests -name "*.cs" > Mono.Linker.Tests.dll.sources Mono.Linker.Tests.dll: Mono.Cecil.dll monolinker.exe Mono.Linker.Tests.dll.sources - $(MCS) /target:library /out:Mono.Linker.Tests.dll /r:nunit.framework.dll /r:Mono.Cecil.dll /r:monolinker.exe @Mono.Linker.Tests.dll.sources + $(MCS) /target:library /out:Mono.Linker.Tests.dll /r:nunitlite.dll /r:Mono.Cecil.dll /r:monolinker.exe @Mono.Linker.Tests.dll.sources clean: rm -rf Mono.Cecil.dll monolinker.exe Mono.Linker.Tests.dll.sources Mono.Linker.Tests.dll -- 2.25.1