From 1a9b8816f19394a4746193d8894e1b3f81469946 Mon Sep 17 00:00:00 2001 From: realvictorprm Date: Thu, 8 Nov 2018 16:49:44 +0100 Subject: [PATCH 01/14] Added F#+ to the test suite Signed-off-by: realvictorprm --- tests/fsharp/test-framework.fs | 22 +++++++++++++++++++--- tests/fsharp/tests.fs | 27 +++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/tests/fsharp/test-framework.fs b/tests/fsharp/test-framework.fs index aeb90af5ae8..52b192768c2 100644 --- a/tests/fsharp/test-framework.fs +++ b/tests/fsharp/test-framework.fs @@ -114,6 +114,16 @@ module Commands = Directory.CreateDirectory path |> ignore path + let dotnet workDir exec (_: FilePath) flag srcFiles = + let args = (sprintf "%s %s" flag (srcFiles |> Seq.ofList |> String.concat " ")) + + ignore workDir + exec "C:\Program Files\dotnet\dotnet.exe" args + + let git exec gitExe args = + let args = (sprintf "%s" (args |> Seq.ofList |> String.concat " ")) + printfn "Executing git." + exec gitExe args type TestConfig = { EnvironmentVariables : Map @@ -132,7 +142,8 @@ type TestConfig = PEVERIFY : string Directory: string DotNetExe: string - DefaultPlatform: string} + DefaultPlatform: string + GitExe: string } module WindowsPlatform = @@ -189,7 +200,9 @@ let config configurationName envVars = let FSC = SCRIPT_ROOT ++ ".." ++ ".." ++ "tests" ++ "testbin" ++ configurationName ++ "coreclr" ++ "FSC" ++ "fsc.exe" let FSCOREDLLPATH = "" #endif - + let gitExe = + let gitPath = envVars.["GIT"] + Path.Combine(gitPath, "git.exe") let defaultPlatform = match Is64BitOperatingSystem with // | PlatformID.MacOSX, true -> "osx.10.10-x64" @@ -213,7 +226,8 @@ let config configurationName envVars = fsi_flags = fsi_flags Directory="" DotNetExe = dotNetExe - DefaultPlatform = defaultPlatform } + DefaultPlatform = defaultPlatform + GitExe = gitExe } let logConfig (cfg: TestConfig) = log "---------------------------------------------------------------" @@ -450,6 +464,8 @@ let rm cfg x = Commands.rm cfg.Directory x let rmdir cfg x = Commands.rmdir cfg.Directory x let mkdir cfg = Commands.mkdir_p cfg.Directory let copy_y cfg f = Commands.copy_y cfg.Directory f >> checkResult +let dotnet cfg flag args = Commands.dotnet cfg.Directory (exec cfg) cfg.DotNetExe flag args +let git cfg x = Commands.git (exec cfg) (cfg.GitExe) x let diff normalize path1 path2 = let result = System.Text.StringBuilder() diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index d29f92e5e79..6a0efc0db5d 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -28,6 +28,33 @@ let FSI_BASIC = FSI_FILE // ^^^^^^^^^^^^ To run these tests in F# Interactive , 'build net40', then send this chunk, then evaluate body of a test ^^^^^^^^^^^^ module CoreTests = + open TestFramework + + [] + let testFSharpPlusBuild () = + let cfg = testConfig "" + mkdir cfg "repos" + + if Commands.directoryExists cfg.Directory "repos/FSharpPlus" |> Option.isNone then + let cfg = testConfig "repos" + git cfg ["clone"; "http://github.com/fsprojects/FSharpPlus"; "FSharpPlus"] + + let cfg2 = testConfig "repos/FSharpPlus" + + // git cfg2 ["reset"; "--hard"; "fcb507bc8734362f4f6d40c08a4bc011e50e5d56"] + + // Reference the freshly built compiler + let fullPath = cfg2.FSCBinPath |> getFullPath + + let cfg3 = testConfig "repos/FSharpPlus/src/FSharpPlus" + + dotnet cfg3 "msbuild" + [ "FSharpPlus.fsproj" + "/p:CompilerTest=true" + sprintf "/p:FSC_ToolPathCompilerBuild=%s" fullPath + sprintf "/p:FSC_ExePathCompilerBuild=%s" (fullPath ++ "fsc.exe") + ] + // These tests are enabled for .NET Framework and .NET Core [] let ``access-FSC_BASIC``() = singleTestBuildAndRun "core/access" FSC_BASIC From e3b0c694389dc42e36aa97dcc53d1b8bca06b8db Mon Sep 17 00:00:00 2001 From: realvictorprm Date: Thu, 8 Nov 2018 18:44:38 +0100 Subject: [PATCH 02/14] More tests! Signed-off-by: realvictorprm --- tests/fsharp/test-framework.fs | 15 +++++++-- tests/fsharp/tests.fs | 57 ++++++++++++++++++++++++++++++---- 2 files changed, 64 insertions(+), 8 deletions(-) diff --git a/tests/fsharp/test-framework.fs b/tests/fsharp/test-framework.fs index 52b192768c2..1b48fd3cade 100644 --- a/tests/fsharp/test-framework.fs +++ b/tests/fsharp/test-framework.fs @@ -125,6 +125,11 @@ module Commands = printfn "Executing git." exec gitExe args + let nunit exec nunitExe workdir args = + let args = (sprintf "%s --work:\"%s\"" (args |> Seq.ofList |> String.concat " ") workdir) + printfn "Running external nunit tests." + exec nunitExe args + type TestConfig = { EnvironmentVariables : Map CSC : string @@ -143,7 +148,8 @@ type TestConfig = Directory: string DotNetExe: string DefaultPlatform: string - GitExe: string } + GitExe: string + NunitConsoleRunner: string } module WindowsPlatform = @@ -203,6 +209,9 @@ let config configurationName envVars = let gitExe = let gitPath = envVars.["GIT"] Path.Combine(gitPath, "git.exe") + let nunitExe = + packagesDir ++ "NUnit.Console.3.0.0" ++ "tools" ++ "nunit3-console.exe" + let defaultPlatform = match Is64BitOperatingSystem with // | PlatformID.MacOSX, true -> "osx.10.10-x64" @@ -227,7 +236,8 @@ let config configurationName envVars = Directory="" DotNetExe = dotNetExe DefaultPlatform = defaultPlatform - GitExe = gitExe } + GitExe = gitExe + NunitConsoleRunner = nunitExe } let logConfig (cfg: TestConfig) = log "---------------------------------------------------------------" @@ -466,6 +476,7 @@ let mkdir cfg = Commands.mkdir_p cfg.Directory let copy_y cfg f = Commands.copy_y cfg.Directory f >> checkResult let dotnet cfg flag args = Commands.dotnet cfg.Directory (exec cfg) cfg.DotNetExe flag args let git cfg x = Commands.git (exec cfg) (cfg.GitExe) x +let nunit cfg x = Commands.nunit (exec cfg) (cfg.NunitConsoleRunner) (cfg.Directory) x let diff normalize path1 path2 = let result = System.Text.StringBuilder() diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 6a0efc0db5d..c3ff83be6ce 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -48,12 +48,57 @@ module CoreTests = let cfg3 = testConfig "repos/FSharpPlus/src/FSharpPlus" - dotnet cfg3 "msbuild" - [ "FSharpPlus.fsproj" - "/p:CompilerTest=true" - sprintf "/p:FSC_ToolPathCompilerBuild=%s" fullPath - sprintf "/p:FSC_ExePathCompilerBuild=%s" (fullPath ++ "fsc.exe") - ] + // Debug build isn't working + //dotnet cfg3 "msbuild" [ + // "FSharpPlus.fsproj" + // "/p:Configuration=Debug" + // "/p:CompilerTest=true" + // sprintf "/p:FSC_ToolPathCompilerBuild=%s" fullPath + // sprintf "/p:FSC_ExePathCompilerBuild=%s" (fullPath ++ "fsc.exe") + //] + + dotnet cfg3 "msbuild" [ + "FSharpPlus.fsproj" + "/p:Configuration=Release" + "/p:CompilerTest=true" + sprintf "/p:FSC_ToolPathCompilerBuild=%s" fullPath + sprintf "/p:FSC_ExePathCompilerBuild=%s" (fullPath ++ "fsc.exe") + ] + + [] + let testFSharpPlusTests () = + let cfg = testConfig "repos/FSharpPlus/tests/FSharpPlus.Tests" + + // Reference the freshly built compiler + let fullPath = cfg.FSCBinPath |> getFullPath + + // Debug build isn't working + //dotnet cfg "msbuild" [ + // "FSharpPlus.Tests.fsproj" + // "/p:Configuration=Debug" + // "/p:CompilerTest=true" + // sprintf "/p:FSC_ToolPathCompilerBuild=%s" fullPath + // sprintf "/p:FSC_ExePathCompilerBuild=%s" (fullPath ++ "fsc.exe") + //] + + dotnet cfg "msbuild" [ + "FSharpPlus.Tests.fsproj" + "/p:Configuration=Release" + "/p:CompilerTest=true" + sprintf "/p:FSC_ToolPathCompilerBuild=%s" fullPath + sprintf "/p:FSC_ExePathCompilerBuild=%s" (fullPath ++ "fsc.exe") + ] + + // Debug build isn't working so no testing of it + //nunit cfg [ + // "--verbose" + // "./bin/Debug/FSharpPlus.Tests.dll" + //] + + nunit cfg [ + "--verbose" + "./bin/Debug/FSharpPlus.Tests.dll" + ] // These tests are enabled for .NET Framework and .NET Core [] From 036488f2b0a2776e5bd0c5497027c7fc5616c63e Mon Sep 17 00:00:00 2001 From: realvictorprm Date: Fri, 9 Nov 2018 11:42:21 +0100 Subject: [PATCH 03/14] Reference correct F#+ commit and fix tests Signed-off-by: realvictorprm --- tests/fsharp/tests.fs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index c3ff83be6ce..e16b474b290 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -41,7 +41,9 @@ module CoreTests = let cfg2 = testConfig "repos/FSharpPlus" - // git cfg2 ["reset"; "--hard"; "fcb507bc8734362f4f6d40c08a4bc011e50e5d56"] + git cfg2 ["reset"; "--hard"; "aba256430a86a4022941800f06421dda16aa4cb0"] + + exec cfg2 "build.cmd" "restore" // Reference the freshly built compiler let fullPath = cfg2.FSCBinPath |> getFullPath @@ -97,7 +99,7 @@ module CoreTests = nunit cfg [ "--verbose" - "./bin/Debug/FSharpPlus.Tests.dll" + "./bin/Release/FSharpPlus.Tests.dll" ] // These tests are enabled for .NET Framework and .NET Core From 962e50bdeb1b5ca8581b947eb372eea8f57ea86a Mon Sep 17 00:00:00 2001 From: realvictorprm Date: Fri, 9 Nov 2018 11:52:16 +0100 Subject: [PATCH 04/14] fixing tests --- tests/fsharp/tests.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index e16b474b290..16fa9d503a4 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -99,7 +99,7 @@ module CoreTests = nunit cfg [ "--verbose" - "./bin/Release/FSharpPlus.Tests.dll" + (cfg.Directory ++ "./bin/Release/net45/FSharpPlus.Tests.dll" |> getFullPath) ] // These tests are enabled for .NET Framework and .NET Core From 14ab9b1403922d76ab17d4559ec45e658b64c07a Mon Sep 17 00:00:00 2001 From: realvictorprm Date: Fri, 9 Nov 2018 13:04:58 +0100 Subject: [PATCH 05/14] get git from path --- tests/fsharp/test-framework.fs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/fsharp/test-framework.fs b/tests/fsharp/test-framework.fs index 1b48fd3cade..38dc205fb8b 100644 --- a/tests/fsharp/test-framework.fs +++ b/tests/fsharp/test-framework.fs @@ -207,7 +207,10 @@ let config configurationName envVars = let FSCOREDLLPATH = "" #endif let gitExe = - let gitPath = envVars.["GIT"] + let gitPath = + envVars.["Path"].Split(';') + |> Array.filter(fun s -> s.Contains("Git")) + |> Array.find(fun s -> System.IO.File.Exists(System.IO.Path.Combine(s, "git.exe"))) Path.Combine(gitPath, "git.exe") let nunitExe = packagesDir ++ "NUnit.Console.3.0.0" ++ "tools" ++ "nunit3-console.exe" From 179e6ac78586a9ea56d66800891b8fdbc442918d Mon Sep 17 00:00:00 2001 From: realvictorprm Date: Fri, 9 Nov 2018 16:24:33 +0100 Subject: [PATCH 06/14] try finding dotnet.exe through using Path env variable --- tests/fsharp/test-framework.fs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/fsharp/test-framework.fs b/tests/fsharp/test-framework.fs index 38dc205fb8b..fbb1baf25fe 100644 --- a/tests/fsharp/test-framework.fs +++ b/tests/fsharp/test-framework.fs @@ -114,11 +114,10 @@ module Commands = Directory.CreateDirectory path |> ignore path - let dotnet workDir exec (_: FilePath) flag srcFiles = + let dotnet workDir exec dotnetExe flag srcFiles = let args = (sprintf "%s %s" flag (srcFiles |> Seq.ofList |> String.concat " ")) - ignore workDir - exec "C:\Program Files\dotnet\dotnet.exe" args + exec dotnetExe args let git exec gitExe args = let args = (sprintf "%s" (args |> Seq.ofList |> String.concat " ")) @@ -190,8 +189,14 @@ let config configurationName envVars = | [||] -> failwithf "Could not find any 'FSharp.Compiler.Tools' inside '%s'" packagesDir | [| dir |] -> Path.Combine(dir, "tools", "fsi.exe") | _ -> failwithf "Found more than one 'FSharp.Compiler.Tools' inside '%s', please clean up." packagesDir - let toolsDir = SCRIPT_ROOT ++ ".." ++ ".." ++ "Tools" - let dotNetExe = toolsDir ++ "dotnetcli" ++ "dotnet.exe" + // let toolsDir = SCRIPT_ROOT ++ ".." ++ ".." ++ "Tools" + let dotNetExe = + let dotnetPath = + envVars.["Path"].Split(';') + |> Array.filter(fun path -> path.Contains("dotnet")) + |> Array.find(fun path -> File.Exists(path ++ "dotnet.exe")) + dotnetPath ++ "dotnet.exe" + // toolsDir ++ "dotnetcli" ++ "dotnet.exe" // ildasm requires coreclr.dll to run which has already been restored to the packages directory File.Copy(coreclrdll, Path.GetDirectoryName(ILDASM) ++ "coreclr.dll", overwrite=true) @@ -209,9 +214,9 @@ let config configurationName envVars = let gitExe = let gitPath = envVars.["Path"].Split(';') - |> Array.filter(fun s -> s.Contains("Git")) - |> Array.find(fun s -> System.IO.File.Exists(System.IO.Path.Combine(s, "git.exe"))) - Path.Combine(gitPath, "git.exe") + |> Array.filter(fun path -> path.Contains("Git")) + |> Array.find(fun path -> File.Exists(path ++ "git.exe")) + gitPath ++ "git.exe" let nunitExe = packagesDir ++ "NUnit.Console.3.0.0" ++ "tools" ++ "nunit3-console.exe" From 31a6ac6de18b0d5fb348a767cb066d612daa2170 Mon Sep 17 00:00:00 2001 From: realvictorprm Date: Fri, 9 Nov 2018 17:40:18 +0100 Subject: [PATCH 07/14] fix search for dotnet.exe --- tests/fsharp/test-framework.fs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/fsharp/test-framework.fs b/tests/fsharp/test-framework.fs index fbb1baf25fe..0c3708dc5f7 100644 --- a/tests/fsharp/test-framework.fs +++ b/tests/fsharp/test-framework.fs @@ -192,9 +192,17 @@ let config configurationName envVars = // let toolsDir = SCRIPT_ROOT ++ ".." ++ ".." ++ "Tools" let dotNetExe = let dotnetPath = - envVars.["Path"].Split(';') - |> Array.filter(fun path -> path.Contains("dotnet")) - |> Array.find(fun path -> File.Exists(path ++ "dotnet.exe")) + let path = envVars.["Path"].Split(';') + let res = + path + |> Array.filter(fun path -> path.Contains("dotnetcli")) + |> Array.tryFind(fun path -> File.Exists(path ++ "dotnet.exe")) + match res with + | Some dotnetpath -> dotnetpath + | None -> + path + |> Array.filter(fun path -> path.Contains("dotnet")) + |> Array.find(fun path -> File.Exists(path ++ "dotnet.exe")) dotnetPath ++ "dotnet.exe" // toolsDir ++ "dotnetcli" ++ "dotnet.exe" // ildasm requires coreclr.dll to run which has already been restored to the packages directory From 06b76156094551928ab78b054538325b29088389 Mon Sep 17 00:00:00 2001 From: realvictorprm Date: Sat, 17 Nov 2018 13:15:01 +0100 Subject: [PATCH 08/14] Fix CI Build --- tests/fsharp/test-framework.fs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/tests/fsharp/test-framework.fs b/tests/fsharp/test-framework.fs index 0c3708dc5f7..9c1ef6b5ebb 100644 --- a/tests/fsharp/test-framework.fs +++ b/tests/fsharp/test-framework.fs @@ -189,22 +189,17 @@ let config configurationName envVars = | [||] -> failwithf "Could not find any 'FSharp.Compiler.Tools' inside '%s'" packagesDir | [| dir |] -> Path.Combine(dir, "tools", "fsi.exe") | _ -> failwithf "Found more than one 'FSharp.Compiler.Tools' inside '%s', please clean up." packagesDir - // let toolsDir = SCRIPT_ROOT ++ ".." ++ ".." ++ "Tools" + let toolsDir = SCRIPT_ROOT ++ ".." ++ ".." ++ "Tools" let dotNetExe = - let dotnetPath = + if File.Exists(toolsDir ++ "dotnetcli" ++ "dotnet.exe") then + toolsDir ++ "dotnetcli" ++ "dotnet.exe" + else let path = envVars.["Path"].Split(';') - let res = - path - |> Array.filter(fun path -> path.Contains("dotnetcli")) - |> Array.tryFind(fun path -> File.Exists(path ++ "dotnet.exe")) - match res with - | Some dotnetpath -> dotnetpath - | None -> + let dotnetPath = path |> Array.filter(fun path -> path.Contains("dotnet")) |> Array.find(fun path -> File.Exists(path ++ "dotnet.exe")) - dotnetPath ++ "dotnet.exe" - // toolsDir ++ "dotnetcli" ++ "dotnet.exe" + dotnetPath ++ "dotnet.exe" // ildasm requires coreclr.dll to run which has already been restored to the packages directory File.Copy(coreclrdll, Path.GetDirectoryName(ILDASM) ++ "coreclr.dll", overwrite=true) From 1d9222dc20daf43d092b12ee17e4301bed33e649 Mon Sep 17 00:00:00 2001 From: realvictorprm Date: Sat, 17 Nov 2018 15:30:45 +0100 Subject: [PATCH 09/14] Pinpoint the target framework for F#+ builds to net45 Signed-off-by: realvictorprm --- tests/fsharp/tests.fs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 16fa9d503a4..4102dd709c4 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -63,6 +63,7 @@ module CoreTests = "FSharpPlus.fsproj" "/p:Configuration=Release" "/p:CompilerTest=true" + "/p:TargetFramework=net45" sprintf "/p:FSC_ToolPathCompilerBuild=%s" fullPath sprintf "/p:FSC_ExePathCompilerBuild=%s" (fullPath ++ "fsc.exe") ] @@ -87,6 +88,7 @@ module CoreTests = "FSharpPlus.Tests.fsproj" "/p:Configuration=Release" "/p:CompilerTest=true" + "/p:TargetFramework=net45" sprintf "/p:FSC_ToolPathCompilerBuild=%s" fullPath sprintf "/p:FSC_ExePathCompilerBuild=%s" (fullPath ++ "fsc.exe") ] From 8de64215d43c4d9110c071b0ac6e706ca3f41373 Mon Sep 17 00:00:00 2001 From: realvictorprm Date: Sat, 17 Nov 2018 17:06:44 +0100 Subject: [PATCH 10/14] temporary modify CI build to allow faster report for F#+ test. --- build.cmd | 6 ++++-- tests/fsharp/tests.fs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build.cmd b/build.cmd index dae4a3cafbf..d5b4dcdd46e 100644 --- a/build.cmd +++ b/build.cmd @@ -955,9 +955,11 @@ if "%TEST_NET40_FSHARP_SUITE%" == "1" ( set ERRORARG=--err:"!ERRORFILE!" ) - echo "!NUNIT3_CONSOLE!" --verbose "!FSCBINPATH!\FSharp.Tests.FSharpSuite.dll" --framework:V4.0 --work:"!FSCBINPATH!" !OUTPUTARG! !ERRORARG! --result:"!XMLFILE!;format=nunit3" !WHERE_ARG_NUNIT! - "!NUNIT3_CONSOLE!" --verbose "!FSCBINPATH!\FSharp.Tests.FSharpSuite.dll" --framework:V4.0 --work:"!FSCBINPATH!" !OUTPUTARG! !ERRORARG! --result:"!XMLFILE!;format=nunit3" !WHERE_ARG_NUNIT! + echo "!NUNIT3_CONSOLE!" --verbose "!FSCBINPATH!\FSharp.Tests.FSharpSuite.dll" --framework:V4.0 --work:"!FSCBINPATH!" !OUTPUTARG! !ERRORARG! --result:"!XMLFILE!;format=nunit3" --test=FSharp-Tests-Core+CoreTests.testFSharpPlusBuild !WHERE_ARG_NUNIT! + "!NUNIT3_CONSOLE!" --verbose "!FSCBINPATH!\FSharp.Tests.FSharpSuite.dll" --framework:V4.0 --work:"!FSCBINPATH!" !OUTPUTARG! !ERRORARG! --result:"!XMLFILE!;format=nunit3" --test=FSharp-Tests-Core+CoreTests.testFSharpPlusBuild !WHERE_ARG_NUNIT! + echo "!NUNIT3_CONSOLE!" --verbose "!FSCBINPATH!\FSharp.Tests.FSharpSuite.dll" --framework:V4.0 --work:"!FSCBINPATH!" !OUTPUTARG! !ERRORARG! --result:"!XMLFILE!;format=nunit3" --test=FSharp-Tests-Core+CoreTests.testFSharpPlusTests !WHERE_ARG_NUNIT! + "!NUNIT3_CONSOLE!" --verbose "!FSCBINPATH!\FSharp.Tests.FSharpSuite.dll" --framework:V4.0 --work:"!FSCBINPATH!" !OUTPUTARG! !ERRORARG! --result:"!XMLFILE!;format=nunit3" --test=FSharp-Tests-Core+CoreTests.testFSharpPlusTests !WHERE_ARG_NUNIT! if errorlevel 1 ( type "!ERRORFILE!" echo ----------------------------------------------------------------- diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 4102dd709c4..35e79e8ffa9 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -43,7 +43,7 @@ module CoreTests = git cfg2 ["reset"; "--hard"; "aba256430a86a4022941800f06421dda16aa4cb0"] - exec cfg2 "build.cmd" "restore" + dotnet cfg2 "\"restore\"" ["FSharpPlus.sln"] // Reference the freshly built compiler let fullPath = cfg2.FSCBinPath |> getFullPath From ef552c3de0199fa918a05d23edf79e971af904c0 Mon Sep 17 00:00:00 2001 From: realvictorprm Date: Mon, 19 Nov 2018 12:18:26 +0100 Subject: [PATCH 11/14] reverting the last commit --- build.cmd | 6 ++---- tests/fsharp/tests.fs | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/build.cmd b/build.cmd index d5b4dcdd46e..dae4a3cafbf 100644 --- a/build.cmd +++ b/build.cmd @@ -955,11 +955,9 @@ if "%TEST_NET40_FSHARP_SUITE%" == "1" ( set ERRORARG=--err:"!ERRORFILE!" ) - echo "!NUNIT3_CONSOLE!" --verbose "!FSCBINPATH!\FSharp.Tests.FSharpSuite.dll" --framework:V4.0 --work:"!FSCBINPATH!" !OUTPUTARG! !ERRORARG! --result:"!XMLFILE!;format=nunit3" --test=FSharp-Tests-Core+CoreTests.testFSharpPlusBuild !WHERE_ARG_NUNIT! - "!NUNIT3_CONSOLE!" --verbose "!FSCBINPATH!\FSharp.Tests.FSharpSuite.dll" --framework:V4.0 --work:"!FSCBINPATH!" !OUTPUTARG! !ERRORARG! --result:"!XMLFILE!;format=nunit3" --test=FSharp-Tests-Core+CoreTests.testFSharpPlusBuild !WHERE_ARG_NUNIT! + echo "!NUNIT3_CONSOLE!" --verbose "!FSCBINPATH!\FSharp.Tests.FSharpSuite.dll" --framework:V4.0 --work:"!FSCBINPATH!" !OUTPUTARG! !ERRORARG! --result:"!XMLFILE!;format=nunit3" !WHERE_ARG_NUNIT! + "!NUNIT3_CONSOLE!" --verbose "!FSCBINPATH!\FSharp.Tests.FSharpSuite.dll" --framework:V4.0 --work:"!FSCBINPATH!" !OUTPUTARG! !ERRORARG! --result:"!XMLFILE!;format=nunit3" !WHERE_ARG_NUNIT! - echo "!NUNIT3_CONSOLE!" --verbose "!FSCBINPATH!\FSharp.Tests.FSharpSuite.dll" --framework:V4.0 --work:"!FSCBINPATH!" !OUTPUTARG! !ERRORARG! --result:"!XMLFILE!;format=nunit3" --test=FSharp-Tests-Core+CoreTests.testFSharpPlusTests !WHERE_ARG_NUNIT! - "!NUNIT3_CONSOLE!" --verbose "!FSCBINPATH!\FSharp.Tests.FSharpSuite.dll" --framework:V4.0 --work:"!FSCBINPATH!" !OUTPUTARG! !ERRORARG! --result:"!XMLFILE!;format=nunit3" --test=FSharp-Tests-Core+CoreTests.testFSharpPlusTests !WHERE_ARG_NUNIT! if errorlevel 1 ( type "!ERRORFILE!" echo ----------------------------------------------------------------- diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 35e79e8ffa9..4102dd709c4 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -43,7 +43,7 @@ module CoreTests = git cfg2 ["reset"; "--hard"; "aba256430a86a4022941800f06421dda16aa4cb0"] - dotnet cfg2 "\"restore\"" ["FSharpPlus.sln"] + exec cfg2 "build.cmd" "restore" // Reference the freshly built compiler let fullPath = cfg2.FSCBinPath |> getFullPath From ca053844b21816380e2cb0eff3d7e87f3e88413c Mon Sep 17 00:00:00 2001 From: realvictorprm Date: Mon, 19 Nov 2018 13:18:37 +0100 Subject: [PATCH 12/14] Fix code for building F#+ Signed-off-by: realvictorprm --- tests/fsharp/tests.fs | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 4102dd709c4..a831c3b6d43 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -60,7 +60,6 @@ module CoreTests = //] dotnet cfg3 "msbuild" [ - "FSharpPlus.fsproj" "/p:Configuration=Release" "/p:CompilerTest=true" "/p:TargetFramework=net45" @@ -85,7 +84,6 @@ module CoreTests = //] dotnet cfg "msbuild" [ - "FSharpPlus.Tests.fsproj" "/p:Configuration=Release" "/p:CompilerTest=true" "/p:TargetFramework=net45" From b4a86fb35ce81ad97806b7f0588c83fb515b9df5 Mon Sep 17 00:00:00 2001 From: realvictorprm Date: Mon, 19 Nov 2018 14:51:29 +0100 Subject: [PATCH 13/14] Use the newest dotnet command line to build F#+ on the CI. Signed-off-by: realvictorprm --- tests/fsharp/test-framework.fs | 4 ++-- tests/fsharp/tests.fs | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/fsharp/test-framework.fs b/tests/fsharp/test-framework.fs index 9c1ef6b5ebb..f7c66999fc1 100644 --- a/tests/fsharp/test-framework.fs +++ b/tests/fsharp/test-framework.fs @@ -191,8 +191,8 @@ let config configurationName envVars = | _ -> failwithf "Found more than one 'FSharp.Compiler.Tools' inside '%s', please clean up." packagesDir let toolsDir = SCRIPT_ROOT ++ ".." ++ ".." ++ "Tools" let dotNetExe = - if File.Exists(toolsDir ++ "dotnetcli" ++ "dotnet.exe") then - toolsDir ++ "dotnetcli" ++ "dotnet.exe" + if File.Exists(toolsDir ++ "dotnet20" ++ "dotnet.exe") then + toolsDir ++ "dotnet20" ++ "dotnet.exe" else let path = envVars.["Path"].Split(';') let dotnetPath = diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index a831c3b6d43..67b6ed23b57 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -59,12 +59,13 @@ module CoreTests = // sprintf "/p:FSC_ExePathCompilerBuild=%s" (fullPath ++ "fsc.exe") //] - dotnet cfg3 "msbuild" [ + dotnet cfg3 "build" [ "/p:Configuration=Release" "/p:CompilerTest=true" "/p:TargetFramework=net45" sprintf "/p:FSC_ToolPathCompilerBuild=%s" fullPath sprintf "/p:FSC_ExePathCompilerBuild=%s" (fullPath ++ "fsc.exe") + "FSharpPlus.fsproj" ] [] @@ -83,12 +84,13 @@ module CoreTests = // sprintf "/p:FSC_ExePathCompilerBuild=%s" (fullPath ++ "fsc.exe") //] - dotnet cfg "msbuild" [ + dotnet cfg "build" [ "/p:Configuration=Release" "/p:CompilerTest=true" "/p:TargetFramework=net45" sprintf "/p:FSC_ToolPathCompilerBuild=%s" fullPath sprintf "/p:FSC_ExePathCompilerBuild=%s" (fullPath ++ "fsc.exe") + "FSharpPlus.Tests.fsproj" ] // Debug build isn't working so no testing of it From 86376f7b4998bf84a6df63720a8188968826522c Mon Sep 17 00:00:00 2001 From: realvictorprm Date: Tue, 20 Nov 2018 12:11:54 +0100 Subject: [PATCH 14/14] disable F#+ tests when running coreclr tests Signed-off-by: realvictorprm --- tests/fsharp/test-framework.fs | 9 +++++++-- tests/fsharp/tests.fs | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/fsharp/test-framework.fs b/tests/fsharp/test-framework.fs index f7c66999fc1..36853e17341 100644 --- a/tests/fsharp/test-framework.fs +++ b/tests/fsharp/test-framework.fs @@ -191,8 +191,13 @@ let config configurationName envVars = | _ -> failwithf "Found more than one 'FSharp.Compiler.Tools' inside '%s', please clean up." packagesDir let toolsDir = SCRIPT_ROOT ++ ".." ++ ".." ++ "Tools" let dotNetExe = - if File.Exists(toolsDir ++ "dotnet20" ++ "dotnet.exe") then - toolsDir ++ "dotnet20" ++ "dotnet.exe" +#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS + let CI_DotnetPath = "dotnet20" +#else + let CI_DotnetPath = "dotnetcli" +#endif + if File.Exists(toolsDir ++ CI_DotnetPath ++ "dotnet.exe") then + toolsDir ++ CI_DotnetPath ++ "dotnet.exe" else let path = envVars.["Path"].Split(';') let dotnetPath = diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 67b6ed23b57..be749a0652b 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -29,7 +29,8 @@ let FSI_BASIC = FSI_FILE module CoreTests = open TestFramework - + +#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS [] let testFSharpPlusBuild () = let cfg = testConfig "" @@ -103,6 +104,7 @@ module CoreTests = "--verbose" (cfg.Directory ++ "./bin/Release/net45/FSharpPlus.Tests.dll" |> getFullPath) ] +#endif // These tests are enabled for .NET Framework and .NET Core []