Fix System.Numerics xunit tests and add them to CI (#5006)
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Sun, 11 Jun 2017 23:44:50 +0000 (01:44 +0200)
committerGitHub <noreply@github.com>
Sun, 11 Jun 2017 23:44:50 +0000 (01:44 +0200)
* Fix System.Numerics xunit tests and add them to CI

Xunit.Extensions.NetCore.dll is available as a net46 version now
so we can just use it instead of building it from our buildtools fork.
This also allows us to remove the fork from our submodules.

We were missing running the System.Numerics xunit tests in CI,
this adds them so we catch breaks like these earlier.

* Skip tests on Windows, they seem to fail there

.gitmodules
external/buildtools [deleted submodule]
external/corefx
external/xunit-binaries
mcs/build/tests.make
mcs/class/System.Numerics/System.Numerics_xtest.dll.sources
mcs/class/Xunit.NetCore.Extensions/Makefile [deleted file]
mcs/class/Xunit.NetCore.Extensions/Microsoft.Xunit.Performance/BenchmarkAttribute.cs [deleted file]
mcs/class/Xunit.NetCore.Extensions/Microsoft.Xunit.Performance/BenchmarkDiscover.cs [deleted file]
mcs/class/Xunit.NetCore.Extensions/Xunit.NetCore.Extensions.dll.sources [deleted file]
scripts/ci/run-test-default.sh

index 73d55a0a9b903a2f261f9a60b0dfee03b66f0a3c..4e968d7a066307ccc1089bbbfdf715a8fc923e2c 100644 (file)
@@ -26,9 +26,6 @@
 [submodule "external/nuget-buildtasks"]
        path = external/nuget-buildtasks
        url = git://github.com/mono/NuGet.BuildTasks
-[submodule "external/buildtools"]
-       path = external/buildtools
-       url = git://github.com/mono/buildtools.git
 [submodule "external/cecil-legacy"]
        path = external/cecil-legacy
        url = git://github.com/mono/cecil.git
diff --git a/external/buildtools b/external/buildtools
deleted file mode 160000 (submodule)
index b5cc6e6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit b5cc6e6ab5f71f6c0be7b730058b426e92528479
index eed0d37c001fdd17acf3dd33cacd4f66df5294c0..9ad53d674e31327abcc60f35c14387700f50cc68 160000 (submodule)
@@ -1 +1 @@
-Subproject commit eed0d37c001fdd17acf3dd33cacd4f66df5294c0
+Subproject commit 9ad53d674e31327abcc60f35c14387700f50cc68
index b8e20d265b368dd6252703d5afd038d0b028e388..d4433b0972f40cb3efaa3fbba52869bde5df8fa8 160000 (submodule)
@@ -1 +1 @@
-Subproject commit b8e20d265b368dd6252703d5afd038d0b028e388
+Subproject commit d4433b0972f40cb3efaa3fbba52869bde5df8fa8
index 0d01b5429ce4239f7bdfa0f5d4573c674fa73acc..8874b32326aa3f87550a5ff3a863a1e5d5fd6b04 100644 (file)
@@ -20,9 +20,10 @@ TEST_RUNTIME_WRAPPERS_PATH = $(shell dirname $(RUNTIME))/_tmpinst/bin
 ifndef NO_TEST
 
 test_nunit_lib = nunitlite.dll
-xunit_core := xunit.core xunit.abstractions xunit.assert
+xunit_core := xunit.core xunit.abstractions xunit.assert Xunit.NetCore.Extensions
 xunit_deps := System.Runtime
-xunit_class_deps := Xunit.NetCore.Extensions
+xunit_src  := $(patsubst %,$(topdir)/../external/xunit-binaries/%,BenchmarkAttribute.cs BenchmarkDiscover.cs)
+xunit_class_deps := 
 
 xunit_libs_ref = $(patsubst %,-r:$(topdir)/../external/xunit-binaries/%.dll,$(xunit_core))
 xunit_libs_ref += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/Facades/%.dll,$(xunit_deps))
@@ -89,9 +90,6 @@ endif
 
 tests_CLEAN_FILES += $(topdir)/build/deps/nunit-$(PROFILE).stamp
 
-$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)Xunit.NetCore.Extensions.dll:
-       $(MAKE) -C $(topdir)/class/Xunit.NetCore.Extensions
-
 endif
 
 test_assemblies :=
@@ -222,8 +220,8 @@ run-xunit-test-lib: xunit-test-local
        $$ok
        @rm -f xunit.execution.desktop.dll
 
-$(xunit_test_lib): $(the_assembly) $(xtest_response) $(xunit_libs_dep)
-       $(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response)
+$(xunit_test_lib): $(the_assembly) $(xtest_response) $(xunit_libs_dep) $(xunit_src)
+       $(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response) $(xunit_src)
 
 xtest_response_preprocessed = $(xtest_response)_preprocessed
 
