Skip to content

Commit deac66c

Browse files
committed
more tests, separating pipeline from experimental features
1 parent f9d7f3f commit deac66c

13 files changed

Lines changed: 35 additions & 22 deletions

File tree

azure-pipelines.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ stages:
433433
vs_release:
434434
_configuration: Release
435435
_testKind: testVs
436-
experimental_features:
436+
transparent_compiler:
437437
_configuration: Release
438438
_testKind: testCoreclr
439439

@@ -454,14 +454,14 @@ stages:
454454
env:
455455
NativeToolsOnMachine: true
456456
displayName: Build / Test
457-
condition: and( ne(variables['_testKind'], 'testIntegration'), ne(variables['System.JobName'], 'experimental_features') )
457+
condition: and( ne(variables['_testKind'], 'testIntegration'), ne(variables['System.JobName'], 'transparent_compiler') )
458458

459459
- script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind)
460460
env:
461-
FSHARP_EXPERIMENTAL_FEATURES: 1
461+
TEST_TRANSPARENT_COMPILER: 1
462462
NativeToolsOnMachine: true
463-
displayName: Build / Test Experimental Features
464-
condition: and( eq(variables['System.JobName'], 'experimental_features'), ne(variables['_testKind'], 'testIntegration') )
463+
displayName: Build / Test Transparent Compiler
464+
condition: and( eq(variables['System.JobName'], 'transparent_compiler'), ne(variables['_testKind'], 'testIntegration') )
465465

466466
- script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind)
467467
env:

tests/FSharp.Compiler.ComponentTests/TypeChecks/TyparNameTests.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module TyparNameTests =
1414
(additionalFile: SourceCodeFileKind)
1515
: string array =
1616
let typeCheckResult =
17-
cUnit |> withAdditionalSourceFile additionalFile |> typecheckProject false false
17+
cUnit |> withAdditionalSourceFile additionalFile |> typecheckProject false CompilerAssertHelpers.UseTransparentCompiler
1818

1919
assert (Array.isEmpty typeCheckResult.Diagnostics)
2020

tests/FSharp.Compiler.Service.Tests/FSharpExprPatternsTests.fs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module FSharp.Compiler.Service.Tests.FSharpExprPatternsTests
22

3+
open FSharp.Test
4+
35
#nowarn "57"
46

57
open FSharp.Compiler.CodeAnalysis
@@ -137,7 +139,7 @@ let testPatterns handler source =
137139
}
138140

139141
let checker =
140-
FSharpChecker.Create(documentSource = DocumentSource.Custom documentSource, keepAssemblyContents = true)
142+
FSharpChecker.Create(documentSource = DocumentSource.Custom documentSource, keepAssemblyContents = true, useTransparentCompiler = CompilerAssertHelpers.UseTransparentCompiler)
141143

142144
let checkResult =
143145
checker.ParseAndCheckFileInProject("A.fs", 0, Map.find "A.fs" files, projectOptions)

tests/FSharp.Compiler.Service.Tests/TooltipTests.fs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module FSharp.Compiler.Service.Tests.TooltipTests
22

3+
34
#nowarn "57"
45

56
open FSharp.Compiler.CodeAnalysis
@@ -8,6 +9,7 @@ open FSharp.Compiler.Text
89
open FSharp.Compiler.Tokenization
910
open FSharp.Compiler.EditorServices
1011
open FSharp.Compiler.Symbols
12+
open FSharp.Test
1113
open NUnit.Framework
1214

1315
let testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource line colAtEndOfNames lineText names (expectedContent: string) =
@@ -29,7 +31,8 @@ let testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource line colAtEn
2931
SourceFiles = [| "A.fsi"; "A.fs" |] }
3032

3133
let checker =
32-
FSharpChecker.Create(documentSource = DocumentSource.Custom documentSource)
34+
FSharpChecker.Create(documentSource = DocumentSource.Custom documentSource,
35+
useTransparentCompiler = CompilerAssertHelpers.UseTransparentCompiler)
3336

3437
let checkResult =
3538
checker.ParseAndCheckFileInProject("A.fs", 0, Map.find "A.fs" files, projectOptions)
@@ -276,7 +279,8 @@ let testToolTipSquashing source line colAtEndOfNames lineText names tokenTag =
276279
SourceFiles = [| "A.fs" |] }
277280

