diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 980fd1bab8..9e7825f03b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -441,8 +441,6 @@ stages: - checkout: self clean: true - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr - env: - COMPlus_DefaultStackSize: 1000000 displayName: Build / Test - task: PublishTestResults@2 displayName: Publish Test Results diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/OffsideExceptions/OffsideExceptions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/OffsideExceptions/OffsideExceptions.fs index ffc44b0003..f00e227c82 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/OffsideExceptions/OffsideExceptions.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/OffsideExceptions/OffsideExceptions.fs @@ -5,10 +5,8 @@ namespace FSharp.Compiler.ComponentTests.Conformance.LexicalFiltering.Basic open Xunit open FSharp.Test open FSharp.Test.Compiler -open FSharp.Test.Compiler.Assertions.StructuredResultsAsserts module OffsideExceptions = - type FileAttribute(file) = inherit DirectoryAttribute(__SOURCE_DIRECTORY__, Includes=[|file|]) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Enums.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Enums.fs index 98df489432..33217909d2 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Enums.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Enums.fs @@ -4,7 +4,6 @@ namespace FSharp.Compiler.ComponentTests.EmittedIL open Xunit open FSharp.Test.Compiler -open FSharp.Test.Compiler.Assertions.StructuredResultsAsserts module Enums = diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Literals.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Literals.fs index c168d88fba..570f22d137 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Literals.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Literals.fs @@ -4,7 +4,6 @@ namespace FSharp.Compiler.ComponentTests.EmittedIL open Xunit open FSharp.Test.Compiler -open FSharp.Test.Compiler.Assertions.StructuredResultsAsserts module ``Literals`` = diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnsupportedAttributes.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnsupportedAttributes.fs index be59b17509..fa981de2a1 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnsupportedAttributes.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnsupportedAttributes.fs @@ -4,7 +4,6 @@ namespace FSharp.Compiler.ComponentTests.ErrorMessages open Xunit open FSharp.Test.Compiler -open FSharp.Test.Compiler.Assertions.StructuredResultsAsserts module ``Unsupported Attributes`` = diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 7c52f676fc..4b4f1577e8 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -226,10 +226,6 @@ - - - - diff --git a/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressionTests.fs index 9f87a5078e..5542717a94 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressionTests.fs @@ -4,10 +4,10 @@ module FSharp.Compiler.ComponentTests.Language.SequenceExpressionTests open Xunit open FSharp.Test.Compiler -open FSharp.Test.ScriptHelpers -let fsiSession = getSessionForEval [||] LangVersion.Preview + +let fsiSession = getSessionForEval() let runCode = evalInSharedSession fsiSession diff --git a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs deleted file mode 100644 index 00ed7c9dc5..0000000000 --- a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace FSharp.Compiler.ComponentTests.Miscellaneous.FsharpSuiteMigrated - -open System -open System.IO -open Xunit -open FSharp.Test -open FSharp.Test.Compiler -open FSharp.Test.ScriptHelpers - - - -module Configuration = - let supportedNames = set ["testlib.fsi";"testlib.fs";"test.mli";"test.ml";"test.fsi";"test.fs";"test2.fsi";"test2.fs";"test.fsx";"test2.fsx"] - -module ScriptRunner = - open Internal.Utilities.Library - - let private createEngine(args,version) = - let scriptingEnv = getSessionForEval args version - scriptingEnv.Eval """ -let errorStringWriter = new System.IO.StringWriter() -let oldConsoleError = System.Console.Error -System.Console.SetError(errorStringWriter) -let exit (code:int) = - System.Console.SetError(oldConsoleError) - if code=0 then - () - else failwith $"Script called function 'exit' with code={code} and collected in stderr: {errorStringWriter.ToString()}" """ |> ignore - scriptingEnv - - let defaultDefines = - [ -#if NETCOREAPP - "NETCOREAPP" -#endif - ] - - let runScriptFile version (cu:CompilationUnit) = - let cu = cu |> withDefines defaultDefines - match cu with - | FS fsSource -> - File.Delete("test.ok") - let engine = createEngine (fsSource.Options |> Array.ofList,version) - let res = evalScriptFromDiskInSharedSession engine cu - match res with - | CompilationResult.Failure _ -> res - | CompilationResult.Success s -> - if File.Exists("test.ok") then - res - else - failwith $"Results looked correct, but 'test.ok' file was not created. Result: %A{s}" - - | _ -> failwith $"Compilation unit other than fsharp is not supported, cannot process %A{cu}" - -/// This test file was created by porting over (slower) FsharpSuite.Tests -/// In order to minimize human error, the test definitions have been copy-pasted and this adapter provides implementations of the test functions -module TestFrameworkAdapter = - open FSharp.Test.Compiler.Assertions.TextBasedDiagnosticAsserts - - type ExecutionMode = - | FSC_DEBUG - | FSC_OPTIMIZED - | FSI - | COMPILED_EXE_APP - | NEG_TEST_BUILD of testName:string - - let baseFolder = Path.Combine(__SOURCE_DIRECTORY__,"..","..","fsharp") |> Path.GetFullPath - - let diffNegativeBaseline (cr:CompilationUnit) absFolder testName _version = - let expectedFiles = Directory.GetFiles(absFolder, testName + ".*") - let baselines = - [ for f in expectedFiles do - match Path.GetExtension(f) with - | ".bsl" -> cr, f - | ".vsbsl" -> cr |> withOptions ["--test:ContinueAfterParseFailure"], f - | _ -> () ] - [ for compilationUnit,baseline in baselines do - compilationUnit - |> typecheck - |> withResultsMatchingFile baseline ] - |> List.head - - - let adjustVersion version bonusArgs = - match version with - | LangVersion.V47 -> "4.7",bonusArgs - | LangVersion.V50 -> "5.0",bonusArgs - | LangVersion.V60 -> "6.0",bonusArgs - | LangVersion.V70 -> "7.0",bonusArgs - | LangVersion.Preview -> "preview",bonusArgs - | LangVersion.Latest -> "latest", bonusArgs - | LangVersion.SupportsMl -> "5.0", "--mlcompatibility" :: bonusArgs - - - let singleTestBuildAndRunAuxVersion (folder:string) bonusArgs mode langVersion = - let absFolder = Path.Combine(baseFolder,folder) - let supportedNames, files = - match mode with - | NEG_TEST_BUILD testName -> - let nameSet = - Configuration.supportedNames - .Add(testName+".fsx") - .Add(testName+".fs") - .Add(testName+".fsi") - .Add(testName+"-pre.fs") - let files = Directory.GetFiles(absFolder,"*.fs*") |> Array.filter(fun n -> nameSet.Contains(Path.GetFileName(n))) - nameSet, files - | _ -> Configuration.supportedNames, Directory.GetFiles(absFolder,"test*.fs*") - - let mainFile,otherFiles = - match files.Length with - | 0 -> Directory.GetFiles(absFolder,"*.ml") |> Array.exactlyOne, [||] - | 1 -> files |> Array.exactlyOne, [||] - | _ -> - let mainFile,dependencies = - files - |> Array.filter (fun n -> supportedNames.Contains(Path.GetFileName(n))) - // Convention in older FsharpSuite: test2 goes last, longer names like testlib before test, .fsi before .fs on equal filenames - |> Array.sortBy (fun n -> n.Contains("test2"), -n.IndexOf('.'), n.EndsWith(".fsi") |> not) - |> Array.splitAt 1 - - mainFile[0],dependencies - - let version,bonusArgs = adjustVersion langVersion bonusArgs - - FsFromPath mainFile - |> withAdditionalSourceFiles [for f in otherFiles -> SourceFromPath f] - |> withLangVersion version - |> fun cu -> - match mode with - | FSC_DEBUG | FSC_OPTIMIZED | FSI | COMPILED_EXE_APP -> - cu - |> ignoreWarnings - |> withOptions (["--nowarn:0988;3370"] @ bonusArgs) - | NEG_TEST_BUILD _ -> - cu |> - withOptions (["--vserrors";"--maxerrors:10000";"--warnaserror";"--warn:3";"--nowarn:20;21;1178;52"] @ bonusArgs) - |> fun cu -> - match mode with - | FSC_DEBUG -> - cu - |> withDebug - |> withNoOptimize - |> ScriptRunner.runScriptFile langVersion - |> shouldSucceed - | FSC_OPTIMIZED -> - cu - |> withOptimize - |> withNoDebug - |> ScriptRunner.runScriptFile langVersion - |> shouldSucceed - | FSI -> - cu - |> ScriptRunner.runScriptFile langVersion - |> shouldSucceed - | COMPILED_EXE_APP -> - cu - |> withDefines ("TESTS_AS_APP" :: ScriptRunner.defaultDefines) - |> compileExeAndRun - |> shouldSucceed - | NEG_TEST_BUILD testName -> diffNegativeBaseline (cu |> withName mainFile) absFolder testName langVersion - - |> ignore - - - let singleTestBuildAndRunAux folder bonusArgs mode = singleTestBuildAndRunAuxVersion folder bonusArgs mode LangVersion.Latest - let singleTestBuildAndRunVersion folder mode version = singleTestBuildAndRunAuxVersion folder [] mode version - let singleTestBuildAndRun folder mode = singleTestBuildAndRunVersion folder mode LangVersion.Latest - - let singleVersionedNegTestAux folder bonusArgs version testName = - singleTestBuildAndRunAuxVersion folder bonusArgs (NEG_TEST_BUILD testName) version - let singleVersionedNegTest (folder:string) (version:LangVersion) (testName:string) = - singleVersionedNegTestAux folder [] version testName - let singleNegTest folder testName = singleVersionedNegTest folder LangVersion.Latest testName \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedCoreTests.fs b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedCoreTests.fs deleted file mode 100644 index 562391f2b9..0000000000 --- a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedCoreTests.fs +++ /dev/null @@ -1,473 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -module FSharp.Compiler.ComponentTests.Miscellaneous.FsharpSuiteMigrated.CoreTests - -open Xunit -open FSharp.Test -open FSharp.Test.ScriptHelpers -open TestFrameworkAdapter - - -// These tests are enabled for .NET Framework and .NET Core -[] -let ``access-FSC_DEBUG``() = singleTestBuildAndRun "core/access" FSC_DEBUG - -[] -let ``access-FSC_OPTIMIZED``() = singleTestBuildAndRun "core/access" FSC_OPTIMIZED - -[] -let ``access-FSI``() = singleTestBuildAndRun "core/access" FSI - -[] -let ``apporder-FSC_DEBUG`` () = singleTestBuildAndRun "core/apporder" FSC_DEBUG - -[] -let ``apporder-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/apporder" FSC_OPTIMIZED - -[] -let ``apporder-FSI`` () = singleTestBuildAndRun "core/apporder" FSI - -[] -let ``array-FSC_DEBUG-5.0`` () = singleTestBuildAndRunVersion "core/array" FSC_DEBUG LangVersion.V50 - -[] -let ``array-FSC_OPTIMIZED-5.0`` () = singleTestBuildAndRunVersion "core/array" FSC_OPTIMIZED LangVersion.V50 - -[] -let ``array-FSI-5.0`` () = singleTestBuildAndRunVersion "core/array" FSI LangVersion.V50 - -[] -let ``array-FSC_OPTIMIZED-preview`` () = singleTestBuildAndRunVersion "core/array" FSC_OPTIMIZED LangVersion.Preview - -[] -let ``array-no-dot-FSC_DEBUG`` () = singleTestBuildAndRunVersion "core/array-no-dot" FSC_DEBUG LangVersion.Preview - -[] -let ``array-no-dot-FSC_OPTIMIZED`` () = singleTestBuildAndRunVersion "core/array-no-dot" FSC_OPTIMIZED LangVersion.Preview - -[] -let ``array-no-dot-FSI`` () = singleTestBuildAndRunVersion "core/array-no-dot" FSI LangVersion.Preview - -[] -let ``array-no-dot-warnings-langversion-default`` () = - singleVersionedNegTest "core/array-no-dot-warnings" LangVersion.Latest "test-langversion-default" - -[] -let ``array-no-dot-warnings-langversion-5_0`` () = - singleVersionedNegTest "core/array-no-dot-warnings" LangVersion.V50 "test-langversion-5.0" - -[] -let ``ref-ops-deprecation-langversion-preview`` () = - singleVersionedNegTest "core/ref-ops-deprecation" LangVersion.Preview "test-langversion-preview" - -[] -let ``auto-widen-version-5_0``() = - singleVersionedNegTest "core/auto-widen/5.0" LangVersion.V50 "test" - -[] -let ``auto-widen-version-FSC_DEBUG-preview``() = - singleTestBuildAndRunVersion "core/auto-widen/preview" FSC_DEBUG LangVersion.Preview - -[] -let ``auto-widen-version-FSC_OPTIMIZED-preview``() = - singleTestBuildAndRunVersion "core/auto-widen/preview" FSC_OPTIMIZED LangVersion.Preview - -[] -let ``auto-widen-version-preview-warns-on``() = - singleVersionedNegTestAux "core/auto-widen/preview" ["--warnon:3388";"--warnon:3389";"--warnon:3395";"--warnaserror+";"--define:NEGATIVE"] LangVersion.Preview "test" - -[] -let ``auto-widen-version-preview-default-warns``() = - singleVersionedNegTestAux "core/auto-widen/preview-default-warns" ["--warnaserror+";"--define:NEGATIVE"] LangVersion.Preview "test" - -[] -let ``comprehensions-FSC_DEBUG`` () = singleTestBuildAndRun "core/comprehensions" FSC_DEBUG - -[] -let ``comprehensions-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/comprehensions" FSC_OPTIMIZED - -[] -let ``comprehensions-FSI`` () = singleTestBuildAndRun "core/comprehensions" FSI - -[] -let ``comprehensionshw-FSC_DEBUG`` () = singleTestBuildAndRun "core/comprehensions-hw" FSC_DEBUG - -[] -let ``comprehensionshw-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/comprehensions-hw" FSC_OPTIMIZED - -[] -let ``comprehensionshw-FSI`` () = singleTestBuildAndRun "core/comprehensions-hw" FSI - -[] -let ``genericmeasures-FSC_DEBUG`` () = singleTestBuildAndRun "core/genericmeasures" FSC_DEBUG - -[] -let ``genericmeasures-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/genericmeasures" FSC_OPTIMIZED - -[] -let ``genericmeasures-FSI`` () = singleTestBuildAndRun "core/genericmeasures" FSI - -[] -let ``innerpoly-FSC_DEBUG`` () = singleTestBuildAndRun "core/innerpoly" FSC_DEBUG - -[] -let ``innerpoly-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/innerpoly" FSC_OPTIMIZED - -[] -let ``innerpoly-FSI`` () = singleTestBuildAndRun "core/innerpoly" FSI - -[] -let ``namespaceAttributes-FSC_DEBUG`` () = singleTestBuildAndRun "core/namespaces" COMPILED_EXE_APP - -[] -let ``namespaceAttributes-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/namespaces" COMPILED_EXE_APP - -[] -let ``unicode2-FSC_DEBUG`` () = singleTestBuildAndRun "core/unicode" FSC_DEBUG // TODO: fails on coreclr - -[] -let ``unicode2-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/unicode" FSC_OPTIMIZED // TODO: fails on coreclr - -[] -let ``unicode2-FSI`` () = singleTestBuildAndRun "core/unicode" FSI - -[] -let ``lazy test-FSC_DEBUG`` () = singleTestBuildAndRun "core/lazy" FSC_DEBUG - -[] -let ``lazy test-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/lazy" FSC_OPTIMIZED - -[] -let ``lazy test-FSI`` () = singleTestBuildAndRun "core/lazy" FSI - -[] -let ``letrec-FSC_DEBUG`` () = singleTestBuildAndRun "core/letrec" FSC_DEBUG - -[] -let ``letrec-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/letrec" FSC_OPTIMIZED - -[] -let ``letrec-FSI`` () = singleTestBuildAndRun "core/letrec" FSI - -[] -let ``letrec (mutrec variations part one) FSC_DEBUG`` () = singleTestBuildAndRun "core/letrec-mutrec" FSC_DEBUG - -[] -let ``letrec (mutrec variations part one) FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/letrec-mutrec" FSC_OPTIMIZED - -[] -let ``letrec (mutrec variations part one) FSI`` () = singleTestBuildAndRun "core/letrec-mutrec" FSI - -[] -let ``libtest-FSC_DEBUG`` () = singleTestBuildAndRun "core/libtest" FSC_DEBUG - -[] -let ``libtest-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/libtest" FSC_OPTIMIZED - -[] -let ``libtest-FSI`` () = singleTestBuildAndRun "core/libtest" FSI - -[] -let ``lift-FSC_DEBUG`` () = singleTestBuildAndRun "core/lift" FSC_DEBUG - -[] -let ``lift-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/lift" FSC_OPTIMIZED - -[] -let ``lift-FSI`` () = singleTestBuildAndRun "core/lift" FSI - -[] -let ``map-FSC_DEBUG`` () = singleTestBuildAndRun "core/map" FSC_DEBUG - -[] -let ``map-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/map" FSC_OPTIMIZED - -[] -let ``map-FSI`` () = singleTestBuildAndRun "core/map" FSI - -[] -let ``measures-FSC_DEBUG`` () = singleTestBuildAndRun "core/measures" FSC_DEBUG - -[] -let ``measures-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/measures" FSC_OPTIMIZED - -[] -let ``measures-FSI`` () = singleTestBuildAndRun "core/measures" FSI - -[] -let ``nested-FSC_DEBUG`` () = singleTestBuildAndRun "core/nested" FSC_DEBUG - -[] -let ``nested-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/nested" FSC_OPTIMIZED - -[] -let ``nested-FSI`` () = singleTestBuildAndRun "core/nested" FSI - -[] -let ``members-basics-hw`` () = singleTestBuildAndRun "core/members/basics-hw" FSC_OPTIMIZED - -[] -let ``members-basics-hw-mutrec`` () = singleTestBuildAndRun "core/members/basics-hw-mutrec" FSC_OPTIMIZED - -[] -let ``members-incremental-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/members/incremental" FSC_OPTIMIZED - -[] -let ``members-incremental-FSI`` () = singleTestBuildAndRun "core/members/incremental" FSI - -[] -let ``members-incremental-hw-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/members/incremental-hw" FSC_OPTIMIZED - -[] -let ``members-incremental-hw-FSI`` () = singleTestBuildAndRun "core/members/incremental-hw" FSI - -[] -let ``members-incremental-hw-mutrec-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/members/incremental-hw-mutrec" FSC_OPTIMIZED - -[] -let ``members-ops-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/members/ops" FSC_OPTIMIZED - -[] -let ``members-ops-FSC_DEBUG`` () = singleTestBuildAndRun "core/members/ops" FSC_DEBUG - -[] -let ``members-ops-FSI`` () = singleTestBuildAndRun "core/members/ops" FSI - -[] -let ``members-ops-mutrec-FSC_DEBUG`` () = singleTestBuildAndRun "core/members/ops-mutrec" FSC_DEBUG - -[] -let ``members-ops-mutrec-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/members/ops-mutrec" FSC_OPTIMIZED - -[] -let ``members-ops-mutrec-FSI`` () = singleTestBuildAndRun "core/members/ops-mutrec" FSI - -[] -let ``seq-FSC_DEBUG`` () = singleTestBuildAndRun "core/seq" FSC_DEBUG - -[] -let ``seq-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/seq" FSC_OPTIMIZED - -[] -let ``seq-FSI`` () = singleTestBuildAndRun "core/seq" FSI - -[] -let ``math-numbers-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/math/numbers" FSC_OPTIMIZED - -[] -let ``math-numbers-FSI`` () = singleTestBuildAndRun "core/math/numbers" FSI - -[] -let ``members-ctree-FSC_DEBUG`` () = singleTestBuildAndRun "core/members/ctree" FSC_DEBUG - -[] -let ``members-ctree-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/members/ctree" FSC_OPTIMIZED - -[] -let ``members-ctree-FSI`` () = singleTestBuildAndRun "core/members/ctree" FSI - -[] -let ``members-factors-FSC_DEBUG`` () = singleTestBuildAndRun "core/members/factors" FSC_DEBUG - -[] -let ``members-factors-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/members/factors" FSC_OPTIMIZED - -[] -let ``members-factors-FSI`` () = singleTestBuildAndRun "core/members/factors" FSI - -[] -let ``members-factors-mutrec-FSC_DEBUG`` () = singleTestBuildAndRun "core/members/factors-mutrec" FSC_DEBUG - -[] -let ``members-factors-mutrec-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/members/factors-mutrec" FSC_OPTIMIZED - -[] -let ``members-factors-mutrec-FSI`` () = singleTestBuildAndRun "core/members/factors-mutrec" FSI - -[] -let ``graph-FSC_DEBUG`` () = singleTestBuildAndRunVersion "perf/graph" FSC_DEBUG LangVersion.SupportsMl - -[] -let ``graph-FSC_OPTIMIZED`` () = singleTestBuildAndRunVersion "perf/graph" FSC_OPTIMIZED LangVersion.SupportsMl - -[] -let ``graph-FSI`` () = singleTestBuildAndRunVersion "perf/graph" FSI LangVersion.SupportsMl - -[] -let ``nbody-FSC_DEBUG`` () = singleTestBuildAndRunVersion "perf/nbody" FSC_DEBUG LangVersion.SupportsMl - -[] -let ``nbody-FSC_OPTIMIZED`` () = singleTestBuildAndRunVersion "perf/nbody" FSC_OPTIMIZED LangVersion.SupportsMl - -[] -let ``nbody-FSI`` () = singleTestBuildAndRunVersion "perf/nbody" FSI LangVersion.SupportsMl - -[] -let ``forexpression-FSC_DEBUG`` () = singleTestBuildAndRun "core/forexpression" FSC_DEBUG - -[] -let ``forexpression-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/forexpression" FSC_OPTIMIZED - -[] -let ``forexpression-FSI`` () = singleTestBuildAndRun "core/forexpression" FSI - -[] -let ``letrec (mutrec variations part two) FSC_DEBUG`` () = singleTestBuildAndRun "core/letrec-mutrec2" FSC_DEBUG - -[] -let ``letrec (mutrec variations part two) FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/letrec-mutrec2" FSC_OPTIMIZED - -[] -let ``letrec (mutrec variations part two) FSI`` () = singleTestBuildAndRun "core/letrec-mutrec2" FSI - -[] -let ``printf`` () = singleTestBuildAndRunVersion "core/printf" FSC_OPTIMIZED LangVersion.Preview - -[] -let ``printf-interpolated`` () = singleTestBuildAndRunVersion "core/printf-interpolated" FSC_OPTIMIZED LangVersion.Preview - -[] -let ``tlr-FSC_DEBUG`` () = singleTestBuildAndRun "core/tlr" FSC_DEBUG - -[] -let ``tlr-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/tlr" FSC_OPTIMIZED - -[] -let ``tlr-FSI`` () = singleTestBuildAndRun "core/tlr" FSI - -[] -let ``subtype-FSC_DEBUG`` () = singleTestBuildAndRun "core/subtype" FSC_DEBUG - -[] -let ``subtype-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/subtype" FSC_OPTIMIZED - -[] -let ``subtype-FSI`` () = singleTestBuildAndRun "core/subtype" FSI - -[] -let ``syntax-FSC_DEBUG`` () = singleTestBuildAndRun "core/syntax" FSC_DEBUG - -[] -let ``syntax-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/syntax" FSC_OPTIMIZED - -[] -let ``syntax-FSI`` () = singleTestBuildAndRun "core/syntax" FSI - -[] -let ``test int32-FSC_DEBUG`` () = singleTestBuildAndRun "core/int32" FSC_DEBUG - -[] -let ``test int32-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/int32" FSC_OPTIMIZED - -[] -let ``test int32-FSI`` () = singleTestBuildAndRun "core/int32" FSI - -// This test stays in FsharpSuite for desktop framework for a later migration phases, it uses hardcoded #r to a C# compiled cslib.dll inside -[] -let ``quotes-FSC-FSC_DEBUG`` () = singleTestBuildAndRun "core/quotes" FSC_DEBUG - -[] -let ``quotes-FSC-BASIC`` () = singleTestBuildAndRun "core/quotes" FSC_OPTIMIZED - -[] -let ``quotes-FSI-BASIC`` () = singleTestBuildAndRun "core/quotes" FSI - -[] -let ``recordResolution-FSC_DEBUG`` () = singleTestBuildAndRun "core/recordResolution" FSC_DEBUG - -[] -let ``recordResolution-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/recordResolution" FSC_OPTIMIZED - -[] -let ``recordResolution-FSI`` () = singleTestBuildAndRun "core/recordResolution" FSI - -// This test has hardcoded expectations about current synchronization context -// Will be moved out of FsharpSuite.Tests in a later phase for desktop framework -[] -let ``control-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/control" FSC_OPTIMIZED - -[] -let ``control-FSI`` () = singleTestBuildAndRun "core/control" FSI - -[] -let ``control --tailcalls`` () = - let cfg = "core/control" - singleTestBuildAndRunAux cfg ["--tailcalls"] FSC_OPTIMIZED - -[] -let ``controlChamenos-FSC_OPTIMIZED`` () = - let cfg = "core/controlChamenos" - singleTestBuildAndRunAux cfg ["--tailcalls"] FSC_OPTIMIZED - -[] -let ``controlChamenos-FSI`` () = - let cfg = "core/controlChamenos" - singleTestBuildAndRunAux cfg ["--tailcalls"] FSI - -[] -let ``controlMailbox-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/controlMailbox" FSC_OPTIMIZED - -[] -let ``controlMailbox-FSI`` () = singleTestBuildAndRun "core/controlMailbox" FSI - -[] -let ``controlMailbox --tailcalls`` () = - let cfg = "core/controlMailbox" - singleTestBuildAndRunAux cfg ["--tailcalls"] FSC_OPTIMIZED - -[] -let ``csext-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/csext" FSC_OPTIMIZED - -[] -let ``csext-FSI`` () = singleTestBuildAndRun "core/csext" FSI - -[] -let ``enum-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/enum" FSC_OPTIMIZED - -[] -let ``enum-FSI`` () = singleTestBuildAndRun "core/enum" FSI - -[] -let ``longnames-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/longnames" FSC_OPTIMIZED - -[] -let ``longnames-FSI`` () = singleTestBuildAndRun "core/longnames" FSI - -[] -let ``math-numbersVS2008-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/math/numbersVS2008" FSC_OPTIMIZED - -[] -let ``math-numbersVS2008-FSI`` () = singleTestBuildAndRun "core/math/numbersVS2008" FSI - -[] -let ``patterns-FSC_OPTIMIZED`` () = singleTestBuildAndRunVersion "core/patterns" FSC_OPTIMIZED LangVersion.Preview - -// This requires --multiemit on by default, which is not the case for .NET Framework -[] -let ``patterns-FSI`` () = singleTestBuildAndRun "core/patterns" FSI - -[] -let ``fsi_load-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/fsi-load" FSC_OPTIMIZED - -[] -let ``fsi_load-FSI`` () = singleTestBuildAndRun "core/fsi-load" FSI - -[] -let ``reflect-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/reflect" FSC_OPTIMIZED - -[] -let ``reflect-FSI`` () = singleTestBuildAndRun "core/reflect" FSI - -module PInvokeTests = - open System.Runtime.InteropServices - let isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) - - [] - let ``pinvoke-FSC_OPTIMIZED`` () = - if isWindows then - singleTestBuildAndRun "core/pinvoke" FSC_OPTIMIZED - - [] - let ``pinvoke-FSI`` () = - if isWindows then - singleTestBuildAndRun "core/pinvoke" FSI \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedOverloadTests.fs b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedOverloadTests.fs deleted file mode 100644 index 55286a6a65..0000000000 --- a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedOverloadTests.fs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -module FSharp.Compiler.ComponentTests.Miscellaneous.FsharpSuiteMigrated.OverloadResolution - -open Xunit -open FSharp.Test -open TestFrameworkAdapter - -module ``fsharpqa migrated tests`` = - let [] ``Conformance\Expressions\SyntacticSugar (E_Slices01_fs)`` () = singleNegTest ( "conformance/expressions/syntacticsugar") "E_Slices01" - let [] ``Conformance\Expressions\Type-relatedExpressions (E_RigidTypeAnnotation03_fsx)`` () = singleNegTest ( "conformance/expressions/type-relatedexpressions") "E_RigidTypeAnnotation03" - let [] ``Conformance\Inference (E_OneTypeVariable03_fs)`` () = singleNegTest ( "conformance/inference") "E_OneTypeVariable03" - let [] ``Conformance\Inference (E_OneTypeVariable03rec_fs)`` () = singleNegTest ( "conformance/inference") "E_OneTypeVariable03rec" - let [] ``Conformance\Inference (E_TwoDifferentTypeVariablesGen00_fs)`` () = singleNegTest ( "conformance/inference") "E_TwoDifferentTypeVariablesGen00" - let [] ``Conformance\Inference (E_TwoDifferentTypeVariables01_fs)`` () = singleNegTest ( "conformance/inference") "E_TwoDifferentTypeVariables01" - let [] ``Conformance\Inference (E_TwoDifferentTypeVariables01rec_fs)`` () = singleNegTest ( "conformance/inference") "E_TwoDifferentTypeVariables01rec" - let [] ``Conformance\Inference (E_TwoDifferentTypeVariablesGen00rec_fs)`` () = singleNegTest ( "conformance/inference") "E_TwoDifferentTypeVariablesGen00rec" - let [] ``Conformance\Inference (E_TwoEqualTypeVariables02_fs)`` () = singleNegTest ( "conformance/inference") "E_TwoEqualTypeVariables02" - let [] ``Conformance\Inference (E_TwoEqualYypeVariables02rec_fs)`` () = singleNegTest ( "conformance/inference") "E_TwoEqualYypeVariables02rec" - let [] ``Conformance\Inference (E_LeftToRightOverloadResolution01_fs)`` () = singleNegTest ( "conformance/inference") "E_LeftToRightOverloadResolution01" - let [] ``Conformance\WellFormedness (E_Clashing_Values_in_AbstractClass01_fs)`` () = singleNegTest ( "conformance/wellformedness") "E_Clashing_Values_in_AbstractClass01" - let [] ``Conformance\WellFormedness (E_Clashing_Values_in_AbstractClass03_fs)`` () = singleNegTest ( "conformance/wellformedness") "E_Clashing_Values_in_AbstractClass03" - let [] ``Conformance\WellFormedness (E_Clashing_Values_in_AbstractClass04_fs)`` () = singleNegTest ( "conformance/wellformedness") "E_Clashing_Values_in_AbstractClass04" - // note: this test still exist in fsharpqa to assert the compiler doesn't crash - // the part of the code generating a flaky error due to https://github.com/dotnet/fsharp/issues/6725 - // is elided here to focus on overload resolution error messages - let [] ``Conformance\LexicalAnalysis\SymbolicOperators (E_LessThanDotOpenParen001_fs)`` () = singleNegTest ( "conformance/lexicalanalysis") "E_LessThanDotOpenParen001" - -module ``error messages using BCL``= - let [] ``neg_System_Convert_ToString_OverloadList``() = singleNegTest ( "typecheck/overloads") "neg_System.Convert.ToString.OverloadList" - let [] ``neg_System_Threading_Tasks_Task_Run_OverloadList``() = singleNegTest ( "typecheck/overloads") "neg_System.Threading.Tasks.Task.Run.OverloadList" - let [] ``neg_System_Drawing_Graphics_DrawRectangleOverloadList_fsx``() = singleNegTest ( "typecheck/overloads") "neg_System.Drawing.Graphics.DrawRectangleOverloadList" - -module ``ad hoc code overload error messages``= - let [] ``neg_many_many_overloads`` () = singleNegTest ( "typecheck/overloads") "neg_many_many_overloads" - let [] ``neg_interface_generics`` () = singleNegTest ( "typecheck/overloads") "neg_interface_generics" - let [] ``neg_known_return_type_and_known_type_arguments`` () = singleNegTest ( "typecheck/overloads") "neg_known_return_type_and_known_type_arguments" - let [] ``neg_generic_known_argument_types`` () = singleNegTest ( "typecheck/overloads") "neg_generic_known_argument_types" - let [] ``neg_tupled_arguments`` () = singleNegTest ( "typecheck/overloads") "neg_tupled_arguments" \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedTypeCheckTests.fs b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedTypeCheckTests.fs deleted file mode 100644 index 09a287838b..0000000000 --- a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedTypeCheckTests.fs +++ /dev/null @@ -1,501 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -module FSharp.Compiler.ComponentTests.Miscellaneous.FsharpSuiteMigrated.TypeCheckTests - -open Xunit -open FSharp.Test -open FSharp.Test.ScriptHelpers -open TestFrameworkAdapter - -[] -let misc () = singleTestBuildAndRunVersion "typecheck/misc" FSC_OPTIMIZED LangVersion.SupportsMl - -[] -let ``type check neg01`` () = singleNegTest ( "typecheck/sigs") "neg01" - -[] -let ``type check neg02`` () = singleVersionedNegTest ( "typecheck/sigs") LangVersion.V60 "neg02" - -[] -let ``type check neg03`` () = singleVersionedNegTest ( "typecheck/sigs") LangVersion.SupportsMl "neg03" - -[] -let ``type check neg04`` () = singleNegTest ( "typecheck/sigs") "neg04" - -[] -let ``type check neg05`` () = singleNegTest ( "typecheck/sigs") "neg05" - -[] -let ``type check neg06`` () = singleNegTest ( "typecheck/sigs") "neg06" - -[] -let ``type check neg06_a`` () = singleNegTest ( "typecheck/sigs") "neg06_a" - -[] -let ``type check neg06_b`` () = singleNegTest ( "typecheck/sigs") "neg06_b" - -[] -let ``type check neg07`` () = singleNegTest ( "typecheck/sigs") "neg07" - -[] -let ``type check neg08`` () = singleNegTest ( "typecheck/sigs") "neg08" - -[] -let ``type check neg09`` () = singleNegTest ( "typecheck/sigs") "neg09" - -[] -let ``type check neg10`` () = singleNegTest ( "typecheck/sigs") "neg10" - -[] -let ``type check neg10_a`` () = singleNegTest ( "typecheck/sigs") "neg10_a" - -[] -let ``type check neg11`` () = singleNegTest ( "typecheck/sigs") "neg11" - -[] -let ``type check neg12`` () = singleNegTest ( "typecheck/sigs") "neg12" - -[] -let ``type check neg13`` () = singleNegTest ( "typecheck/sigs") "neg13" - -[] -let ``type check neg14`` () = singleNegTest ( "typecheck/sigs") "neg14" - -[] -let ``type check neg15`` () = singleNegTest ( "typecheck/sigs") "neg15" - -[] -let ``type check neg16`` () = singleNegTest ( "typecheck/sigs") "neg16" - -[] -let ``type check neg17`` () = singleNegTest ( "typecheck/sigs") "neg17" - -[] -let ``type check neg18`` () = singleNegTest ( "typecheck/sigs") "neg18" - -[] -let ``type check neg19`` () = singleNegTest ( "typecheck/sigs") "neg19" - -[] -let ``type check neg20`` () = singleNegTest ( "typecheck/sigs") "neg20" - -[] -let ``type check neg20 version 5_0`` () = - let cfg = "typecheck/sigs/version50" - singleVersionedNegTest cfg LangVersion.V50 "neg20" - -[] -let ``type check neg21`` () = singleNegTest ( "typecheck/sigs") "neg21" - -[] -let ``type check neg23`` () = singleNegTest ( "typecheck/sigs") "neg23" - - -[] -let ``type check neg25`` () = singleNegTest ( "typecheck/sigs") "neg25" - -[] -let ``type check neg26`` () = singleNegTest ( "typecheck/sigs") "neg26" - -[] -let ``type check neg27`` () = singleNegTest ( "typecheck/sigs") "neg27" - -[] -let ``type check neg28`` () = singleNegTest ( "typecheck/sigs") "neg28" - -[] -let ``type check neg29`` () = singleNegTest ( "typecheck/sigs") "neg29" - -[] -let ``type check neg30`` () = singleNegTest ( "typecheck/sigs") "neg30" - -[] -let ``type check neg31`` () = singleNegTest ( "typecheck/sigs") "neg31" - -[] -let ``type check neg32`` () = singleNegTest ( "typecheck/sigs") "neg32" - -[] -let ``type check neg33`` () = singleNegTest ( "typecheck/sigs") "neg33" - -[] -let ``type check neg34`` () = singleNegTest ( "typecheck/sigs") "neg34" - -[] -let ``type check neg35`` () = singleNegTest ( "typecheck/sigs") "neg35" - -[] -let ``type check neg36`` () = singleNegTest ( "typecheck/sigs") "neg36" - -[] -let ``type check neg37`` () = singleNegTest ( "typecheck/sigs") "neg37" - -[] -let ``type check neg37_a`` () = singleNegTest ( "typecheck/sigs") "neg37_a" - -[] -let ``type check neg38`` () = singleNegTest ( "typecheck/sigs") "neg38" - -[] -let ``type check neg39`` () = singleNegTest ( "typecheck/sigs") "neg39" - -[] -let ``type check neg40`` () = singleNegTest ( "typecheck/sigs") "neg40" - -[] -let ``type check neg41`` () = singleNegTest ( "typecheck/sigs") "neg41" - -[] -let ``type check neg42`` () = singleNegTest ( "typecheck/sigs") "neg42" - -[] -let ``type check neg43`` () = singleNegTest ( "typecheck/sigs") "neg43" - -[] -let ``type check neg44`` () = singleNegTest ( "typecheck/sigs") "neg44" - -#if !DEBUG // requires release version of compiler to avoid very deep stacks -[] -let ``type check neg45`` () = singleNegTest ( "typecheck/sigs") "neg45" -#endif - -[] -let ``type check neg46`` () = singleNegTest ( "typecheck/sigs") "neg46" - -[] -let ``type check neg47`` () = singleNegTest ( "typecheck/sigs") "neg47" - -[] -let ``type check neg48`` () = singleNegTest ( "typecheck/sigs") "neg48" - -[] -let ``type check neg49`` () = singleNegTest ( "typecheck/sigs") "neg49" - -[] -let ``type check neg50`` () = singleNegTest ( "typecheck/sigs") "neg50" - -[] -let ``type check neg51`` () = singleNegTest ( "typecheck/sigs") "neg51" - -[] -let ``type check neg52`` () = singleNegTest ( "typecheck/sigs") "neg52" - -[] -let ``type check neg53`` () = singleNegTest ( "typecheck/sigs") "neg53" - -[] -let ``type check neg54`` () = singleNegTest ( "typecheck/sigs") "neg54" - -[] -let ``type check neg55`` () = singleNegTest ( "typecheck/sigs") "neg55" - -[] -let ``type check neg56`` () = singleNegTest ( "typecheck/sigs") "neg56" - -[] -let ``type check neg56_a`` () = singleNegTest ( "typecheck/sigs") "neg56_a" - -[] -let ``type check neg56_b`` () = singleNegTest ( "typecheck/sigs") "neg56_b" - -[] -let ``type check neg57`` () = singleNegTest ( "typecheck/sigs") "neg57" - -[] -let ``type check neg58`` () = singleNegTest ( "typecheck/sigs") "neg58" - -[] -let ``type check neg59`` () = singleNegTest ( "typecheck/sigs") "neg59" - -[] -let ``type check neg60`` () = singleNegTest ( "typecheck/sigs") "neg60" - -[] -let ``type check neg61`` () = singleNegTest ( "typecheck/sigs") "neg61" - -[] -let ``type check neg62`` () = singleNegTest ( "typecheck/sigs") "neg62" - -[] -let ``type check neg63`` () = singleNegTest ( "typecheck/sigs") "neg63" - -[] -let ``type check neg64`` () = singleNegTest ( "typecheck/sigs") "neg64" - -[] -let ``type check neg65`` () = singleNegTest ( "typecheck/sigs") "neg65" - -[] -let ``type check neg66`` () = singleNegTest ( "typecheck/sigs") "neg66" - -[] -let ``type check neg67`` () = singleNegTest ( "typecheck/sigs") "neg67" - -[] -let ``type check neg68`` () = singleNegTest ( "typecheck/sigs") "neg68" - -[] -let ``type check neg69`` () = singleNegTest ( "typecheck/sigs") "neg69" - -[] -let ``type check neg70`` () = singleNegTest ( "typecheck/sigs") "neg70" - -[] -let ``type check neg71`` () = singleNegTest ( "typecheck/sigs") "neg71" - -[] -let ``type check neg72`` () = singleNegTest ( "typecheck/sigs") "neg72" - -[] -let ``type check neg73`` () = singleNegTest ( "typecheck/sigs") "neg73" - -[] -let ``type check neg74`` () = singleNegTest ( "typecheck/sigs") "neg74" - -[] -let ``type check neg75`` () = singleNegTest ( "typecheck/sigs") "neg75" - -[] -let ``type check neg76`` () = singleNegTest ( "typecheck/sigs") "neg76" - -[] -let ``type check neg77`` () = singleNegTest ( "typecheck/sigs") "neg77" - -[] -let ``type check neg78`` () = singleNegTest ( "typecheck/sigs") "neg78" - -[] -let ``type check neg79`` () = singleNegTest ( "typecheck/sigs") "neg79" - -[] -let ``type check neg80`` () = singleNegTest ( "typecheck/sigs") "neg80" - -[] -let ``type check neg81`` () = singleNegTest ( "typecheck/sigs") "neg81" - -[] -let ``type check neg82`` () = singleNegTest ( "typecheck/sigs") "neg82" - -[] -let ``type check neg83`` () = singleNegTest ( "typecheck/sigs") "neg83" - -[] -let ``type check neg84`` () = singleNegTest ( "typecheck/sigs") "neg84" - -[] -let ``type check neg85`` () = singleNegTest ( "typecheck/sigs") "neg85" - -[] -let ``type check neg86`` () = singleNegTest ( "typecheck/sigs") "neg86" - -[] -let ``type check neg88`` () = singleNegTest ( "typecheck/sigs") "neg88" - -[] -let ``type check neg89`` () = singleNegTest ( "typecheck/sigs") "neg89" - -[] -let ``type check neg90`` () = singleNegTest ( "typecheck/sigs") "neg90" - -[] -let ``type check neg91`` () = singleNegTest ( "typecheck/sigs") "neg91" - -[] -let ``type check neg92`` () = singleNegTest ( "typecheck/sigs") "neg92" - -[] -let ``type check neg93`` () = singleNegTest ( "typecheck/sigs") "neg93" - -[] -let ``type check neg94`` () = singleNegTest ( "typecheck/sigs") "neg94" - -[] -let ``type check neg95`` () = singleNegTest ( "typecheck/sigs") "neg95" - -[] -let ``type check neg96`` () = singleNegTest ( "typecheck/sigs") "neg96" - -[] -let ``type check neg97`` () = singleNegTest ( "typecheck/sigs") "neg97" - -[] -let ``type check neg98`` () = singleNegTest ( "typecheck/sigs") "neg98" - -[] -let ``type check neg99`` () = singleNegTest ( "typecheck/sigs") "neg99" - -[] -let ``type check neg100`` () = singleVersionedNegTestAux "typecheck/sigs" ["--warnon:3218" ] LangVersion.Latest "neg100" - -[] -let ``type check neg101`` () = singleNegTest ( "typecheck/sigs") "neg101" - -[] -let ``type check neg102`` () = singleNegTest ( "typecheck/sigs") "neg102" - -[] -let ``type check neg103`` () = singleNegTest ( "typecheck/sigs") "neg103" - -[] -let ``type check neg104`` () = singleNegTest ( "typecheck/sigs") "neg104" - -[] -let ``type check neg106`` () = singleNegTest ( "typecheck/sigs") "neg106" - -[] -let ``type check neg107`` () = singleNegTest ( "typecheck/sigs") "neg107" - -[] -let ``type check neg108`` () = singleNegTest ( "typecheck/sigs") "neg108" - -[] -let ``type check neg109`` () = singleNegTest ( "typecheck/sigs") "neg109" - -[] -let ``type check neg110`` () = singleNegTest ( "typecheck/sigs") "neg110" - -[] -let ``type check neg111`` () = singleNegTest ( "typecheck/sigs") "neg111" - -[] -let ``type check neg112`` () = singleNegTest ( "typecheck/sigs") "neg112" - -[] -let ``type check neg113`` () = singleNegTest ( "typecheck/sigs") "neg113" - -[] -let ``type check neg114`` () = singleNegTest ( "typecheck/sigs") "neg114" - -[] -let ``type check neg115`` () = singleNegTest ( "typecheck/sigs") "neg115" - -[] -let ``type check neg116`` () = singleNegTest ( "typecheck/sigs") "neg116" - -[] -let ``type check neg117`` () = singleNegTest ( "typecheck/sigs") "neg117" - -[] -let ``type check neg118`` () = singleNegTest ( "typecheck/sigs") "neg118" - -[] -let ``type check neg119a`` () = singleVersionedNegTest ( "typecheck/sigs") LangVersion.V60 "neg119a" - -[] -let ``type check neg119b`` () = singleVersionedNegTest ( "typecheck/sigs") LangVersion.V70 "neg119b" - -[] -let ``type check neg120`` () = singleNegTest ( "typecheck/sigs") "neg120" - -[] -let ``type check neg121`` () = singleNegTest ( "typecheck/sigs") "neg121" - -[] -let ``type check neg122`` () = singleNegTest ( "typecheck/sigs") "neg122" - -[] -let ``type check neg123`` () = singleNegTest ( "typecheck/sigs") "neg123" - -[] -let ``type check neg124`` () = singleNegTest ( "typecheck/sigs") "neg124" - -[] -let ``type check neg125`` () = singleNegTest ( "typecheck/sigs") "neg125" - -[] -let ``type check neg126`` () = singleNegTest ( "typecheck/sigs") "neg126" - -[] -let ``type check neg127`` () = singleNegTest ( "typecheck/sigs") "neg127" - -[] -let ``type check neg128`` () = singleNegTest ( "typecheck/sigs") "neg128" - -[] -let ``type check neg129`` () = singleNegTest ( "typecheck/sigs") "neg129" - -[] -let ``type check neg130`` () = singleNegTest ( "typecheck/sigs") "neg130" - -[] -let ``type check neg131`` () = singleVersionedNegTest ( "typecheck/sigs") LangVersion.V60 "neg131" - -[] -let ``type check neg132`` () = singleVersionedNegTest ( "typecheck/sigs") LangVersion.V50 "neg132" - -[] -let ``type check neg133`` () = singleNegTest ( "typecheck/sigs") "neg133" - -[] -let ``type check neg_anon_1`` () = singleNegTest ( "typecheck/sigs") "neg_anon_1" - -[] -let ``type check neg_anon_2`` () = singleNegTest ( "typecheck/sigs") "neg_anon_2" - -[] -let ``type check neg_issue_3752`` () = singleNegTest ( "typecheck/sigs") "neg_issue_3752" - -[] -let ``type check neg_byref_1`` () = singleNegTest ( "typecheck/sigs") "neg_byref_1" - -[] -let ``type check neg_byref_2`` () = singleNegTest ( "typecheck/sigs") "neg_byref_2" - -[] -let ``type check neg_byref_3`` () = singleNegTest ( "typecheck/sigs") "neg_byref_3" - -[] -let ``type check neg_byref_4`` () = singleNegTest ( "typecheck/sigs") "neg_byref_4" - -[] -let ``type check neg_byref_5`` () = singleNegTest ( "typecheck/sigs") "neg_byref_5" - -[] -let ``type check neg_byref_6`` () = singleNegTest ( "typecheck/sigs") "neg_byref_6" - -[] -let ``type check neg_byref_7`` () = singleNegTest ( "typecheck/sigs") "neg_byref_7" - -[] -let ``type check neg_byref_8`` () = singleNegTest ( "typecheck/sigs") "neg_byref_8" - -[] -let ``type check neg_byref_10`` () = singleNegTest ( "typecheck/sigs") "neg_byref_10" - -[] -let ``type check neg_byref_11`` () = singleNegTest ( "typecheck/sigs") "neg_byref_11" - -[] -let ``type check neg_byref_12`` () = singleNegTest ( "typecheck/sigs") "neg_byref_12" - -[] -let ``type check neg_byref_13`` () = singleNegTest ( "typecheck/sigs") "neg_byref_13" - -[] -let ``type check neg_byref_14`` () = singleNegTest ( "typecheck/sigs") "neg_byref_14" - -[] -let ``type check neg_byref_15`` () = singleNegTest ( "typecheck/sigs") "neg_byref_15" - -[] -let ``type check neg_byref_16`` () = singleNegTest ( "typecheck/sigs") "neg_byref_16" - -[] -let ``type check neg_byref_17`` () = singleNegTest ( "typecheck/sigs") "neg_byref_17" - -[] -let ``type check neg_byref_18`` () = singleNegTest ( "typecheck/sigs") "neg_byref_18" - -[] -let ``type check neg_byref_19`` () = singleNegTest ( "typecheck/sigs") "neg_byref_19" - -[] -let ``type check neg_byref_20`` () = singleNegTest ( "typecheck/sigs") "neg_byref_20" - -[] -let ``type check neg_byref_21`` () = singleNegTest ( "typecheck/sigs") "neg_byref_21" - -[] -let ``type check neg_byref_22`` () = singleNegTest ( "typecheck/sigs") "neg_byref_22" - -[] -let ``type check neg_byref_23`` () = singleNegTest ( "typecheck/sigs") "neg_byref_23" \ No newline at end of file diff --git a/tests/FSharp.Test.Utilities/Assert.fs b/tests/FSharp.Test.Utilities/Assert.fs index dfed4bf123..41af78c735 100644 --- a/tests/FSharp.Test.Utilities/Assert.fs +++ b/tests/FSharp.Test.Utilities/Assert.fs @@ -3,8 +3,6 @@ namespace FSharp.Test module Assert = open FluentAssertions open System.Collections - open System.Text - open System.IO let inline shouldBeEqualWith (expected : ^T) (message: string) (actual: ^U) = actual.Should().BeEquivalentTo(expected, message) |> ignore @@ -26,41 +24,3 @@ module Assert = let shouldBeTrue (actual: bool) = actual.Should().BeTrue("") |> ignore - - let shouldBeSameMultilineStringSets expectedText actualText = - - let getLines text = - use reader = new StringReader(text) - Seq.initInfinite (fun _ -> reader.ReadLine()) - |> Seq.takeWhile (not << isNull) - |> set - let actual = getLines actualText - let expected = getLines expectedText - - let unexpectedlyMissing = Set.difference expected actual - let unexpectedlyPresent = Set.difference actual expected - - // If both sets are empty, the surface areas match so allow the test to pass. - if Set.isEmpty unexpectedlyMissing - && Set.isEmpty unexpectedlyPresent then - None - else - let msg = - let inline newLine (sb : System.Text.StringBuilder) = sb.AppendLine () |> ignore - let sb = System.Text.StringBuilder () - sb.Append "Unexpectedly missing (expected, not actual):" |> ignore - for s in unexpectedlyMissing do - newLine sb - sb.Append " " |> ignore - sb.Append s |> ignore - newLine sb - newLine sb - sb.Append "Unexpectedly present (actual, not expected):" |> ignore - for s in unexpectedlyPresent do - newLine sb - sb.Append " " |> ignore - sb.Append s |> ignore - newLine sb - sb.ToString () - - Some msg diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index add7030463..74250c83cd 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -144,9 +144,7 @@ module rec Compiler = type ErrorInfo = { Error: ErrorType Range: Range - NativeRange : FSharp.Compiler.Text.range - Message: string - SubCategory: string } + Message: string } type ExecutionOutput = { ExitCode: int @@ -157,16 +155,13 @@ module rec Compiler = | EvalOutput of Result | ExecutionOutput of ExecutionOutput - type SourceCodeFileName = string - type CompilationOutput = - { OutputPath: string option - Dependencies: string list - Adjust: int - Diagnostics: ErrorInfo list - PerFileErrors: (SourceCodeFileName * ErrorInfo) list - Output: RunOutput option - Compilation: CompilationUnit } + { OutputPath: string option + Dependencies: string list + Adjust: int + Diagnostics: ErrorInfo list + Output: RunOutput option + Compilation: CompilationUnit } [] type CompilationResult = @@ -222,21 +217,14 @@ module rec Compiler = References = [] } - let private fromFSharpDiagnostic (errors: FSharpDiagnostic[]) : (SourceCodeFileName * ErrorInfo) list = - let toErrorInfo (e: FSharpDiagnostic) : SourceCodeFileName * ErrorInfo = + let private fromFSharpDiagnostic (errors: FSharpDiagnostic[]) : ErrorInfo list = + let toErrorInfo (e: FSharpDiagnostic) : ErrorInfo = let errorNumber = e.ErrorNumber let severity = e.Severity - let error = - match severity with - | FSharpDiagnosticSeverity.Warning -> Warning errorNumber - | FSharpDiagnosticSeverity.Error -> Error errorNumber - | FSharpDiagnosticSeverity.Info -> Information errorNumber - | FSharpDiagnosticSeverity.Hidden -> Hidden errorNumber - - e.FileName |> Path.GetFileName, + + let error = if severity = FSharpDiagnosticSeverity.Warning then Warning errorNumber else Error errorNumber + { Error = error - NativeRange = e.Range - SubCategory = e.Subcategory Range = { StartLine = e.StartLine StartColumn = e.StartColumn @@ -246,7 +234,7 @@ module rec Compiler = errors |> List.ofArray - |> List.distinctBy (fun e -> e.FileName,e.Severity, e.ErrorNumber, e.StartLine, e.StartColumn, e.EndLine, e.EndColumn, e.Message) + |> List.distinctBy (fun e -> e.Severity, e.ErrorNumber, e.StartLine, e.StartColumn, e.EndLine, e.EndColumn, e.Message) |> List.map toErrorInfo let private partitionErrors diagnostics = diagnostics |> List.partition (fun e -> match e.Error with Error _ -> true | _ -> false) @@ -256,7 +244,7 @@ module rec Compiler = let private getWarnings diagnostics = diagnostics |> List.filter (fun e -> match e.Error with Warning _ -> true | _ -> false) let private adjustRange (range: Range) (adjust: int) : Range = - { range with + { StartLine = range.StartLine - adjust StartColumn = range.StartColumn + 1 EndLine = range.EndLine - adjust @@ -418,14 +406,14 @@ module rec Compiler = let withLangVersionPreview (cUnit: CompilationUnit) : CompilationUnit = withOptionsHelper [ "--langversion:preview" ] "withLangVersionPreview is only supported on F#" cUnit - + let withLangVersion (version: string) (cUnit: CompilationUnit) : CompilationUnit = withOptionsHelper [ $"--langversion:{version}" ] "withLangVersion is only supported on F#" cUnit let withAssemblyVersion (version:string) (cUnit: CompilationUnit) : CompilationUnit = withOptionsHelper [ $"--version:{version}" ] "withAssemblyVersion is only supported on F#" cUnit - let withWarnOn (cUnit: CompilationUnit) warning : CompilationUnit = + let withWarnOn (warning : int) (cUnit: CompilationUnit) : CompilationUnit = withOptionsHelper [ $"--warnon:{warning}" ] "withWarnOn is only supported for F#" cUnit let withNoWarn warning (cUnit: CompilationUnit) : CompilationUnit = @@ -578,15 +566,14 @@ module rec Compiler = let diagnostics = err |> fromFSharpDiagnostic let result = - { OutputPath = None - Dependencies = deps - Adjust = 0 - PerFileErrors = diagnostics - Diagnostics = diagnostics |> List.map snd - Output = None - Compilation = cUnit } + { OutputPath = None + Dependencies = deps + Adjust = 0 + Diagnostics = diagnostics + Output = None + Compilation = cUnit } - let (errors, warnings) = partitionErrors result.Diagnostics + let (errors, warnings) = partitionErrors diagnostics // Treat warnings as errors if "IgnoreWarnings" is false if errors.Length > 0 || (warnings.Length > 0 && not ignoreWarnings) then @@ -623,8 +610,6 @@ module rec Compiler = StartColumn = span.Start.Character EndLine = span.End.Line EndColumn = span.End.Character } - NativeRange = Unchecked.defaultof<_> - SubCategory = "" Message = d.GetMessage() } let private compileCSharpCompilation (compilation: CSharpCompilation) csSource (filePath : string) dependencies : CompilationResult = @@ -634,7 +619,6 @@ module rec Compiler = Dependencies = dependencies Adjust = 0 Diagnostics = cmplResult.Diagnostics |> Seq.map toErrorInfo |> Seq.toList - PerFileErrors= List.empty // Not needed for C# testing for now. Implement when needed Output = None Compilation = CS csSource } @@ -734,8 +718,7 @@ module rec Compiler = { OutputPath = None Dependencies = [] Adjust = 0 - Diagnostics = diagnostics |> List.map snd - PerFileErrors= diagnostics + Diagnostics = diagnostics Output = None Compilation = FS fsSource } @@ -765,11 +748,10 @@ module rec Compiler = { OutputPath = None Dependencies = [] Adjust = 0 - Diagnostics = diagnostics |> List.map snd - PerFileErrors= diagnostics + Diagnostics = diagnostics Output = None Compilation = FS fsSource } - let (errors, warnings) = partitionErrors result.Diagnostics + let (errors, warnings) = partitionErrors diagnostics // Treat warnings as errors if "IgnoreWarnings" is false; if errors.Length > 0 || (warnings.Length > 0 && not fsSource.IgnoreWarnings) then @@ -815,38 +797,24 @@ module rec Compiler = let compileExeAndRun = asExe >> compileAndRun - let private processScriptResults fs (evalResult: Result, err: FSharpDiagnostic[]) = - let perFileDiagnostics = err |> fromFSharpDiagnostic - let diagnostics = perFileDiagnostics |> List.map snd - let (errors, warnings) = partitionErrors diagnostics + let private evalFSharp (fs: FSharpCompilationSource) (script:FSharpScript) : CompilationResult = + let source = fs.Source.GetSourceText |> Option.defaultValue "" + let (evalResult: Result), (err: FSharpDiagnostic[]) = script.Eval(source) + let diagnostics = err |> fromFSharpDiagnostic let result = { OutputPath = None Dependencies = [] Adjust = 0 - Diagnostics = if fs.IgnoreWarnings then errors else diagnostics - PerFileErrors = perFileDiagnostics + Diagnostics = diagnostics Output = Some (EvalOutput evalResult) Compilation = FS fs } - + + let (errors, warnings) = partitionErrors diagnostics let evalError = match evalResult with Ok _ -> false | _ -> true - if evalError || errors.Length > 0 || (warnings.Length > 0 && not fs.IgnoreWarnings) then + if evalError || errors.Length > 0 || (warnings.Length > 0 && not fs.IgnoreWarnings) then CompilationResult.Failure result else CompilationResult.Success result - - - let private evalFSharp (fs: FSharpCompilationSource) (script:FSharpScript) : CompilationResult = - let source = fs.Source.GetSourceText |> Option.defaultValue "" - script.Eval(source) |> (processScriptResults fs) - - let private evalScriptFromDisk (fs: FSharpCompilationSource) (script:FSharpScript) : CompilationResult = - let fileNames = - (fs.Source :: fs.AdditionalSources) - |> List.map (fun x -> x.GetSourceFileName) - |> List.map (sprintf " @\"%s\"") - |> String.Concat - - script.Eval("#load" + fileNames ) |> (processScriptResults fs) let eval (cUnit: CompilationUnit) : CompilationResult = match cUnit with @@ -856,18 +824,13 @@ module rec Compiler = evalFSharp fs script | _ -> failwith "Script evaluation is only supported for F#." - let getSessionForEval args version = new FSharpScript(additionalArgs=args,quiet=false,langVersion=version) + let getSessionForEval () = new FSharpScript() let evalInSharedSession (script:FSharpScript) (cUnit: CompilationUnit) : CompilationResult = match cUnit with | FS fs -> evalFSharp fs script | _ -> failwith "Script evaluation is only supported for F#." - let evalScriptFromDiskInSharedSession (script:FSharpScript) (cUnit: CompilationUnit) : CompilationResult = - match cUnit with - | FS fs -> evalScriptFromDisk fs script - | _ -> failwith "Script evaluation is only supported for F#." - let runFsi (cUnit: CompilationUnit) : CompilationResult = match cUnit with | FS fs -> @@ -906,7 +869,6 @@ module rec Compiler = Dependencies = [] Adjust = 0 Diagnostics = [] - PerFileErrors= [] Output = None Compilation = cUnit } @@ -1143,7 +1105,7 @@ module rec Compiler = failwith $"PDB file does not exists: {pdbPath}" | _ -> failwith "Output path is not set, please make sure compilation was successfull." match result with - | CompilationResult.Success r -> verifyPdbExists r + | CompilationResult.Success r -> verifyPdbExists r | _ -> failwith "Result should be \"Success\" in order to verify PDB." let verifyNoPdb (result: CompilationResult): unit = @@ -1155,7 +1117,7 @@ module rec Compiler = failwith $"PDB file exists: {pdbPath}" | _ -> failwith "Output path is not set, please make sure compilation was successfull." match result with - | CompilationResult.Success r -> verifyPdbNotExists r + | CompilationResult.Success r -> verifyPdbNotExists r | _ -> failwith "Result should be \"Success\" in order to verify PDB." [] @@ -1233,7 +1195,7 @@ module rec Compiler = | Some (EvalOutput (Result.Error exn) ) -> sprintf "----script error-----\n%s\n----------" (exn.ToString()) | Some (EvalOutput (Result.Ok fsiVal) ) -> - sprintf "----script output-----\n%A\n----------" (fsiVal) + sprintf "----script output-----\n%A\n----------" (fsiVal) | _ -> () ] |> String.concat "\n" failwith message @@ -1250,11 +1212,11 @@ module rec Compiler = assertErrors what r.Adjust (selector r) expected result - let private withResultsIgnoreNativeRange (expectedResults: ErrorInfo list) result : CompilationResult = + let withResults (expectedResults: ErrorInfo list) result : CompilationResult = assertResultsCategory "Results" (fun r -> r.Diagnostics) expectedResults result - let private withResultIgnoreNativeRange (expectedResult: ErrorInfo ) (result: CompilationResult) : CompilationResult = - withResultsIgnoreNativeRange [expectedResult] result + let withResult (expectedResult: ErrorInfo ) (result: CompilationResult) : CompilationResult = + withResults [expectedResult] result let withDiagnostics (expected: (ErrorType * Line * Col * Line * Col * string) list) (result: CompilationResult) : CompilationResult = let expectedResults: ErrorInfo list = @@ -1266,10 +1228,8 @@ module rec Compiler = StartColumn = startCol EndLine = endLine EndColumn = endCol } - NativeRange = Unchecked.defaultof<_> - SubCategory = "" Message = message } ] - withResultsIgnoreNativeRange expectedResults result + withResults expectedResults result let withSingleDiagnostic (expected: (ErrorType * Line * Col * Line * Col * string)) (result: CompilationResult) : CompilationResult = withDiagnostics [expected] result @@ -1280,64 +1240,6 @@ module rec Compiler = let withError (expectedError: ErrorInfo) (result: CompilationResult) : CompilationResult = withErrors [expectedError] result - module StructuredResultsAsserts = - type SimpleErrorInfo = - { Error: ErrorType - Range: Range - Message: string } - - let withResults (expectedResults: SimpleErrorInfo list) result : CompilationResult = - let mappedResults = expectedResults |> List.map (fun s -> { Error = s.Error;Range = s.Range; Message = s.Message; NativeRange = Unchecked.defaultof<_>; SubCategory = ""}) - Compiler.Assertions.withResultsIgnoreNativeRange mappedResults result - - let withResult (expectedResult: SimpleErrorInfo ) (result: CompilationResult) : CompilationResult = - withResults [expectedResult] result - - - - module TextBasedDiagnosticAsserts = - open FSharp.Compiler.Text.Range - - let private messageAndNumber errorType= - match errorType with - | ErrorType.Error n -> "error",n - | ErrorType.Warning n-> "warning",n - | ErrorType.Hidden n - | ErrorType.Information n-> "info",n - - let normalizeNewLines (s:string) = s.Replace("\r\n","\n").Replace("\n",Environment.NewLine) - - let private renderToString (cr:CompilationResult) = - [ for (file,err) in cr.Output.PerFileErrors do - let m = err.NativeRange - let file = file.Replace("/", "\\") - let severity,no = messageAndNumber err.Error - let adjustedMessage = err.Message |> normalizeNewLines - let location = - if (equals m range0) || (equals m rangeStartup) || (equals m rangeCmdArgs) then - "" - else - // The baseline .bsl files use 1-based notation for columns, hence the +1's - sprintf "%s(%d,%d,%d,%d):" file m.StartLine (m.StartColumn+1) m.EndLine (m.EndColumn+1) - Environment.NewLine + $"{location} {err.SubCategory} {severity} FS%04d{no}: {adjustedMessage}" + Environment.NewLine - ] - |> String.Concat - - let withResultsMatchingFile (path:string) (result:CompilationResult) = - let expectedContent = File.ReadAllText(path) |> normalizeNewLines - let actualErrors = renderToString result - - match Environment.GetEnvironmentVariable("TEST_UPDATE_BSL") with - | null -> () - | _ when expectedContent = actualErrors -> () - | _ -> File.WriteAllText(path, actualErrors) - - match Assert.shouldBeSameMultilineStringSets expectedContent actualErrors with - | None -> () - | Some diff -> Assert.That(diff, Is.Empty, path) - - result - let checkCodes (expected: int list) (selector: CompilationOutput -> ErrorInfo list) (result: CompilationResult) : CompilationResult = match result with | CompilationResult.Success r @@ -1488,6 +1390,6 @@ module rec Compiler = s.Replace("\r", "").Split('\n') |> Array.map (fun line -> line.TrimEnd()) |> String.concat "\n" - + let printSignatures cUnit = printSignaturesImpl None cUnit let printSignaturesWith pageWidth cUnit = printSignaturesImpl (Some pageWidth) cUnit diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index caa78b5a80..eb9ea5d3a3 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -750,12 +750,7 @@ Updated automatically, please check diffs in your pull request, changes must be |> Async.RunImmediate if parseResults.Diagnostics.Length > 0 then - if options |> Array.contains "--test:ContinueAfterParseFailure" then - [| yield! parseResults.Diagnostics - match fileAnswer with - | FSharpCheckFileAnswer.Succeeded(tcResults) -> yield! tcResults.Diagnostics - | _ -> () |] - else parseResults.Diagnostics + parseResults.Diagnostics else match fileAnswer with diff --git a/tests/FSharp.Test.Utilities/ScriptHelpers.fs b/tests/FSharp.Test.Utilities/ScriptHelpers.fs index 588dad184c..2a31729dca 100644 --- a/tests/FSharp.Test.Utilities/ScriptHelpers.fs +++ b/tests/FSharp.Test.Utilities/ScriptHelpers.fs @@ -75,11 +75,7 @@ type RedirectConsoleOutput() = type LangVersion = | V47 | V50 - | V60 - | V70 | Preview - | Latest - | SupportsMl type FSharpScript(?additionalArgs: string[], ?quiet: bool, ?langVersion: LangVersion) = @@ -100,11 +96,8 @@ type FSharpScript(?additionalArgs: string[], ?quiet: bool, ?langVersion: LangVer if quiet then "--quiet" match langVersion with | LangVersion.V47 -> "--langversion:4.7" - | LangVersion.V50 | LangVersion.SupportsMl -> "--langversion:5.0" + | LangVersion.V50 -> "--langversion:5.0" | LangVersion.Preview -> "--langversion:preview" - | LangVersion.Latest -> "--langversion:latest" - | LangVersion.V60 -> "--langversion:6.0" - | LangVersion.V70 -> "--langversion:7.0" |] let argv = Array.append baseArgs additionalArgs diff --git a/tests/FSharp.Test.Utilities/SurfaceArea.fs b/tests/FSharp.Test.Utilities/SurfaceArea.fs index 8dcd2b9297..ca3a3570d1 100644 --- a/tests/FSharp.Test.Utilities/SurfaceArea.fs +++ b/tests/FSharp.Test.Utilities/SurfaceArea.fs @@ -4,7 +4,49 @@ module FSharp.Test.SurfaceArea open System open System.IO open System.Reflection - open System.Text.RegularExpressions + open System.Text.RegularExpressions + + let private assembleDiffMessage actual expected = + + let getLines text = + use reader = new StringReader(text) + Seq.initInfinite (fun _ -> reader.ReadLine()) + |> Seq.takeWhile (not << isNull) + |> set + let actual = getLines actual + let expected = getLines expected + + /// Surface area types/members which were expected to be found but missing from the actual surface area. + let unexpectedlyMissing = Set.difference expected actual + + /// Surface area types/members present in the actual surface area but weren't expected to be. + let unexpectedlyPresent = Set.difference actual expected + + // If both sets are empty, the surface areas match so allow the test to pass. + if Set.isEmpty unexpectedlyMissing + && Set.isEmpty unexpectedlyPresent then + None + else + // The surface areas don't match; prepare an easily-readable output message. + let msg = + let inline newLine (sb : System.Text.StringBuilder) = sb.AppendLine () |> ignore + let sb = System.Text.StringBuilder () + sb.Append "Unexpectedly missing (expected, not actual):" |> ignore + for s in unexpectedlyMissing do + newLine sb + sb.Append " " |> ignore + sb.Append s |> ignore + newLine sb + newLine sb + sb.Append "Unexpectedly present (actual, not expected):" |> ignore + for s in unexpectedlyPresent do + newLine sb + sb.Append " " |> ignore + sb.Append s |> ignore + newLine sb + sb.ToString () + + Some msg // Gets string form of public surface area for the currently-loaded assembly let private getSurfaceAreaForAssembly (assembly: Assembly) = @@ -67,7 +109,7 @@ module FSharp.Test.SurfaceArea File.WriteAllText(logFile, actual) - match Assert.shouldBeSameMultilineStringSets expected actual with + match assembleDiffMessage expected actual with | None -> () | Some diff -> // Update baselines here diff --git a/tests/fsharp/core/auto-widen/5.0/test.bsl b/tests/fsharp/core/auto-widen/5.0/test.bsl index f16d269686..d5b3e59650 100644 --- a/tests/fsharp/core/auto-widen/5.0/test.bsl +++ b/tests/fsharp/core/auto-widen/5.0/test.bsl @@ -139,6 +139,16 @@ test.fsx(67,20,67,23): typecheck error FS0001: This expression was expected to h but here has type 'int' +test.fsx(67,20,67,23): typecheck error FS0001: This expression was expected to have type + 'obj' +but here has type + 'int' + +test.fsx(68,22,68,25): typecheck error FS0001: This expression was expected to have type + 'int64' +but here has type + 'int' + test.fsx(68,22,68,25): typecheck error FS0001: This expression was expected to have type 'int64' but here has type @@ -149,6 +159,11 @@ test.fsx(69,26,69,29): typecheck error FS0001: This expression was expected to h but here has type 'int' +test.fsx(69,26,69,29): typecheck error FS0001: This expression was expected to have type + 'int64' +but here has type + 'int' + test.fsx(93,13,93,20): typecheck error FS0041: No overloads match for method 'M1'. Known type of argument: int @@ -558,6 +573,11 @@ test.fsx(291,21,291,30): typecheck error FS0001: This expression was expected to but here has type 'string' +test.fsx(291,21,291,30): typecheck error FS0001: This expression was expected to have type + 'obj' +but here has type + 'string' + test.fsx(292,24,292,26): typecheck error FS0001: This expression was expected to have type 'obj' but here has type diff --git a/tests/fsharp/core/auto-widen/preview-default-warns/test.bsl b/tests/fsharp/core/auto-widen/preview-default-warns/test.bsl index 0e6a2d5184..fc36520728 100644 --- a/tests/fsharp/core/auto-widen/preview-default-warns/test.bsl +++ b/tests/fsharp/core/auto-widen/preview-default-warns/test.bsl @@ -18,6 +18,10 @@ but here has type test.fsx(471,18,471,19): typecheck error FS0044: This construct is deprecated. nope +test.fsx(482,18,482,21): typecheck error FS3387: This expression has type 'B' and is only made compatible with type 'C' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are: + static member B.op_Implicit: x: B -> C + static member C.op_Implicit: x: B -> C + test.fsx(482,18,482,21): typecheck error FS3387: This expression has type 'B' and is only made compatible with type 'C' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are: static member B.op_Implicit: x: B -> C static member C.op_Implicit: x: B -> C diff --git a/tests/fsharp/core/auto-widen/preview/test.bsl b/tests/fsharp/core/auto-widen/preview/test.bsl index 24fa4a641c..f449e09a61 100644 --- a/tests/fsharp/core/auto-widen/preview/test.bsl +++ b/tests/fsharp/core/auto-widen/preview/test.bsl @@ -79,6 +79,12 @@ test.fsx(64,50,64,71): typecheck error FS3388: This expression implicitly conver test.fsx(67,20,67,23): typecheck error FS3388: This expression implicitly converts type 'int' to type 'obj'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(67,20,67,23): typecheck error FS3388: This expression implicitly converts type 'int' to type 'obj'. See https://aka.ms/fsharp-implicit-convs. + +test.fsx(68,22,68,25): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. + +test.fsx(68,22,68,25): typecheck error FS3388: This expression implicitly converts type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. + test.fsx(68,22,68,25): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. test.fsx(68,22,68,25): typecheck error FS3388: This expression implicitly converts type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. @@ -87,16 +93,26 @@ test.fsx(69,26,69,29): typecheck error FS3389: This expression uses a built-in i test.fsx(69,26,69,29): typecheck error FS3388: This expression implicitly converts type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(69,26,69,29): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. + +test.fsx(69,26,69,29): typecheck error FS3388: This expression implicitly converts type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. + +test.fsx(93,18,93,19): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. + test.fsx(93,18,93,19): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. test.fsx(99,20,99,21): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(99,20,99,21): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. + test.fsx(116,20,116,21): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. test.fsx(116,20,116,21): typecheck error FS3388: This expression implicitly converts type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. test.fsx(121,19,121,20): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(121,19,121,20): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. + test.fsx(122,19,122,20): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. test.fsx(122,19,122,20): typecheck error FS3388: This expression implicitly converts type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. @@ -107,6 +123,8 @@ test.fsx(122,22,122,23): typecheck error FS3388: This expression implicitly conv test.fsx(127,19,127,20): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'double'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(127,19,127,20): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'double'. See https://aka.ms/fsharp-implicit-convs. + test.fsx(128,19,128,20): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'double'. See https://aka.ms/fsharp-implicit-convs. test.fsx(128,19,128,20): typecheck error FS3388: This expression implicitly converts type 'int' to type 'double'. See https://aka.ms/fsharp-implicit-convs. @@ -149,6 +167,8 @@ test.fsx(165,18,165,19): typecheck error FS3388: This expression implicitly conv test.fsx(172,18,172,21): typecheck error FS3395: This expression uses the implicit conversion 'static member Y.op_Implicit: y: Y -> X' to convert type 'Y' to type 'X'. +test.fsx(172,18,172,21): typecheck error FS3395: This expression uses the implicit conversion 'static member Y.op_Implicit: y: Y -> X' to convert type 'Y' to type 'X'. + test.fsx(178,20,178,21): typecheck error FS3391: This expression uses the implicit conversion 'static member C.op_Implicit: x: 'T -> C<'T>' to convert type 'int' to type 'C'. See https://aka.ms/fsharp-implicit-convs. This warning may be disabled using '#nowarn "3391". test.fsx(178,20,178,21): typecheck error FS3388: This expression implicitly converts type 'int' to type 'C'. See https://aka.ms/fsharp-implicit-convs. @@ -213,12 +233,16 @@ test.fsx(216,34,216,35): typecheck error FS3388: This expression implicitly conv test.fsx(219,20,219,33): typecheck error FS3388: This expression implicitly converts type 'U' to type 'obj'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(219,20,219,33): typecheck error FS3388: This expression implicitly converts type 'U' to type 'obj'. See https://aka.ms/fsharp-implicit-convs. + test.fsx(222,21,222,31): typecheck error FS3388: This expression implicitly converts type 'U' to type 'obj'. See https://aka.ms/fsharp-implicit-convs. test.fsx(225,21,225,31): typecheck error FS3388: This expression implicitly converts type 'int -> U' to type 'obj'. See https://aka.ms/fsharp-implicit-convs. test.fsx(228,21,228,40): typecheck error FS3388: This expression implicitly converts type 'SU' to type 'obj'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(228,21,228,40): typecheck error FS3388: This expression implicitly converts type 'SU' to type 'obj'. See https://aka.ms/fsharp-implicit-convs. + test.fsx(231,21,231,37): typecheck error FS3388: This expression implicitly converts type 'SU' to type 'obj'. See https://aka.ms/fsharp-implicit-convs. test.fsx(234,21,234,37): typecheck error FS3388: This expression implicitly converts type 'int -> SU' to type 'obj'. See https://aka.ms/fsharp-implicit-convs. @@ -293,6 +317,8 @@ test.fsx(290,21,290,23): typecheck error FS3388: This expression implicitly conv test.fsx(291,21,291,30): typecheck error FS3388: This expression implicitly converts type 'string' to type 'obj'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(291,21,291,30): typecheck error FS3388: This expression implicitly converts type 'string' to type 'obj'. See https://aka.ms/fsharp-implicit-convs. + test.fsx(292,24,292,26): typecheck error FS3388: This expression implicitly converts type 'string' to type 'obj'. See https://aka.ms/fsharp-implicit-convs. test.fsx(295,34,295,35): typecheck error FS3388: This expression implicitly converts type 'int' to type 'obj'. See https://aka.ms/fsharp-implicit-convs. @@ -578,10 +604,22 @@ test.fsx(482,18,482,21): typecheck error FS3387: This expression has type 'B' an test.fsx(482,18,482,21): typecheck error FS3395: This expression uses the implicit conversion 'static member B.op_Implicit: x: B -> C' to convert type 'B' to type 'C'. +test.fsx(482,18,482,21): typecheck error FS3387: This expression has type 'B' and is only made compatible with type 'C' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are: + static member B.op_Implicit: x: B -> C + static member C.op_Implicit: x: B -> C + +test.fsx(482,18,482,21): typecheck error FS3395: This expression uses the implicit conversion 'static member B.op_Implicit: x: B -> C' to convert type 'B' to type 'C'. + +test.fsx(507,18,507,21): typecheck error FS3395: This expression uses the implicit conversion 'static member C.op_Implicit: x: B -> C' to convert type 'B' to type 'C'. + test.fsx(507,18,507,21): typecheck error FS3395: This expression uses the implicit conversion 'static member C.op_Implicit: x: B -> C' to convert type 'B' to type 'C'. test.fsx(519,18,519,21): typecheck error FS3395: This expression uses the implicit conversion 'static member B.op_Implicit: x: B -> C' to convert type 'B' to type 'C'. +test.fsx(519,18,519,21): typecheck error FS3395: This expression uses the implicit conversion 'static member B.op_Implicit: x: B -> C' to convert type 'B' to type 'C'. + +test.fsx(538,18,538,21): typecheck error FS3395: This expression uses the implicit conversion 'static member C.op_Implicit: x: B -> C' to convert type 'B' to type 'C'. + test.fsx(538,18,538,21): typecheck error FS3395: This expression uses the implicit conversion 'static member C.op_Implicit: x: B -> C' to convert type 'B' to type 'C'. test.fsx(543,30,543,31): typecheck error FS0001: This expression was expected to have type diff --git a/tests/fsharp/core/members/ops/test.fsx b/tests/fsharp/core/members/ops/test.fsx index 1f76c94ef4..4c0581d42c 100644 --- a/tests/fsharp/core/members/ops/test.fsx +++ b/tests/fsharp/core/members/ops/test.fsx @@ -415,7 +415,7 @@ let RUN() = !failures let aa = match !failures with | [] -> - stdout.WriteLine "Test Passed" + stdout.WriteLine "Test Passed" System.IO.File.WriteAllText("test.ok","ok") exit 0 | _ -> diff --git a/tests/fsharp/core/namespaces/test2.fs b/tests/fsharp/core/namespaces/test2.fs index 230ffcca48..19d215d4a0 100644 --- a/tests/fsharp/core/namespaces/test2.fs +++ b/tests/fsharp/core/namespaces/test2.fs @@ -13,7 +13,7 @@ module M = #if TESTS_AS_APP - let RUN() = !Hello.Goodbye.Utils.failures + let RUN() = !failures #else let aa = if not (!Hello.Goodbye.Utils.failures).IsEmpty then diff --git a/tests/fsharp/core/printf/test.fsx b/tests/fsharp/core/printf/test.fsx index cf78d1a8cb..8ea722c9ee 100644 --- a/tests/fsharp/core/printf/test.fsx +++ b/tests/fsharp/core/printf/test.fsx @@ -447,9 +447,8 @@ module CheckDisplayAttributes12 = member internal x.Hello = "Hello" override x.ToString() = "x" - let tName = typeof.FullName // this should produce an error - test "cenwoiwe12" (lazy(sprintf "%A" (Foo()))) ("") + test "cenwoiwe12" (lazy(sprintf "%A" (Foo()))) "" // Check one with an unmatched closing bracket module CheckDisplayAttributes13 = diff --git a/tests/fsharp/core/subtype/test.fsx b/tests/fsharp/core/subtype/test.fsx index c9aa30a006..76de2b2d52 100644 --- a/tests/fsharp/core/subtype/test.fsx +++ b/tests/fsharp/core/subtype/test.fsx @@ -1088,7 +1088,7 @@ module InnerConstrainedClosureTests = printfn "hello, %A" z /// This uses the local type function in another closure that also captures one of the outer arguments let h() = g(3,y) - // This just returnes the closure to make sure we don't optimize it all away + /// This just returnes the closure to make sure we don't optimize it all away h @@ -1099,7 +1099,7 @@ module InnerConstrainedClosureTests = printfn "hello, %A" z /// This uses the local type function in another closure that also captures one of the outer arguments let h() = g(3) - // This just returnes the closure to make sure we don't optimize it all away + /// This just returnes the closure to make sure we don't optimize it all away h let Example3 (y:'b,z:'a) = @@ -1108,7 +1108,7 @@ module InnerConstrainedClosureTests = printfn "hello, %A" z /// This uses the local type function in another closure that also captures one of the outer arguments let h() = g(3,y) - // This just returnes the closure to make sure we don't optimize it all away + /// This just returnes the closure to make sure we don't optimize it all away h let Example4 (y:'b,z:'a) = @@ -1119,7 +1119,7 @@ module InnerConstrainedClosureTests = let h1() = g(3,4,y) /// This uses the local type function in another closure that also captures one of the outer arguments let h2() = g("3","4",y) - // This just returnes the closure to make sure we don't optimize it all away + /// This just returnes the closure to make sure we don't optimize it all away h1,h2 @@ -1132,7 +1132,7 @@ module InnerConstrainedClosureTests = let h1() = g(3,4,y) /// This uses the local type function in another closure that also captures one of the outer arguments let h2() = g("3","4",y) - // This just returnes the closure to make sure we don't optimize it all away + /// This just returnes the closure to make sure we don't optimize it all away h1,h2 let Example6 (y:'b,z:'a) = diff --git a/tests/fsharp/core/unicode/test.fsx b/tests/fsharp/core/unicode/test.fsx index 10089e9dd0..9b7303c0d3 100644 --- a/tests/fsharp/core/unicode/test.fsx +++ b/tests/fsharp/core/unicode/test.fsx @@ -24,8 +24,6 @@ let input_byte (x : System.IO.FileStream) = let b = x.ReadByte() if b = -1 then raise (System.IO.EndOfStreamException()) else b -let bslFilePath = Path.Combine(__SOURCE_DIRECTORY__,"out.bsl") - let test2925 () = printfn "test2925..."; (* This writes a file in the standard utf8 encoding. Probably needs to be adjusted if default encodings differ *) @@ -34,7 +32,7 @@ let test2925 () = os.Write "\u2260"; (* not equals *) os.Dispose(); use is1 = System.IO.File.OpenRead "out1.txt" in - use is2 = System.IO.File.OpenRead bslFilePath in + use is2 = System.IO.File.OpenRead "out.bsl" in try while true do let c2 = input_byte is2 in @@ -56,7 +54,7 @@ let test2925b () = os.Write "\U00002260"; (* not equals *) os.Dispose(); let is1 = System.IO.File.OpenRead "out1.txt" in - let is2 = System.IO.File.OpenRead bslFilePath in + let is2 = System.IO.File.OpenRead "out.bsl" in try while true do let c2 = input_byte is2 in @@ -79,7 +77,7 @@ let test2926 () = Printf.printf "length s = %d\n" (String.length s); os.Dispose(); let is1 = System.IO.File.OpenRead "out2.txt" in - let is2 = System.IO.File.OpenRead bslFilePath in + let is2 = System.IO.File.OpenRead "out.bsl" in try while true do let c2 = input_byte is2 in diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 35700a83ae..c43b1aceab 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -35,9 +35,347 @@ let testConfig = getTestsDirectory >> testConfig [] module CoreTests = + // These tests are enabled for .NET Framework and .NET Core + [] + let ``access-FSC_DEBUG``() = singleTestBuildAndRun "core/access" FSC_DEBUG + + [] + let ``access-FSC_OPTIMIZED``() = singleTestBuildAndRun "core/access" FSC_OPTIMIZED + + [] + let ``access-FSI``() = singleTestBuildAndRun "core/access" FSI + + [] + let ``apporder-FSC_DEBUG`` () = singleTestBuildAndRun "core/apporder" FSC_DEBUG + + [] + let ``apporder-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/apporder" FSC_OPTIMIZED + + [] + let ``apporder-FSI`` () = singleTestBuildAndRun "core/apporder" FSI + + [] + let ``array-FSC_DEBUG-5.0`` () = singleTestBuildAndRunVersion "core/array" FSC_DEBUG "5.0" + + [] + let ``array-FSC_OPTIMIZED-5.0`` () = singleTestBuildAndRunVersion "core/array" FSC_OPTIMIZED "5.0" + + [] + let ``array-FSI-5.0`` () = singleTestBuildAndRunVersion "core/array" FSI "5.0" + + [] + let ``array-FSC_OPTIMIZED-preview`` () = singleTestBuildAndRunVersion "core/array" FSC_OPTIMIZED "preview" + + [] + let ``array-no-dot-FSC_DEBUG`` () = singleTestBuildAndRunVersion "core/array-no-dot" FSC_DEBUG "preview" + + [] + let ``array-no-dot-FSC_OPTIMIZED`` () = singleTestBuildAndRunVersion "core/array-no-dot" FSC_OPTIMIZED "preview" + + [] + let ``array-no-dot-FSI`` () = singleTestBuildAndRunVersion "core/array-no-dot" FSI "preview" + + [] + let ``array-no-dot-warnings-langversion-default`` () = + let cfg = testConfig "core/array-no-dot-warnings" + singleVersionedNegTest cfg "default" "test-langversion-default" + + [] + let ``array-no-dot-warnings-langversion-5_0`` () = + let cfg = testConfig "core/array-no-dot-warnings" + singleVersionedNegTest cfg "5.0" "test-langversion-5.0" + + [] + let ``ref-ops-deprecation-langversion-preview`` () = + let cfg = testConfig "core/ref-ops-deprecation" + singleVersionedNegTest cfg "preview" "test-langversion-preview" + + [] + let ``auto-widen-version-5_0``() = + let cfg = testConfig "core/auto-widen/5.0" + singleVersionedNegTest cfg "5.0" "test" + + [] + let ``auto-widen-version-FSC_DEBUG-preview``() = + singleTestBuildAndRunVersion "core/auto-widen/preview" FSC_DEBUG "preview" + + [] + let ``auto-widen-version-FSC_OPTIMIZED-preview``() = + singleTestBuildAndRunVersion "core/auto-widen/preview" FSC_OPTIMIZED "preview" + + [] + let ``auto-widen-version-preview-warns-on``() = + let cfg = testConfig "core/auto-widen/preview" + let cfg = { cfg with fsc_flags = cfg.fsc_flags + " --warnon:3388 --warnon:3389 --warnon:3395 --warnaserror+ --define:NEGATIVE" } + singleVersionedNegTest cfg "preview" "test" + + [] + let ``auto-widen-version-preview-default-warns``() = + let cfg = testConfig "core/auto-widen/preview-default-warns" + let cfg = { cfg with fsc_flags = cfg.fsc_flags + " --warnaserror+ --define:NEGATIVE" } + singleVersionedNegTest cfg "preview" "test" + + [] + let ``comprehensions-FSC_DEBUG`` () = singleTestBuildAndRun "core/comprehensions" FSC_DEBUG + + [] + let ``comprehensions-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/comprehensions" FSC_OPTIMIZED + + [] + let ``comprehensions-FSI`` () = singleTestBuildAndRun "core/comprehensions" FSI + + [] + let ``comprehensionshw-FSC_DEBUG`` () = singleTestBuildAndRun "core/comprehensions-hw" FSC_DEBUG + + [] + let ``comprehensionshw-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/comprehensions-hw" FSC_OPTIMIZED + + [] + let ``comprehensionshw-FSI`` () = singleTestBuildAndRun "core/comprehensions-hw" FSI + + [] + let ``genericmeasures-FSC_DEBUG`` () = singleTestBuildAndRun "core/genericmeasures" FSC_DEBUG + + [] + let ``genericmeasures-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/genericmeasures" FSC_OPTIMIZED + + [] + let ``genericmeasures-FSI`` () = singleTestBuildAndRun "core/genericmeasures" FSI + + [] + let ``innerpoly-FSC_DEBUG`` () = singleTestBuildAndRun "core/innerpoly" FSC_DEBUG + + [] + let ``innerpoly-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/innerpoly" FSC_OPTIMIZED + + [] + let ``innerpoly-FSI`` () = singleTestBuildAndRun "core/innerpoly" FSI + + [] + let ``namespaceAttributes-FSC_DEBUG`` () = singleTestBuildAndRun "core/namespaces" FSC_DEBUG + + [] + let ``namespaceAttributes-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/namespaces" FSC_OPTIMIZED + + [] + let ``unicode2-FSC_DEBUG`` () = singleTestBuildAndRun "core/unicode" FSC_DEBUG // TODO: fails on coreclr + + [] + let ``unicode2-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/unicode" FSC_OPTIMIZED // TODO: fails on coreclr + + [] + let ``unicode2-FSI`` () = singleTestBuildAndRun "core/unicode" FSI + + [] + let ``lazy test-FSC_DEBUG`` () = singleTestBuildAndRun "core/lazy" FSC_DEBUG + + [] + let ``lazy test-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/lazy" FSC_OPTIMIZED + + [] + let ``lazy test-FSI`` () = singleTestBuildAndRun "core/lazy" FSI + + [] + let ``letrec-FSC_DEBUG`` () = singleTestBuildAndRun "core/letrec" FSC_DEBUG + + [] + let ``letrec-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/letrec" FSC_OPTIMIZED + + [] + let ``letrec-FSI`` () = singleTestBuildAndRun "core/letrec" FSI + + [] + let ``letrec (mutrec variations part one) FSC_DEBUG`` () = singleTestBuildAndRun "core/letrec-mutrec" FSC_DEBUG + + [] + let ``letrec (mutrec variations part one) FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/letrec-mutrec" FSC_OPTIMIZED + + [] + let ``letrec (mutrec variations part one) FSI`` () = singleTestBuildAndRun "core/letrec-mutrec" FSI + + [] + let ``libtest-FSC_DEBUG`` () = singleTestBuildAndRun "core/libtest" FSC_DEBUG + + [] + let ``libtest-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/libtest" FSC_OPTIMIZED + + [] + let ``libtest-FSI`` () = singleTestBuildAndRun "core/libtest" FSI + + [] + let ``lift-FSC_DEBUG`` () = singleTestBuildAndRun "core/lift" FSC_DEBUG + + [] + let ``lift-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/lift" FSC_OPTIMIZED + + [] + let ``lift-FSI`` () = singleTestBuildAndRun "core/lift" FSI + + [] + let ``map-FSC_DEBUG`` () = singleTestBuildAndRun "core/map" FSC_DEBUG + + [] + let ``map-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/map" FSC_OPTIMIZED + + [] + let ``map-FSI`` () = singleTestBuildAndRun "core/map" FSI + + [] + let ``measures-FSC_DEBUG`` () = singleTestBuildAndRun "core/measures" FSC_DEBUG + + [] + let ``measures-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/measures" FSC_OPTIMIZED + + [] + let ``measures-FSI`` () = singleTestBuildAndRun "core/measures" FSI + + [] + let ``nested-FSC_DEBUG`` () = singleTestBuildAndRun "core/nested" FSC_DEBUG + + [] + let ``nested-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/nested" FSC_OPTIMIZED + + [] + let ``nested-FSI`` () = singleTestBuildAndRun "core/nested" FSI + + [] + let ``members-ops-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/members/ops" FSC_OPTIMIZED + + [] + let ``members-ops-FSC_DEBUG`` () = singleTestBuildAndRun "core/members/ops" FSC_DEBUG + + [] + let ``members-ops-FSI`` () = singleTestBuildAndRun "core/members/ops" FSI + + [] + let ``members-ops-mutrec-FSC_DEBUG`` () = singleTestBuildAndRun "core/members/ops-mutrec" FSC_DEBUG + + [] + let ``members-ops-mutrec-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/members/ops-mutrec" FSC_OPTIMIZED + + [] + let ``members-ops-mutrec-FSI`` () = singleTestBuildAndRun "core/members/ops-mutrec" FSI + + [] + let ``seq-FSC_DEBUG`` () = singleTestBuildAndRun "core/seq" FSC_DEBUG + + [] + let ``seq-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/seq" FSC_OPTIMIZED + + [] + let ``seq-FSI`` () = singleTestBuildAndRun "core/seq" FSI + + [] + let ``math-numbers-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/math/numbers" FSC_OPTIMIZED + + [] + let ``math-numbers-FSI`` () = singleTestBuildAndRun "core/math/numbers" FSI + + [] + let ``members-ctree-FSC_DEBUG`` () = singleTestBuildAndRun "core/members/ctree" FSC_DEBUG + + [] + let ``members-ctree-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/members/ctree" FSC_OPTIMIZED + + [] + let ``members-ctree-FSI`` () = singleTestBuildAndRun "core/members/ctree" FSI + + [] + let ``members-factors-FSC_DEBUG`` () = singleTestBuildAndRun "core/members/factors" FSC_DEBUG + + [] + let ``members-factors-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/members/factors" FSC_OPTIMIZED + + [] + let ``members-factors-FSI`` () = singleTestBuildAndRun "core/members/factors" FSI + + [] + let ``members-factors-mutrec-FSC_DEBUG`` () = singleTestBuildAndRun "core/members/factors-mutrec" FSC_DEBUG + + [] + let ``members-factors-mutrec-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/members/factors-mutrec" FSC_OPTIMIZED + + [] + let ``members-factors-mutrec-FSI`` () = singleTestBuildAndRun "core/members/factors-mutrec" FSI + + [] + let ``graph-FSC_DEBUG`` () = singleTestBuildAndRunVersion "perf/graph" FSC_DEBUG "supports-ml" + + [] + let ``graph-FSC_OPTIMIZED`` () = singleTestBuildAndRunVersion "perf/graph" FSC_OPTIMIZED "supports-ml" + + [] + let ``graph-FSI`` () = singleTestBuildAndRunVersion "perf/graph" FSI "supports-ml" + + [] + let ``nbody-FSC_DEBUG`` () = singleTestBuildAndRunVersion "perf/nbody" FSC_DEBUG "supports-ml" + + [] + let ``nbody-FSC_OPTIMIZED`` () = singleTestBuildAndRunVersion "perf/nbody" FSC_OPTIMIZED "supports-ml" + + [] + let ``nbody-FSI`` () = singleTestBuildAndRunVersion "perf/nbody" FSI "supports-ml" + + [] + let ``forexpression-FSC_DEBUG`` () = singleTestBuildAndRun "core/forexpression" FSC_DEBUG + + [] + let ``forexpression-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/forexpression" FSC_OPTIMIZED + + [] + let ``forexpression-FSI`` () = singleTestBuildAndRun "core/forexpression" FSI + + [] + let ``letrec (mutrec variations part two) FSC_DEBUG`` () = singleTestBuildAndRun "core/letrec-mutrec2" FSC_DEBUG + + [] + let ``letrec (mutrec variations part two) FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/letrec-mutrec2" FSC_OPTIMIZED + + [] + let ``letrec (mutrec variations part two) FSI`` () = singleTestBuildAndRun "core/letrec-mutrec2" FSI + + [] + let ``printf`` () = singleTestBuildAndRunVersion "core/printf" FSC_OPTIMIZED "preview" + + [] + let ``printf-interpolated`` () = singleTestBuildAndRunVersion "core/printf-interpolated" FSC_OPTIMIZED "preview" + + [] + let ``tlr-FSC_DEBUG`` () = singleTestBuildAndRun "core/tlr" FSC_DEBUG + + [] + let ``tlr-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/tlr" FSC_OPTIMIZED + + [] + let ``tlr-FSI`` () = singleTestBuildAndRun "core/tlr" FSI + + [] + let ``subtype-FSC_DEBUG`` () = singleTestBuildAndRun "core/subtype" FSC_DEBUG + + [] + let ``subtype-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/subtype" FSC_OPTIMIZED + + [] + let ``subtype-FSI`` () = singleTestBuildAndRun "core/subtype" FSI + + [] + let ``syntax-FSC_DEBUG`` () = singleTestBuildAndRun "core/syntax" FSC_DEBUG + + [] + let ``syntax-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/syntax" FSC_OPTIMIZED + + [] + let ``syntax-FSI`` () = singleTestBuildAndRun "core/syntax" FSI + + [] + let ``test int32-FSC_DEBUG`` () = singleTestBuildAndRun "core/int32" FSC_DEBUG + + [] + let ``test int32-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/int32" FSC_OPTIMIZED + + [] + let ``test int32-FSI`` () = singleTestBuildAndRun "core/int32" FSI -#if !NETCOREAPP -// This test stays in FsharpSuite for a later migration phases, it uses hardcoded #r to a C# compiled cslib.dll inside [] let ``quotes-FSC-FSC_DEBUG`` () = singleTestBuildAndRun "core/quotes" FSC_DEBUG @@ -46,23 +384,15 @@ module CoreTests = [] let ``quotes-FSI-BASIC`` () = singleTestBuildAndRun "core/quotes" FSI -#endif - -#if !NETCOREAPP -// This test has hardcoded expectations about current synchronization context -// Will be moved out of FsharpSuite.Tests in a later phase for desktop framework [] - let ``control-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/control" FSC_OPTIMIZED + let ``recordResolution-FSC_DEBUG`` () = singleTestBuildAndRun "core/recordResolution" FSC_DEBUG [] - let ``control-FSI`` () = singleTestBuildAndRun "core/control" FSI + let ``recordResolution-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/recordResolution" FSC_OPTIMIZED [] - let ``control --tailcalls`` () = - let cfg = testConfig "core/control" - singleTestBuildAndRunAux {cfg with fsi_flags = " --tailcalls" } FSC_OPTIMIZED -#endif + let ``recordResolution-FSI`` () = singleTestBuildAndRun "core/recordResolution" FSI [] let ``SDKTests`` () = @@ -317,7 +647,49 @@ module CoreTests = #endif + [] + let ``control-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/control" FSC_OPTIMIZED + + [] + let ``control-FSI`` () = singleTestBuildAndRun "core/control" FSI + + [] + let ``control --tailcalls`` () = + let cfg = testConfig "core/control" + singleTestBuildAndRunAux {cfg with fsi_flags = " --tailcalls" } FSC_OPTIMIZED + + [] + let ``controlChamenos-FSC_OPTIMIZED`` () = + let cfg = testConfig "core/controlChamenos" + singleTestBuildAndRunAux {cfg with fsi_flags = " --tailcalls" } FSC_OPTIMIZED + + [] + let ``controlChamenos-FSI`` () = + let cfg = testConfig "core/controlChamenos" + singleTestBuildAndRunAux {cfg with fsi_flags = " --tailcalls" } FSI + + [] + let ``controlMailbox-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/controlMailbox" FSC_OPTIMIZED + + [] + let ``controlMailbox-FSI`` () = singleTestBuildAndRun "core/controlMailbox" FSI + + [] + let ``controlMailbox --tailcalls`` () = + let cfg = testConfig "core/controlMailbox" + singleTestBuildAndRunAux {cfg with fsi_flags = " --tailcalls" } FSC_OPTIMIZED + + [] + let ``csext-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/csext" FSC_OPTIMIZED + [] + let ``csext-FSI`` () = singleTestBuildAndRun "core/csext" FSI + + [] + let ``enum-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/enum" FSC_OPTIMIZED + + [] + let ``enum-FSI`` () = singleTestBuildAndRun "core/enum" FSI #if !NETCOREAPP @@ -1204,15 +1576,68 @@ module CoreTests = | _ -> Assert.Fail (sprintf "'%s' and '%s' differ; %A" stderrPath stderrBaseline diffs2) #endif + [] + let ``longnames-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/longnames" FSC_OPTIMIZED + [] + let ``longnames-FSI`` () = singleTestBuildAndRun "core/longnames" FSI -#if !NETCOREAPP + [] + let ``math-numbersVS2008-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/math/numbersVS2008" FSC_OPTIMIZED + + [] + let ``math-numbersVS2008-FSI`` () = singleTestBuildAndRun "core/math/numbersVS2008" FSI + + [] + let ``patterns-FSC_OPTIMIZED`` () = singleTestBuildAndRunVersion "core/patterns" FSC_OPTIMIZED "preview" + +// This requires --multiemit on by default, which is not the case for .NET Framework +#if NETCOREAPP + [] + let ``patterns-FSI`` () = singleTestBuildAndRun "core/patterns" FSI +#endif + + [] + let ``pinvoke-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/pinvoke" FSC_OPTIMIZED + + [] + let ``pinvoke-FSI`` () = + singleTestBuildAndRun "core/pinvoke" FSI + + [] + let ``fsi_load-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/fsi-load" FSC_OPTIMIZED + + [] + let ``fsi_load-FSI`` () = singleTestBuildAndRun "core/fsi-load" FSI + +#if !NETCOREAPP [] let ``measures-FSC_NETFX_TEST_ROUNDTRIP_AS_DLL`` () = singleTestBuildAndRun "core/measures" FSC_NETFX_TEST_ROUNDTRIP_AS_DLL [] let ``members-basics-FSC_NETFX_TEST_ROUNDTRIP_AS_DLL`` () = singleTestBuildAndRun "core/members/basics" FSC_NETFX_TEST_ROUNDTRIP_AS_DLL + [] + let ``members-basics-hw`` () = singleTestBuildAndRun "core/members/basics-hw" FSC_OPTIMIZED + + [] + let ``members-basics-hw-mutrec`` () = singleTestBuildAndRun "core/members/basics-hw-mutrec" FSC_OPTIMIZED + + [] + let ``members-incremental-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/members/incremental" FSC_OPTIMIZED + + [] + let ``members-incremental-FSI`` () = singleTestBuildAndRun "core/members/incremental" FSI + + [] + let ``members-incremental-hw-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/members/incremental-hw" FSC_OPTIMIZED + + [] + let ``members-incremental-hw-FSI`` () = singleTestBuildAndRun "core/members/incremental-hw" FSI + + [] + let ``members-incremental-hw-mutrec-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/members/incremental-hw-mutrec" FSC_OPTIMIZED + [] let queriesLeafExpressionConvert () = let cfg = testConfig "core/queriesLeafExpressionConvert" @@ -1410,7 +1835,11 @@ module CoreTests = testOkFile.CheckExists() #endif + [] + let ``reflect-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/reflect" FSC_OPTIMIZED + [] + let ``reflect-FSI`` () = singleTestBuildAndRun "core/reflect" FSI #if !NETCOREAPP [] @@ -2048,6 +2477,9 @@ module TypecheckTests = let cfg = testConfig "typecheck/full-rank-arrays" SingleTest.singleTestBuildAndRunWithCopyDlls cfg "full-rank-arrays.dll" FSC_OPTIMIZED + [] + let misc () = singleTestBuildAndRunVersion "typecheck/misc" FSC_OPTIMIZED "supports-ml" + #if !NETCOREAPP [] @@ -2301,10 +2733,31 @@ module TypecheckTests = fsc cfg "%s -a -o:pos05.dll" cfg.fsc_flags ["pos05.fs"] [] - let ``type check neg01`` () = singleNegTest (testConfig "typecheck/sigs") "neg01" + let ``type check neg01`` () = singleNegTest (testConfig "typecheck/sigs") "neg01" + + [] + let ``type check neg02`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "6.0" "neg02" + + [] + let ``type check neg03`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "supports-ml*" "neg03" [] - let ``type check neg03`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "supports-ml*" "neg03" + let ``type check neg04`` () = singleNegTest (testConfig "typecheck/sigs") "neg04" + + [] + let ``type check neg05`` () = singleNegTest (testConfig "typecheck/sigs") "neg05" + + [] + let ``type check neg06`` () = singleNegTest (testConfig "typecheck/sigs") "neg06" + + [] + let ``type check neg06_a`` () = singleNegTest (testConfig "typecheck/sigs") "neg06_a" + + [] + let ``type check neg06_b`` () = singleNegTest (testConfig "typecheck/sigs") "neg06_b" + + [] + let ``type check neg07`` () = singleNegTest (testConfig "typecheck/sigs") "neg07" [] let ``type check neg08`` () = singleNegTest (testConfig "typecheck/sigs") "neg08" @@ -2313,14 +2766,52 @@ module TypecheckTests = let ``type check neg09`` () = singleNegTest (testConfig "typecheck/sigs") "neg09" [] - let ``type check neg10`` () = singleNegTest (testConfig "typecheck/sigs") "neg10" - + let ``type check neg10`` () = singleNegTest (testConfig "typecheck/sigs") "neg10" + + [] + let ``type check neg10_a`` () = singleNegTest (testConfig "typecheck/sigs") "neg10_a" + + [] + let ``type check neg11`` () = singleNegTest (testConfig "typecheck/sigs") "neg11" + + [] + let ``type check neg12`` () = singleNegTest (testConfig "typecheck/sigs") "neg12" + + [] + let ``type check neg13`` () = singleNegTest (testConfig "typecheck/sigs") "neg13" + + [] + let ``type check neg14`` () = singleNegTest (testConfig "typecheck/sigs") "neg14" + [] - let ``type check neg14`` () = singleNegTest (testConfig "typecheck/sigs") "neg14" + let ``type check neg15`` () = singleNegTest (testConfig "typecheck/sigs") "neg15" + + [] + let ``type check neg16`` () = singleNegTest (testConfig "typecheck/sigs") "neg16" [] let ``type check neg17`` () = singleNegTest (testConfig "typecheck/sigs") "neg17" + [] + let ``type check neg18`` () = singleNegTest (testConfig "typecheck/sigs") "neg18" + + [] + let ``type check neg19`` () = singleNegTest (testConfig "typecheck/sigs") "neg19" + + [] + let ``type check neg20`` () = singleNegTest (testConfig "typecheck/sigs") "neg20" + + [] + let ``type check neg20 version 5_0`` () = + let cfg = testConfig "typecheck/sigs/version50" + singleVersionedNegTest cfg "5.0" "neg20" + + [] + let ``type check neg21`` () = singleNegTest (testConfig "typecheck/sigs") "neg21" + + [] + let ``type check neg23`` () = singleNegTest (testConfig "typecheck/sigs") "neg23" + [] let ``type check neg24 version 4_6`` () = let cfg = testConfig "typecheck/sigs/version46" @@ -2342,31 +2833,238 @@ module TypecheckTests = let cfg = { cfg with fsc_flags = cfg.fsc_flags.Replace("--nowarn:20", "") } singleVersionedNegTest cfg "preview" "neg24" + [] + let ``type check neg25`` () = singleNegTest (testConfig "typecheck/sigs") "neg25" + + [] + let ``type check neg26`` () = singleNegTest (testConfig "typecheck/sigs") "neg26" + [] let ``type check neg27`` () = singleNegTest (testConfig "typecheck/sigs") "neg27" + [] + let ``type check neg28`` () = singleNegTest (testConfig "typecheck/sigs") "neg28" + + [] + let ``type check neg29`` () = singleNegTest (testConfig "typecheck/sigs") "neg29" + + [] + let ``type check neg30`` () = singleNegTest (testConfig "typecheck/sigs") "neg30" + [] let ``type check neg31`` () = singleNegTest (testConfig "typecheck/sigs") "neg31" [] - let ``type check neg33`` () = singleNegTest (testConfig "typecheck/sigs") "neg33" + let ``type check neg32`` () = singleNegTest (testConfig "typecheck/sigs") "neg32" + + [] + let ``type check neg33`` () = singleNegTest (testConfig "typecheck/sigs") "neg33" [] - let ``type check neg43`` () = singleNegTest (testConfig "typecheck/sigs") "neg43" + let ``type check neg34`` () = singleNegTest (testConfig "typecheck/sigs") "neg34" + + [] + let ``type check neg35`` () = singleNegTest (testConfig "typecheck/sigs") "neg35" + + [] + let ``type check neg36`` () = singleNegTest (testConfig "typecheck/sigs") "neg36" + + [] + let ``type check neg37`` () = singleNegTest (testConfig "typecheck/sigs") "neg37" + + [] + let ``type check neg37_a`` () = singleNegTest (testConfig "typecheck/sigs") "neg37_a" + + [] + let ``type check neg38`` () = singleNegTest (testConfig "typecheck/sigs") "neg38" + + [] + let ``type check neg39`` () = singleNegTest (testConfig "typecheck/sigs") "neg39" + + [] + let ``type check neg40`` () = singleNegTest (testConfig "typecheck/sigs") "neg40" + + [] + let ``type check neg41`` () = singleNegTest (testConfig "typecheck/sigs") "neg41" + + [] + let ``type check neg42`` () = singleNegTest (testConfig "typecheck/sigs") "neg42" + + [] + let ``type check neg43`` () = singleNegTest (testConfig "typecheck/sigs") "neg43" + + [] + let ``type check neg44`` () = singleNegTest (testConfig "typecheck/sigs") "neg44" #if !DEBUG // requires release version of compiler to avoid very deep stacks [] let ``type check neg45`` () = singleNegTest (testConfig "typecheck/sigs") "neg45" #endif + [] + let ``type check neg46`` () = singleNegTest (testConfig "typecheck/sigs") "neg46" + + [] + let ``type check neg47`` () = singleNegTest (testConfig "typecheck/sigs") "neg47" + + [] + let ``type check neg48`` () = singleNegTest (testConfig "typecheck/sigs") "neg48" + [] let ``type check neg49`` () = singleNegTest (testConfig "typecheck/sigs") "neg49" [] - let ``type check neg56_a`` () = singleNegTest (testConfig "typecheck/sigs") "neg56_a" + let ``type check neg50`` () = singleNegTest (testConfig "typecheck/sigs") "neg50" + + [] + let ``type check neg51`` () = singleNegTest (testConfig "typecheck/sigs") "neg51" + + [] + let ``type check neg52`` () = singleNegTest (testConfig "typecheck/sigs") "neg52" + + [] + let ``type check neg53`` () = singleNegTest (testConfig "typecheck/sigs") "neg53" + + [] + let ``type check neg54`` () = singleNegTest (testConfig "typecheck/sigs") "neg54" + + [] + let ``type check neg55`` () = singleNegTest (testConfig "typecheck/sigs") "neg55" + + [] + let ``type check neg56`` () = singleNegTest (testConfig "typecheck/sigs") "neg56" + + [] + let ``type check neg56_a`` () = singleNegTest (testConfig "typecheck/sigs") "neg56_a" + + [] + let ``type check neg56_b`` () = singleNegTest (testConfig "typecheck/sigs") "neg56_b" + + [] + let ``type check neg57`` () = singleNegTest (testConfig "typecheck/sigs") "neg57" + + [] + let ``type check neg58`` () = singleNegTest (testConfig "typecheck/sigs") "neg58" + + [] + let ``type check neg59`` () = singleNegTest (testConfig "typecheck/sigs") "neg59" + + [] + let ``type check neg60`` () = singleNegTest (testConfig "typecheck/sigs") "neg60" + + [] + let ``type check neg61`` () = singleNegTest (testConfig "typecheck/sigs") "neg61" + + [] + let ``type check neg62`` () = singleNegTest (testConfig "typecheck/sigs") "neg62" + + [] + let ``type check neg63`` () = singleNegTest (testConfig "typecheck/sigs") "neg63" + + [] + let ``type check neg64`` () = singleNegTest (testConfig "typecheck/sigs") "neg64" + + [] + let ``type check neg65`` () = singleNegTest (testConfig "typecheck/sigs") "neg65" + + [] + let ``type check neg66`` () = singleNegTest (testConfig "typecheck/sigs") "neg66" + + [] + let ``type check neg67`` () = singleNegTest (testConfig "typecheck/sigs") "neg67" + + [] + let ``type check neg68`` () = singleNegTest (testConfig "typecheck/sigs") "neg68" + + [] + let ``type check neg69`` () = singleNegTest (testConfig "typecheck/sigs") "neg69" + + [] + let ``type check neg70`` () = singleNegTest (testConfig "typecheck/sigs") "neg70" + + [] + let ``type check neg71`` () = singleNegTest (testConfig "typecheck/sigs") "neg71" + + [] + let ``type check neg72`` () = singleNegTest (testConfig "typecheck/sigs") "neg72" [] - let ``type check neg94`` () = singleNegTest (testConfig "typecheck/sigs") "neg94" + let ``type check neg73`` () = singleNegTest (testConfig "typecheck/sigs") "neg73" + + [] + let ``type check neg74`` () = singleNegTest (testConfig "typecheck/sigs") "neg74" + + [] + let ``type check neg75`` () = singleNegTest (testConfig "typecheck/sigs") "neg75" + + [] + let ``type check neg76`` () = singleNegTest (testConfig "typecheck/sigs") "neg76" + + [] + let ``type check neg77`` () = singleNegTest (testConfig "typecheck/sigs") "neg77" + + [] + let ``type check neg78`` () = singleNegTest (testConfig "typecheck/sigs") "neg78" + + [] + let ``type check neg79`` () = singleNegTest (testConfig "typecheck/sigs") "neg79" + + [] + let ``type check neg80`` () = singleNegTest (testConfig "typecheck/sigs") "neg80" + + [] + let ``type check neg81`` () = singleNegTest (testConfig "typecheck/sigs") "neg81" + + [] + let ``type check neg82`` () = singleNegTest (testConfig "typecheck/sigs") "neg82" + + [] + let ``type check neg83`` () = singleNegTest (testConfig "typecheck/sigs") "neg83" + + [] + let ``type check neg84`` () = singleNegTest (testConfig "typecheck/sigs") "neg84" + + [] + let ``type check neg85`` () = singleNegTest (testConfig "typecheck/sigs") "neg85" + + [] + let ``type check neg86`` () = singleNegTest (testConfig "typecheck/sigs") "neg86" + + [] + let ``type check neg88`` () = singleNegTest (testConfig "typecheck/sigs") "neg88" + + [] + let ``type check neg89`` () = singleNegTest (testConfig "typecheck/sigs") "neg89" + + [] + let ``type check neg90`` () = singleNegTest (testConfig "typecheck/sigs") "neg90" + + [] + let ``type check neg91`` () = singleNegTest (testConfig "typecheck/sigs") "neg91" + + [] + let ``type check neg92`` () = singleNegTest (testConfig "typecheck/sigs") "neg92" + + [] + let ``type check neg93`` () = singleNegTest (testConfig "typecheck/sigs") "neg93" + + [] + let ``type check neg94`` () = singleNegTest (testConfig "typecheck/sigs") "neg94" + + [] + let ``type check neg95`` () = singleNegTest (testConfig "typecheck/sigs") "neg95" + + [] + let ``type check neg96`` () = singleNegTest (testConfig "typecheck/sigs") "neg96" + + [] + let ``type check neg97`` () = singleNegTest (testConfig "typecheck/sigs") "neg97" + + [] + let ``type check neg98`` () = singleNegTest (testConfig "typecheck/sigs") "neg98" + + [] + let ``type check neg99`` () = singleNegTest (testConfig "typecheck/sigs") "neg99" [] let ``type check neg100`` () = @@ -2374,14 +3072,179 @@ module TypecheckTests = let cfg = { cfg with fsc_flags = cfg.fsc_flags + " --warnon:3218" } singleNegTest cfg "neg100" + [] + let ``type check neg101`` () = singleNegTest (testConfig "typecheck/sigs") "neg101" + + [] + let ``type check neg102`` () = singleNegTest (testConfig "typecheck/sigs") "neg102" + + [] + let ``type check neg103`` () = singleNegTest (testConfig "typecheck/sigs") "neg103" + + [] + let ``type check neg104`` () = singleNegTest (testConfig "typecheck/sigs") "neg104" + + [] + let ``type check neg106`` () = singleNegTest (testConfig "typecheck/sigs") "neg106" + [] let ``type check neg107`` () = singleNegTest (testConfig "typecheck/sigs") "neg107" - + + [] + let ``type check neg108`` () = singleNegTest (testConfig "typecheck/sigs") "neg108" + + [] + let ``type check neg109`` () = singleNegTest (testConfig "typecheck/sigs") "neg109" + + [] + let ``type check neg110`` () = singleNegTest (testConfig "typecheck/sigs") "neg110" + + [] + let ``type check neg111`` () = singleNegTest (testConfig "typecheck/sigs") "neg111" + + [] + let ``type check neg112`` () = singleNegTest (testConfig "typecheck/sigs") "neg112" + + [] + let ``type check neg113`` () = singleNegTest (testConfig "typecheck/sigs") "neg113" + + [] + let ``type check neg114`` () = singleNegTest (testConfig "typecheck/sigs") "neg114" + + [] + let ``type check neg115`` () = singleNegTest (testConfig "typecheck/sigs") "neg115" + [] let ``type check neg116`` () = singleNegTest (testConfig "typecheck/sigs") "neg116" [] - let ``type check neg117`` () = singleNegTest (testConfig "typecheck/sigs") "neg117" + let ``type check neg117`` () = singleNegTest (testConfig "typecheck/sigs") "neg117" + + [] + let ``type check neg118`` () = singleNegTest (testConfig "typecheck/sigs") "neg118" + + [] + let ``type check neg119a`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "6.0" "neg119a" + + [] + let ``type check neg119b`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "7.0" "neg119b" + + [] + let ``type check neg120`` () = singleNegTest (testConfig "typecheck/sigs") "neg120" + + [] + let ``type check neg121`` () = singleNegTest (testConfig "typecheck/sigs") "neg121" + + [] + let ``type check neg122`` () = singleNegTest (testConfig "typecheck/sigs") "neg122" + + [] + let ``type check neg123`` () = singleNegTest (testConfig "typecheck/sigs") "neg123" + + [] + let ``type check neg124`` () = singleNegTest (testConfig "typecheck/sigs") "neg124" + + [] + let ``type check neg125`` () = singleNegTest (testConfig "typecheck/sigs") "neg125" + + [] + let ``type check neg126`` () = singleNegTest (testConfig "typecheck/sigs") "neg126" + + [] + let ``type check neg127`` () = singleNegTest (testConfig "typecheck/sigs") "neg127" + + [] + let ``type check neg128`` () = singleNegTest (testConfig "typecheck/sigs") "neg128" + + [] + let ``type check neg129`` () = singleNegTest (testConfig "typecheck/sigs") "neg129" + + [] + let ``type check neg130`` () = singleNegTest (testConfig "typecheck/sigs") "neg130" + + [] + let ``type check neg131`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "6.0" "neg131" + + [] + let ``type check neg132`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "5.0" "neg132" + + [] + let ``type check neg133`` () = singleNegTest (testConfig "typecheck/sigs") "neg133" + + [] + let ``type check neg_anon_1`` () = singleNegTest (testConfig "typecheck/sigs") "neg_anon_1" + + [] + let ``type check neg_anon_2`` () = singleNegTest (testConfig "typecheck/sigs") "neg_anon_2" + + [] + let ``type check neg_issue_3752`` () = singleNegTest (testConfig "typecheck/sigs") "neg_issue_3752" + + [] + let ``type check neg_byref_1`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_1" + + [] + let ``type check neg_byref_2`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_2" + + [] + let ``type check neg_byref_3`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_3" + + [] + let ``type check neg_byref_4`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_4" + + [] + let ``type check neg_byref_5`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_5" + + [] + let ``type check neg_byref_6`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_6" + + [] + let ``type check neg_byref_7`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_7" + + [] + let ``type check neg_byref_8`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_8" + + [] + let ``type check neg_byref_10`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_10" + + [] + let ``type check neg_byref_11`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_11" + + [] + let ``type check neg_byref_12`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_12" + + [] + let ``type check neg_byref_13`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_13" + + [] + let ``type check neg_byref_14`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_14" + + [] + let ``type check neg_byref_15`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_15" + + [] + let ``type check neg_byref_16`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_16" + + [] + let ``type check neg_byref_17`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_17" + + [] + let ``type check neg_byref_18`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_18" + + [] + let ``type check neg_byref_19`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_19" + + [] + let ``type check neg_byref_20`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_20" + + [] + let ``type check neg_byref_21`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_21" + + [] + let ``type check neg_byref_22`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_22" + + [] + let ``type check neg_byref_23`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_23" [] module FscTests = @@ -2501,4 +3364,40 @@ namespace CST.RI.Anshun fileVersionInfo.ProductVersion |> Assert.areEqual expected -#endif \ No newline at end of file +#endif + +#if !NETCOREAPP +[] +module OverloadResolution = + module ``fsharpqa migrated tests`` = + let [] ``Conformance\Expressions\SyntacticSugar (E_Slices01_fs)`` () = singleNegTest (testConfig "conformance/expressions/syntacticsugar") "E_Slices01" + let [] ``Conformance\Expressions\Type-relatedExpressions (E_RigidTypeAnnotation03_fsx)`` () = singleNegTest (testConfig "conformance/expressions/type-relatedexpressions") "E_RigidTypeAnnotation03" + let [] ``Conformance\Inference (E_OneTypeVariable03_fs)`` () = singleNegTest (testConfig "conformance/inference") "E_OneTypeVariable03" + let [] ``Conformance\Inference (E_OneTypeVariable03rec_fs)`` () = singleNegTest (testConfig "conformance/inference") "E_OneTypeVariable03rec" + let [] ``Conformance\Inference (E_TwoDifferentTypeVariablesGen00_fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoDifferentTypeVariablesGen00" + let [] ``Conformance\Inference (E_TwoDifferentTypeVariables01_fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoDifferentTypeVariables01" + let [] ``Conformance\Inference (E_TwoDifferentTypeVariables01rec_fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoDifferentTypeVariables01rec" + let [] ``Conformance\Inference (E_TwoDifferentTypeVariablesGen00rec_fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoDifferentTypeVariablesGen00rec" + let [] ``Conformance\Inference (E_TwoEqualTypeVariables02_fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoEqualTypeVariables02" + let [] ``Conformance\Inference (E_TwoEqualYypeVariables02rec_fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoEqualYypeVariables02rec" + let [] ``Conformance\Inference (E_LeftToRightOverloadResolution01_fs)`` () = singleNegTest (testConfig "conformance/inference") "E_LeftToRightOverloadResolution01" + let [] ``Conformance\WellFormedness (E_Clashing_Values_in_AbstractClass01_fs)`` () = singleNegTest (testConfig "conformance/wellformedness") "E_Clashing_Values_in_AbstractClass01" + let [] ``Conformance\WellFormedness (E_Clashing_Values_in_AbstractClass03_fs)`` () = singleNegTest (testConfig "conformance/wellformedness") "E_Clashing_Values_in_AbstractClass03" + let [] ``Conformance\WellFormedness (E_Clashing_Values_in_AbstractClass04_fs)`` () = singleNegTest (testConfig "conformance/wellformedness") "E_Clashing_Values_in_AbstractClass04" + // note: this test still exist in fsharpqa to assert the compiler doesn't crash + // the part of the code generating a flaky error due to https://github.com/dotnet/fsharp/issues/6725 + // is elided here to focus on overload resolution error messages + let [] ``Conformance\LexicalAnalysis\SymbolicOperators (E_LessThanDotOpenParen001_fs)`` () = singleNegTest (testConfig "conformance/lexicalanalysis") "E_LessThanDotOpenParen001" + + module ``error messages using BCL``= + let [] ``neg_System_Convert_ToString_OverloadList``() = singleNegTest (testConfig "typecheck/overloads") "neg_System.Convert.ToString.OverloadList" + let [] ``neg_System_Threading_Tasks_Task_Run_OverloadList``() = singleNegTest (testConfig "typecheck/overloads") "neg_System.Threading.Tasks.Task.Run.OverloadList" + let [] ``neg_System_Drawing_Graphics_DrawRectangleOverloadList_fsx``() = singleNegTest (testConfig "typecheck/overloads") "neg_System.Drawing.Graphics.DrawRectangleOverloadList" + + module ``ad hoc code overload error messages``= + let [] ``neg_many_many_overloads`` () = singleNegTest (testConfig "typecheck/overloads") "neg_many_many_overloads" + let [] ``neg_interface_generics`` () = singleNegTest (testConfig "typecheck/overloads") "neg_interface_generics" + let [] ``neg_known_return_type_and_known_type_arguments`` () = singleNegTest (testConfig "typecheck/overloads") "neg_known_return_type_and_known_type_arguments" + let [] ``neg_generic_known_argument_types`` () = singleNegTest (testConfig "typecheck/overloads") "neg_generic_known_argument_types" + let [] ``neg_tupled_arguments`` () = singleNegTest (testConfig "typecheck/overloads") "neg_tupled_arguments" +#endif