Skip to content

Commit

Permalink
Merge pull request #1135 from enricosada/disable_culture_specific_tes…
Browse files Browse the repository at this point in the history
…ts_in_non_en_culture

disable tests who require en culture, if current culture is not en
  • Loading branch information
KevinRansom committed Apr 30, 2016
2 parents 40150ad + aa8fc5f commit ce687a4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 23 deletions.
1 change: 1 addition & 0 deletions tests/fsharp/FSharp.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
</Compile>
<Compile Include="..\..\src\fsharp\FSharp.Compiler.Unittests\NunitHelpers.fs" />
<Compile Include="nunitConf.fs" />
<Compile Include="FSharpTestSuiteAsserts.fs" />
<Compile Include="single-test-build.fs" />
<Compile Include="single-test-run.fs" />
<Compile Include="single-neg-test.fs" />
Expand Down
22 changes: 22 additions & 0 deletions tests/fsharp/FSharpTestSuiteAsserts.fs
Original file line number Diff line number Diff line change
@@ -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)
}
15 changes: 3 additions & 12 deletions tests/fsharp/core/tests_core.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +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
// )
}

module Access =
[<Test; FSharpSuiteScriptPermutations("core/access")>]
let access p = check (attempt {
Expand Down Expand Up @@ -667,7 +657,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
[<Test>]
[<SetCulture("en-US"); SetUICulture("en-US")>] //not enough
[<FSharpSuiteTestCase("core/printing", "", "z.output.test.default.stdout.txt", "z.output.test.default.stdout.bsl", "z.output.test.default.stderr.txt", "z.output.test.default.stderr.bsl")>]
[<FSharpSuiteTestCase("core/printing", "--use:preludePrintSize1000.fsx", "z.output.test.1000.stdout.txt", "z.output.test.1000.stdout.bsl", "z.output.test.1000.stderr.txt", "z.output.test.1000.stderr.bsl")>]
[<FSharpSuiteTestCase("core/printing", "--use:preludePrintSize200.fsx", "z.output.test.200.stdout.txt", "z.output.test.200.stdout.bsl", "z.output.test.200.stderr.txt", "z.output.test.200.stderr.bsl")>]
Expand All @@ -676,6 +665,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
Expand Down
14 changes: 3 additions & 11 deletions tests/fsharp/typeProviders/tests_typeProviders.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +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
// )
}

module DiamondAssembly =

let build cfg dir = attempt {
Expand Down Expand Up @@ -361,6 +351,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
Expand Down

0 comments on commit ce687a4

Please sign in to comment.