From f5fce7908ffe0ee01e84092bd6889cac850a1b5e Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Sat, 1 Mar 2014 17:16:57 +0100 Subject: [PATCH] Build: FAKE targets to build and test native providers (Intel MKL) --- README.md | 7 +++++++ build.fsx | 41 ++++++++++++++++++++++++++++++++++++++--- docs/content/index.fsx | 7 +++++++ 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e5967cf6..04e6a81e 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,13 @@ If you do not want to use the official binaries, or if you like to modify, debug build.cmd Docs # generate documentation, normal build build.cmd NuGet # generate NuGet packages, full build + build.cmd BuildNativex86 # build native providers 32bit/x86 + build.cmd BuildNativex64 # build native providers 64bit/x64 + build.cmd BuildNative # build native providers for all platforms + build.cmd TestNativex86 # test native providers 32bit/x86 + build.cmd TestNativex64 # test native providers 64bit/x64 + build.cmd TestNative # test native providers for all platforms + FAKE itself is not included in the repository but it will download and bootstrap itself automatically when build.cmd is run the first time. Note that this step is *not* required when using Visual Studio or `msbuild` directly. Quick Links diff --git a/build.fsx b/build.fsx index e4519e86..f272bc14 100644 --- a/build.fsx +++ b/build.fsx @@ -43,20 +43,55 @@ Target "Build" DoNothing ==> "Build" +// NATIVE BUILD + +let buildx86 subject = MSBuild "" (if hasBuildParam "incremental" then "Build" else "Rebuild") [("Configuration","Release"); ("Platform","Win32")] subject |> ignore +let buildx64 subject = MSBuild "" (if hasBuildParam "incremental" then "Build" else "Rebuild") [("Configuration","Release"); ("Platform","x64")] subject |> ignore + +Target "BuildNativex86" (fun _ -> buildx86 !! "MathNet.Numerics.NativeProviders.sln") +Target "BuildNativex64" (fun _ -> buildx64 !! "MathNet.Numerics.NativeProviders.sln") +Target "BuildNative" DoNothing + +"Prepare" ==> "BuildNativex86" ==> "BuildNative" +"Prepare" ==> "BuildNativex64" ==> "BuildNative" + + // TEST Target "Test" (fun _ -> - !! "out/test/*/*UnitTests*.dll" + !! "out/test/**/*UnitTests*.dll" |> NUnit (fun p -> { p with DisableShadowCopy = true TimeOut = TimeSpan.FromMinutes 30. - OutputFile = "TestResults.xml" }) -) + OutputFile = "TestResults.xml" })) "Build" ==> "Test" +// NATIVE TEST + +Target "TestNativex86" (fun _ -> + !! "out/MKL/Windows/x86/*UnitTests*.dll" + |> NUnit (fun p -> + { p with + ToolName = "nunit-console-x86.exe" + DisableShadowCopy = true + TimeOut = TimeSpan.FromMinutes 30. + OutputFile = "TestResults.xml" })) +Target "TestNativex64" (fun _ -> + !! "out/MKL/Windows/x64/*UnitTests*.dll" + |> NUnit (fun p -> + { p with + DisableShadowCopy = true + TimeOut = TimeSpan.FromMinutes 30. + OutputFile = "TestResults.xml" })) +Target "TestNative" DoNothing + +"BuildNativex86" ==> "TestNativex86" ==> "TestNative" +"BuildNativex64" ==> "TestNativex64" ==> "TestNative" + + // DOCUMENTATION Target "CleanDocs" (fun _ -> CleanDirs ["out" @@ "docs"]) diff --git a/docs/content/index.fsx b/docs/content/index.fsx index fcda7660..30c80d20 100644 --- a/docs/content/index.fsx +++ b/docs/content/index.fsx @@ -68,5 +68,12 @@ If you do not want to use the official binaries, or if you like to modify, debug build.cmd Docs # generate documentation, normal build build.cmd NuGet # generate NuGet packages, full build + build.cmd BuildNativex86 # build native providers 32bit/x86 + build.cmd BuildNativex64 # build native providers 64bit/x64 + build.cmd BuildNative # build native providers for all platforms + build.cmd TestNativex86 # test native providers 32bit/x86 + build.cmd TestNativex64 # test native providers 64bit/x64 + build.cmd TestNative # test native providers for all platforms + FAKE itself is not included in the repository but it will download and bootstrap itself automatically when build.cmd is run the first time. Note that this step is *not* required when using Visual Studio or `msbuild` directly. *)