From 6c20a3b0f743d805271ce8698854292252365e56 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 9 Jan 2020 12:30:01 +0000 Subject: [PATCH 1/4] document baseline update and allow tests to run in debug mode without assert --- DEVGUIDE.md | 11 +++++++++++ src/fsharp/IlxGen.fs | 1 - tests/fsharpqa/testenv/bin/runall.pl | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/DEVGUIDE.md b/DEVGUIDE.md index 5c6f51c3c8e..4929c2fad27 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -113,6 +113,17 @@ If your changes involve modifying the list of language keywords in any way, (e.g This only works on Windows/.NETStandard framework, so changing this from any other platform requires editing and syncing all of the XLF files manually. +## Updating baselines in tests + +Some tests use "baseline" files. There is sometimes a way to update these baselines en-masse in your local build, +useful when some change affects many baselines. For example, in the 'fsharpqa' tests the baselines +are updated using scripts or utilities that allow the following environment variable to be set: + +``` +set TEST_UPDATE_BSL=1 +``` + + ## Developing the F# tools for Visual Studio As you would expect, doing this requires both Windows and Visual Studio are installed. diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index 18be85e72a3..9534358624d 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -5089,7 +5089,6 @@ and GenDecisionTreeSwitch cenv cgbuf inplabOpt stackAtTargets eenv e cases defau | _ -> error(InternalError("these matches should never be needed", switchm)) and GenDecisionTreeCases cenv cgbuf stackAtTargets eenv defaultTargetOpt targets repeatSP targetInfos sequel caseLabels cases (contf: Zmap<_,_> -> FakeUnit) = - assert(cgbuf.GetCurrentStack() = stackAtTargets) // cgbuf stack should be unchanged over tests. [bug://1750]. match defaultTargetOpt with | Some defaultTarget -> diff --git a/tests/fsharpqa/testenv/bin/runall.pl b/tests/fsharpqa/testenv/bin/runall.pl index 045a0076ded..53be793355d 100644 --- a/tests/fsharpqa/testenv/bin/runall.pl +++ b/tests/fsharpqa/testenv/bin/runall.pl @@ -147,7 +147,7 @@ my $FILE_ERROR_EXITVAL = 5; my $OTHER_ERROR_EXITVAL = 9; -my $perl = $Config{perlpath}; +my $perl = $^X; BEGIN { @required_mods = ("Win32\\Process.pm"); From 225e8a9e055dbce04de5ebb62551bf8e6d28eac6 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 10 Jan 2020 12:49:22 +0000 Subject: [PATCH 2/4] Update DEVGUIDE.md --- DEVGUIDE.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DEVGUIDE.md b/DEVGUIDE.md index 4929c2fad27..c762e7821ef 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -123,6 +123,9 @@ are updated using scripts or utilities that allow the following environment vari set TEST_UPDATE_BSL=1 ``` +Updating baselines en-masse should be done very carefully and subject to careful code review. Where possible the +compiler change causing the en-masse update should be isolated and minimized so it is obvious at review time that no other +code generation chagnes will be caused. ## Developing the F# tools for Visual Studio From 50731e097f42d833aad24809ecc7edc071df8028 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 10 Jan 2020 12:51:46 +0000 Subject: [PATCH 3/4] Update DEVGUIDE.md --- DEVGUIDE.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/DEVGUIDE.md b/DEVGUIDE.md index c762e7821ef..5c6f51c3c8e 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -113,20 +113,6 @@ If your changes involve modifying the list of language keywords in any way, (e.g This only works on Windows/.NETStandard framework, so changing this from any other platform requires editing and syncing all of the XLF files manually. -## Updating baselines in tests - -Some tests use "baseline" files. There is sometimes a way to update these baselines en-masse in your local build, -useful when some change affects many baselines. For example, in the 'fsharpqa' tests the baselines -are updated using scripts or utilities that allow the following environment variable to be set: - -``` -set TEST_UPDATE_BSL=1 -``` - -Updating baselines en-masse should be done very carefully and subject to careful code review. Where possible the -compiler change causing the en-masse update should be isolated and minimized so it is obvious at review time that no other -code generation chagnes will be caused. - ## Developing the F# tools for Visual Studio As you would expect, doing this requires both Windows and Visual Studio are installed. From d571a32dbbd4c6a7877d814351297c77f86fb6c5 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 10 Jan 2020 12:52:57 +0000 Subject: [PATCH 4/4] Update readme.md --- tests/fsharpqa/readme.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/fsharpqa/readme.md b/tests/fsharpqa/readme.md index 88bda09b363..ecdcd63bde5 100644 --- a/tests/fsharpqa/readme.md +++ b/tests/fsharpqa/readme.md @@ -32,3 +32,17 @@ A convenience "fsharpqafiles.csproj" project is located in the fsharp.sln soluti (TODO, provide some guidance about how to define env.lst files) +## Updating baselines in tests + +Some tests use "baseline" files. There is sometimes a way to update these baselines en-masse in your local build, +useful when some change affects many baselines. For example, in the 'fsharpqa' tests the baselines +are updated using scripts or utilities that allow the following environment variable to be set: + +``` +set TEST_UPDATE_BSL=1 +``` + +Updating baselines en-masse should be done very carefully and subject to careful code review. Where possible the +compiler change causing the en-masse update should be isolated and minimized so it is obvious at review time that no other +code generation chagnes will be caused. +