From dfe62c2e18d714d448548b1ba328473f47b3f33c Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Wed, 23 Mar 2016 03:52:34 +0100 Subject: [PATCH 1/5] add project.json --- .gitignore | 3 ++- Fuchu/NuGet.Config | 10 ++++++++++ Fuchu/project.json | 30 ++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 Fuchu/NuGet.Config create mode 100644 Fuchu/project.json diff --git a/.gitignore b/.gitignore index c6c17f1..6a5be81 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ packages/* **/packages/* *.nupkg .nuget/*.exe -*.sln.ide \ No newline at end of file +*.sln.ide +project.lock.json diff --git a/Fuchu/NuGet.Config b/Fuchu/NuGet.Config new file mode 100644 index 0000000..3f788a5 --- /dev/null +++ b/Fuchu/NuGet.Config @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Fuchu/project.json b/Fuchu/project.json new file mode 100644 index 0000000..c1c7deb --- /dev/null +++ b/Fuchu/project.json @@ -0,0 +1,30 @@ +{ + "version": "1.0.0-*", + "compilationOptions": { + }, + + "compilerName": "fsc", + "compileFiles": [ + "AssemblyInfo.fs", + "Fuchu.fs", + "Assertions.fs", + "xUnitHelpers.fs", + "Fuchu.NUnit.fs", + "Fuchu.MbUnit.fs" + ], + + "frameworks": { + "net46": { + "dependencies": { + "FSharp.Core": "4.0.0.1" + } + }, + + "dnxcore50": { + "dependencies": { + "Microsoft.FSharp.Core.netcore": "1.0.0-alpha-151221", + "NETStandard.Library": "1.0.0-rc2-23811" + } + } + } +} From 8e604905f65fc9823afa782dbf7c8054c020b293 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Wed, 23 Mar 2016 03:53:52 +0100 Subject: [PATCH 2/5] fix missing trace --- Fuchu/project.json | 1 + 1 file changed, 1 insertion(+) diff --git a/Fuchu/project.json b/Fuchu/project.json index c1c7deb..0282ad4 100644 --- a/Fuchu/project.json +++ b/Fuchu/project.json @@ -23,6 +23,7 @@ "dnxcore50": { "dependencies": { "Microsoft.FSharp.Core.netcore": "1.0.0-alpha-151221", + "System.Diagnostics.TraceSource": "4.0.0-rc2-23811", "NETStandard.Library": "1.0.0-rc2-23811" } } From 37b87769c6afe318b708bb912efc123639a45cdd Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Wed, 23 Mar 2016 04:09:34 +0100 Subject: [PATCH 3/5] fix missing AsParallel --- Fuchu/project.json | 1 + 1 file changed, 1 insertion(+) diff --git a/Fuchu/project.json b/Fuchu/project.json index 0282ad4..bab7f49 100644 --- a/Fuchu/project.json +++ b/Fuchu/project.json @@ -24,6 +24,7 @@ "dependencies": { "Microsoft.FSharp.Core.netcore": "1.0.0-alpha-151221", "System.Diagnostics.TraceSource": "4.0.0-rc2-23811", + "System.Linq.Parallel": "4.0.1-rc2-23811", "NETStandard.Library": "1.0.0-rc2-23811" } } From f5fe09120267e58322e566ccf5abdbb3ae3d92e1 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Wed, 23 Mar 2016 04:09:54 +0100 Subject: [PATCH 4/5] fix netcore differences --- Fuchu/Fuchu.MbUnit.fs | 3 +++ Fuchu/xUnitHelpers.fs | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/Fuchu/Fuchu.MbUnit.fs b/Fuchu/Fuchu.MbUnit.fs index d979a85..316692d 100644 --- a/Fuchu/Fuchu.MbUnit.fs +++ b/Fuchu/Fuchu.MbUnit.fs @@ -59,6 +59,9 @@ module MbUnit = let testCategory (m: MemberInfo) = m.GetCustomAttributes(categoryAttributeType.Value, true) +#if DNXCORE50 + |> Array.ofSeq +#endif |> Array.map (fun a -> categoryAttributeNameProperty.Value.GetValue(a, null) :?> string) |> Enumerable.FirstOrDefault diff --git a/Fuchu/xUnitHelpers.fs b/Fuchu/xUnitHelpers.fs index ff79fab..d4cf455 100644 --- a/Fuchu/xUnitHelpers.fs +++ b/Fuchu/xUnitHelpers.fs @@ -17,7 +17,11 @@ module XunitHelpers = let nonIgnoredMethods ignoreAttr (t: Type) = [t] +#if DNXCORE50 + |> Seq.filter (fun t -> not (t.GetTypeInfo().HasAttribute ignoreAttr)) +#else |> Seq.filter (fun t -> not (t.HasAttribute ignoreAttr)) +#endif |> Seq.collect (fun _ -> t.GetMethods()) let propertyValue propertyName o = @@ -59,7 +63,11 @@ module XunitHelpers = Invoke = fun (o: obj) -> invoke o m }) let TestToFuchu (attr: TestAttributes) (testCategory: Type -> string) (testType: Type) (testMethods: TestMethod seq) = +#if DNXCORE50 + if testType.GetTypeInfo().IsAbstract +#else if testType.IsAbstract +#endif then TestList [] else let methods = nonIgnoredMethods attr.Ignore testType From caa51357c23ef68aec93f8868a826483b7915660 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Wed, 23 Mar 2016 04:32:55 +0100 Subject: [PATCH 5/5] MemberInfo is a base class of TypeInfo not Type --- Fuchu/Fuchu.MbUnit.fs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Fuchu/Fuchu.MbUnit.fs b/Fuchu/Fuchu.MbUnit.fs index 316692d..c98e1fa 100644 --- a/Fuchu/Fuchu.MbUnit.fs +++ b/Fuchu/Fuchu.MbUnit.fs @@ -90,7 +90,11 @@ module MbUnit = let testMethods = Seq.append (getTestMethods testCategory mbUnitAttrs t) rowTests +#if DNXCORE50 + let test = TestToFuchu mbUnitAttrs (fun t -> t.GetTypeInfo() |> testCategory) t testMethods +#else let test = TestToFuchu mbUnitAttrs testCategory t testMethods +#endif let staticTests = nonIgnoredMethods [MbUnitAttr "StaticTestFactory"] @@ -101,5 +105,9 @@ module MbUnit = TestList (seq { yield test if staticTests.Length > 0 then +#if DNXCORE50 + yield testList (t.FullName + testCategory (t.GetTypeInfo())) staticTests +#else yield testList (t.FullName + testCategory t) staticTests +#endif })