278281
let checker =
279-
FSharpChecker.Create(documentSource = DocumentSource.Custom documentSource)
282+
FSharpChecker.Create(documentSource = DocumentSource.Custom documentSource,
283+
useTransparentCompiler = CompilerAssertHelpers.UseTransparentCompiler)
280284

281285
let checkResult =
282286
checker.ParseAndCheckFileInProject("A.fs", 0, Map.find "A.fs" files, projectOptions)

tests/FSharp.Test.Utilities/CompilerAssert.fs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,11 @@ and Compilation =
259259

260260
module rec CompilerAssertHelpers =
261261

262-
let useTransparentCompiler = FSharp.Compiler.CompilerConfig.FSharpExperimentalFeaturesEnabledAutomatically
263-
let checker = FSharpChecker.Create(suggestNamesForErrors=true, useTransparentCompiler=useTransparentCompiler)
262+
let UseTransparentCompiler =
263+
FSharp.Compiler.CompilerConfig.FSharpExperimentalFeaturesEnabledAutomatically ||
264+
not (String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("TEST_TRANSPARENT_COMPILER")))
265+
266+
let checker = FSharpChecker.Create(suggestNamesForErrors=true, useTransparentCompiler=UseTransparentCompiler)
264267

265268
// Unlike C# whose entrypoint is always string[] F# can make an entrypoint with 0 args, or with an array of string[]
266269
let mkDefaultArgs (entryPoint:MethodBase) : obj[] = [|

tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
<Link>scriptlib.fsx</Link>
2929
</Compile>
3030
<None Include="ScriptingShims.fsx" />
31-
<Compile Include="ProjectGeneration.fs" />
3231
<Compile Include="TestFramework.fs" />
3332
<Compile Include="ILChecker.fs" />
3433
<Compile Include="Utilities.fs" />
3534
<Compile Include="CompilerAssert.fs" />
35+
<Compile Include="ProjectGeneration.fs" />
3636
<Compile Include="Assert.fs" />
3737
<Compile Include="ScriptHelpers.fs" />
3838
<Compile Include="Compiler.fs" />

tests/FSharp.Test.Utilities/ProjectGeneration.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ type ProjectWorkflowBuilder
931931
?isExistingProject
932932
) =
933933

934-
let useTransparentCompiler = defaultArg useTransparentCompiler FSharp.Compiler.CompilerConfig.FSharpExperimentalFeaturesEnabledAutomatically
934+
let useTransparentCompiler = defaultArg useTransparentCompiler CompilerAssertHelpers.UseTransparentCompiler
935935
let useGetSource = not useTransparentCompiler && defaultArg useGetSource false
936936
let useChangeNotifications = not useTransparentCompiler && defaultArg useChangeNotifications false
937937
let autoStart = defaultArg autoStart true

tests/service/AssemblyContentProviderTests.fs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ open NUnit.Framework
1212
open FSharp.Compiler.CodeAnalysis
1313
open FSharp.Compiler.EditorServices
1414
open FSharp.Compiler.Service.Tests.Common
15+
open FSharp.Test
1516

1617
let private filePath = "C:\\test.fs"
1718

@@ -28,7 +29,7 @@ let private projectOptions : FSharpProjectOptions =
2829
UnresolvedReferences = None
2930
Stamp = None }
3031

31-
let private checker = FSharpChecker.Create()
32+
let private checker = FSharpChecker.Create(useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler)
3233

3334
let private assertAreEqual (expected, actual) =
3435
if actual <> expected then

tests/service/PerfTests.fs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ open FSharp.Compiler.IO
1616
open FSharp.Compiler.Text
1717
open FSharp.Compiler.Service.Tests.Common
1818
open TestFramework
19+
open FSharp.Test
1920

2021
// Create an interactive checker instance
21-
let internal checker = FSharpChecker.Create()
22+
let internal checker = FSharpChecker.Create(useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler)
2223

2324
module internal Project1 =
2425

vsintegration/tests/FSharp.Editor.Tests/BraceMatchingServiceTests.fs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ open Microsoft.CodeAnalysis.Text
88
open FSharp.Compiler.CodeAnalysis
99
open Microsoft.VisualStudio.FSharp.Editor
1010
open FSharp.Editor.Tests.Helpers
11+
open FSharp.Test
1112

1213
type BraceMatchingServiceTests() =
13-
let checker = FSharpChecker.Create()
14+
let checker = FSharpChecker.Create(useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler)
1415

1516
let fileName = "C:\\test.fs"
1617

0 commit comments

Comments
 (0)