From 7772bb0be5ab7d3b0302dd327eec2d12c61f0ddb Mon Sep 17 00:00:00 2001 From: enricosada Date: Fri, 29 Apr 2016 13:59:10 +0200 Subject: [PATCH 1/2] disable tests who require en culture, if current culture is not en --- tests/fsharp/core/tests_core.fs | 10 +++++++++- tests/fsharp/typeProviders/tests_typeProviders.fs | 9 +++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/fsharp/core/tests_core.fs b/tests/fsharp/core/tests_core.fs index 502b941e219..5b67449b6ab 100644 --- a/tests/fsharp/core/tests_core.fs +++ b/tests/fsharp/core/tests_core.fs @@ -21,6 +21,13 @@ let requireVSUltimate cfg = attempt { // ) } +let requireENCulture () = attempt { + do! match System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName with + | "en" -> Success + | c -> + NUnitConf.skip (sprintf "Test not supported except en Culture, was %s" c) + } + module Access = [] let access p = check (attempt { @@ -667,7 +674,6 @@ module Printing = // if NOT EXIST z.output.test.200.bsl COPY z.output.test.200.txt z.output.test.200.bsl // %PRDIFF% z.output.test.200.txt z.output.test.200.bsl > z.output.test.200.diff [] - [] //not enough [] [] [] @@ -676,6 +682,8 @@ module Printing = let printing flag diffFileOut expectedFileOut diffFileErr expectedFileErr = check (attempt { let { Directory = dir; Config = cfg } = testContext () + do! requireENCulture () + let exec p = Command.exec dir cfg.EnvironmentVariables { Output = Inherit; Input = None; } p >> checkResult let peverify = Commands.peverify exec cfg.PEVERIFY "/nologo" let copy from' = Commands.copy_y dir from' >> checkResult diff --git a/tests/fsharp/typeProviders/tests_typeProviders.fs b/tests/fsharp/typeProviders/tests_typeProviders.fs index 119f827a0df..e5c7ef2ce88 100644 --- a/tests/fsharp/typeProviders/tests_typeProviders.fs +++ b/tests/fsharp/typeProviders/tests_typeProviders.fs @@ -21,6 +21,13 @@ let requireVSUltimate cfg = attempt { // ) } +let requireENCulture () = attempt { + do! match System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName with + | "en" -> Success + | c -> + NUnitConf.skip (sprintf "Test not supported except en Culture, was %s" c) + } + module DiamondAssembly = let build cfg dir = attempt { @@ -361,6 +368,8 @@ module NegTests = let negTests name = check (attempt { let { Directory = dir; Config = cfg } = testContext () + do! requireENCulture () + let exec p = Command.exec dir cfg.EnvironmentVariables { Output = Inherit; Input = None; } p >> checkResult let fsc = Commands.fsc exec cfg.FSC let del = Commands.rm dir From aa8fc5f2258470157432a4b6af402ce41d3db98a Mon Sep 17 00:00:00 2001 From: enricosada Date: Fri, 29 Apr 2016 16:53:49 +0200 Subject: [PATCH 2/2] refactor move duplicated functions to module --- tests/fsharp/FSharp.Tests.fsproj | 1 + tests/fsharp/FSharpTestSuiteAsserts.fs | 22 +++++++++++++++++++ tests/fsharp/core/tests_core.fs | 19 +--------------- .../typeProviders/tests_typeProviders.fs | 19 +--------------- 4 files changed, 25 insertions(+), 36 deletions(-) create mode 100644 tests/fsharp/FSharpTestSuiteAsserts.fs diff --git a/tests/fsharp/FSharp.Tests.fsproj b/tests/fsharp/FSharp.Tests.fsproj index cc09622d025..9fb41bcc3cf 100644 --- a/tests/fsharp/FSharp.Tests.fsproj +++ b/tests/fsharp/FSharp.Tests.fsproj @@ -67,6 +67,7 @@ + diff --git a/tests/fsharp/FSharpTestSuiteAsserts.fs b/tests/fsharp/FSharpTestSuiteAsserts.fs new file mode 100644 index 00000000000..f862421f6cd --- /dev/null +++ b/tests/fsharp/FSharpTestSuiteAsserts.fs @@ -0,0 +1,22 @@ +module FSharpTestSuiteAsserts + +open PlatformHelpers +open FSharpTestSuiteTypes + +let requireVSUltimate cfg = attempt { + do! match cfg.INSTALL_SKU with + | Some (Ultimate) -> Success + | x -> + // IF /I "%INSTALL_SKU%" NEQ "ULTIMATE" ( + // echo Test not supported except on Ultimate + NUnitConf.skip (sprintf "Test not supported except on Ultimate, was %A" x) + // exit /b 0 + // ) + } + +let requireENCulture () = attempt { + do! match System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName with + | "en" -> Success + | c -> + NUnitConf.skip (sprintf "Test not supported except en Culture, was %s" c) + } diff --git a/tests/fsharp/core/tests_core.fs b/tests/fsharp/core/tests_core.fs index 5b67449b6ab..c51f82cd296 100644 --- a/tests/fsharp/core/tests_core.fs +++ b/tests/fsharp/core/tests_core.fs @@ -7,27 +7,10 @@ open NUnit.Framework open NUnitConf open PlatformHelpers open FSharpTestSuiteTypes +open FSharpTestSuiteAsserts let testContext = FSharpTestSuite.testContext -let requireVSUltimate cfg = attempt { - do! match cfg.INSTALL_SKU with - | Some (Ultimate) -> Success - | x -> - // IF /I "%INSTALL_SKU%" NEQ "ULTIMATE" ( - // echo Test not supported except on Ultimate - NUnitConf.skip (sprintf "Test not supported except on Ultimate, was %A" x) - // exit /b 0 - // ) - } - -let requireENCulture () = attempt { - do! match System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName with - | "en" -> Success - | c -> - NUnitConf.skip (sprintf "Test not supported except en Culture, was %s" c) - } - module Access = [] let access p = check (attempt { diff --git a/tests/fsharp/typeProviders/tests_typeProviders.fs b/tests/fsharp/typeProviders/tests_typeProviders.fs index e5c7ef2ce88..40b4e2d6b81 100644 --- a/tests/fsharp/typeProviders/tests_typeProviders.fs +++ b/tests/fsharp/typeProviders/tests_typeProviders.fs @@ -7,27 +7,10 @@ open NUnit.Framework open FSharpTestSuiteTypes open NUnitConf open PlatformHelpers +open FSharpTestSuiteAsserts let testContext = FSharpTestSuite.testContext -let requireVSUltimate cfg = attempt { - do! match cfg.INSTALL_SKU with - | Some (Ultimate) -> Success - | x -> - // IF /I "%INSTALL_SKU%" NEQ "ULTIMATE" ( - // echo Test not supported except on Ultimate - NUnitConf.skip (sprintf "Test not supported except on Ultimate, was %A" x) - // exit /b 0 - // ) - } - -let requireENCulture () = attempt { - do! match System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName with - | "en" -> Success - | c -> - NUnitConf.skip (sprintf "Test not supported except en Culture, was %s" c) - } - module DiamondAssembly = let build cfg dir = attempt {