index a012a0c1a8eff95274c3f6bbce9d4003fd3b2804..2ef111be9161a9cece92a570ca6f2de20145f72f 100644 (file)
@@ -1,3 +1,4 @@
+../../../external/corefx/src/Common/tests/System/AssertExtensions.cs
 ../../../external/corefx/src/Common/tests/System/PlatformDetection.cs
 
 # ../../../external/corefx/src/System.Runtime.Numerics/tests/*.cs
diff --git a/mcs/class/Xunit.NetCore.Extensions/Makefile b/mcs/class/Xunit.NetCore.Extensions/Makefile
deleted file mode 100644 (file)
index 7ea0857..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-thisdir = class/Xunit.NetCore.Extensions
-SUBDIRS = 
-include ../../build/rules.make
-
-XUNIT_LIBS := xunit.core xunit.abstractions xunit.execution.desktop xunit.assert
-
-LIBRARY = Xunit.NetCore.Extensions.dll
-LIB_REFS = System System.Core Facades/System.Runtime.InteropServices.RuntimeInformation Facades/System.Runtime Facades/System.Threading.Tasks
-LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/../external/xunit-binaries/%.dll,$(XUNIT_LIBS))
-
-EXTRA_DISTFILES =
-
-NO_TEST = yes
-NO_INSTALL = yes
-NO_SIGN_ASSEMBLY = yes
-
-include ../../build/library.make
diff --git a/mcs/class/Xunit.NetCore.Extensions/Microsoft.Xunit.Performance/BenchmarkAttribute.cs b/mcs/class/Xunit.NetCore.Extensions/Microsoft.Xunit.Performance/BenchmarkAttribute.cs
deleted file mode 100644 (file)
index 5697d10..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-using Xunit;
-using Xunit.Sdk;
-
-namespace Microsoft.Xunit.Performance
-{
-       [TraitDiscoverer("Microsoft.Xunit.Performance.BenchmarkDiscoverer", "Xunit.NetCore.Extensions")]
-       [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
-       public class BenchmarkAttribute : Attribute, ITraitAttribute
-       {
-               public long InnerIterationCount { get; set; }
-       }
-}
diff --git a/mcs/class/Xunit.NetCore.Extensions/Microsoft.Xunit.Performance/BenchmarkDiscover.cs b/mcs/class/Xunit.NetCore.Extensions/Microsoft.Xunit.Performance/BenchmarkDiscover.cs
deleted file mode 100644 (file)
index 40d2d8a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-using System.Collections.Generic;
-using Xunit.Sdk;
-using Xunit.Abstractions;
-
-namespace Xunit.NetCore.Extensions
-{
-    public class BenchmarkDiscoverer : ITraitDiscoverer
-    {
-        public IEnumerable<KeyValuePair<string, string>> GetTraits(IAttributeInfo traitAttribute)
-        {
-            yield return new KeyValuePair<string, string>("Benchmark", "True");
-        }
-    }
-}
diff --git a/mcs/class/Xunit.NetCore.Extensions/Xunit.NetCore.Extensions.dll.sources b/mcs/class/Xunit.NetCore.Extensions/Xunit.NetCore.Extensions.dll.sources
deleted file mode 100644 (file)
index 145dae4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-../../../external/buildtools/src/xunit.netcore.extensions/*.cs
-../../../external/buildtools/src/xunit.netcore.extensions/Attributes/*.cs
-../../../external/buildtools/src/xunit.netcore.extensions/Discoverers/*.cs
-
-Microsoft.Xunit.Performance/BenchmarkAttribute.cs
-Microsoft.Xunit.Performance/BenchmarkDiscover.cs
index 7ae3de5d0b6f7f69c317e29970ab1976d2501a9b..9e41e894d5511b7bb505f473981ffd9813a8eaf6 100755 (executable)
@@ -73,6 +73,7 @@ ${TESTCMD} --label=System.Web.DynamicData --timeout=5m make -w -C mcs/class/Syst
 ${TESTCMD} --label=Mono.CSharp --timeout=5m make -w -C mcs/class/Mono.CSharp run-test
 ${TESTCMD} --label=WindowsBase --timeout=5m make -w -C mcs/class/WindowsBase run-test
 ${TESTCMD} --label=System.Numerics --timeout=5m make -w -C mcs/class/System.Numerics run-test
+if [[ ${label} == w* ]]; then ${TESTCMD} --label=System.Numerics-xunit --skip; else ${TESTCMD} --label=System.Numerics-xunit --timeout=5m make -w -C mcs/class/System.Numerics run-xunit-test; fi
 ${TESTCMD} --label=System.Runtime.DurableInstancing --timeout=5m make -w -C mcs/class/System.Runtime.DurableInstancing run-test
 ${TESTCMD} --label=System.ServiceModel.Discovery --timeout=5m make -w -C mcs/class/System.ServiceModel.Discovery run-test
 ${TESTCMD} --label=System.Xaml --timeout=5m make -w -C mcs/class/System.Xaml run-test