You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
add "Other Tips" notes to TESTGUIDE.md and a script to update baseline files under test/fsharp (#5117)
* * helper script to update baseline files under tests/fsharp* rework "Other Tips" section to expand on the system of baselines files used in FSharp Test Suite* add the script to the project where it is most likely to be useful
Copy file name to clipboardExpand all lines: TESTGUIDE.md
+23-6Lines changed: 23 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,11 @@ The F# tests are split as follows:
39
39
This is compiled using[tests\fsharp\FSharp.Tests.FSharpSuite.fsproj](tests/fsharp/FSharp.Tests.FSharpSuite.fsproj) to a unit test DLL which acts as a driver script. Each individual test is an NUnit test case, and so you can run it like any other NUnit test.
40
40
41
41
Tests are grouped in folders per area. Each test compiles and executes a`test.fsx|fs` file in its folder using some combination of compiler or FSI flags specified in the FSharpSuite test project.
42
-
If the compilation and execution encounter no errors, the test is considered to have passed.
42
+
If the compilation and execution encounter no errors, the test is considered to have passed.
43
+
44
+
There are also negative tests checking code expected to fail compilation.
45
+
46
+
See note about baseline under "Other Tips" bellow for tests checking expectations against "baseline" files.
43
47
44
48
###FSharpQA Suite
45
49
@@ -81,9 +85,22 @@ All test execution logs and result files will be dropped into the `tests\TestRes
81
85
82
86
###Other Tips
83
87
84
-
* Run as Administrator, or a handful of tests will fail
88
+
####Run as Administrator
89
+
90
+
Do this, or a handful of tests will fail.
91
+
92
+
####Making the tests run faster
93
+
94
+
* NGen-ing the F# bits (fsc, fsi, FSharp.Core, etc) will result in tests executing much faster. Make sure you run`src\update.cmd` with the`-ngen` flag before running tests.
95
+
* The FSharp and FSharpQA suites will run test cases in parallel by default. You can comment out the relevant line (look for`PARALLEL_ARG`) to disable this.
96
+
* By default, tests from the FSharpQA suite are run using a persistent, hosted version of the compiler. This speeds up test execution, as there is no need for the`fsc.exe` process to spin up repeatedly. To disable this, uncomment the relevant line (look for`HOSTED_COMPILER`).
97
+
98
+
####Test outcome against baseline
99
+
100
+
FSharp Test Suite works with couples of .bsl (or .bslpp) files considered "expected" and called baseline, those are matched against the actual output which resides under .err or .vserr files of same name at the during test execution.
101
+
102
+
When working on changes generating conflicts with the baseline, you can use the helper script[tests/fsharp/update.base.line.with.actuals.fsx](tests/fsharp/update.base.line.with.actuals.fsx) to update all .bsl based on the matching .err file.
103
+
104
+
When doing so keep in mind to carefully review the diff before comitting updated baseline files.
85
105
86
-
* Making the tests run faster
87
-
* NGen-ing the F# bits (fsc, fsi, FSharp.Core, etc) will result in tests executing much faster. Make sure you run`src\update.cmd` with the`-ngen` flag before running tests.
88
-
* The FSharp and FSharpQA suites will run test cases in parallel by default. You can comment out the relevant line (look for`PARALLEL_ARG`) to disable this.
89
-
* By default, tests from the FSharpQA suite are run using a persistent, hosted version of the compiler. This speeds up test execution, as there is no need for the`fsc.exe` process to spin up repeatedly. To disable this, uncomment the relevant line (look for`HOSTED_COMPILER`).
106
+
.bslpp (baseline pre-process) files are specially designed to enable substitution of certain tokens to generate the .bsl file. You can look further about the pre-processing logic under[tests/fsharp/TypeProviderTests.fs](tests/fsharp/TypeProviderTests.fs), this is used only for type provider tests for now.