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
<h3>2. Building an F# (Debug) compiler for .NET 4.0 profile</h3>
@@ -433,9 +434,10 @@ <h3>5. Building F# Core Unit Tests for .NET 4.0</h3>
433
434
<p>There are language tests under the<code>tests</code> directory. The test apparatus uses batch files, assuming<ahref="http://www.perl.org/get.html">Perl</a> (ActiveState Perl 5.16.3 is known to work fine) is installed. You can run these on Windows using:</p>
434
435
<pre>
435
436
cd ..\tests
436
-
Runtests.cmd fsharp
437
-
Runtests.cmd fsharpqa
438
-
Runtests.cmd coreunit</pre>
437
+
BuildTestTools.cmd debug
438
+
Runtests.cmd debug fsharp
439
+
Runtests.cmd debug fsharpqa
440
+
Runtests.cmd debug coreunit</pre>
439
441
440
442
<h3>6. [Alternate Build Instructions] Build an optimised F# (Release) compiler for .NET 4.0 profile</h3>
Copy file name to clipboardExpand all lines: tests/TESTGUIDE.html
+27-14Lines changed: 27 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -327,22 +327,29 @@ <h3>Test Suites</h3>
327
327
</ul>
328
328
<p>Perl and NUnit should be included in the %PATH% to make execution easiest. It is also recommended that you run tests from an elevated command prompt, as there are a couple of test cases which modify the GAC, and this requires administrative privileges.
329
329
330
-
<p>Before running tests, make sure you have successfully built allof the following:
330
+
<p>Before running tests, make sure you have successfully built allrequired projects, both product and test:
331
331
<ul>
332
-
<li><code>src\fsharp-compiler-build.proj /p:TargetFramework=net40</code> to generate the compiler, libraries, and interative for .NET 4</li>
333
-
<li><code>src\fsharp-library-build.proj /p:TargetFramework=net20</code> to generate the libraries for .NET 2</li>
334
-
<li><code>src\fsharp-tyeproviders-build.proj /p:TargetFramework=net40</code> to generate FSharp.Data.TypeProviders.dll for .NET 4</li>
332
+
<li>From the<code>src</code> directory</li>
333
+
<ul>
334
+
<li><code>msbuild fsharp-compiler-build.proj /p:TargetFramework=net40 /p:Configuration=<debug|release></code> to generate the compiler, libraries, and interative for .NET 4</li>
335
+
<li><code>msbuild fsharp-library-build.proj /p:TargetFramework=net20 /p:Configuration=<debug|release></code> to generate the libraries for .NET 2</li>
336
+
<li><code>msbuild fsharp-library-build.proj /p:TargetFramework=portable47 /p:Configuration=<debug|release></code> to generate the libraries for .NET portable profile 47</li>
337
+
<li><code>msbuild fsharp-tyeproviders-build.proj /p:TargetFramework=net40 /p:Configuration=<debug|release></code> to generate FSharp.Data.TypeProviders.dll for .NET 4</li>
338
+
<li><code>update.cmd <debug|release> -ngen</code> to update the GAC, add strong name validation skips, and ngen latest-built binaries</li>
339
+
</ul>
340
+
<li>From the<code>tests</code> directory</li>
341
+
<ul>
342
+
<li><code>BuildTestTools.cmd <debug|release></code> to build and binplace tools used during testing</li>
343
+
</ul>
335
344
</ul>
336
345
337
-
<p>You should also run<code>src\update.cmd <debug|release> -ngen</code> before running tests. This script will perform GAC and strong name validation updates required for the tests to work, as well as NGen-ing components so that tests run more quickly.
338
-
339
346
<p><h3>Running Tests</h3>
340
347
341
348
<p>The script<code>tests\RunTests.cmd</code> has been provided to make execution of the above 3 suites very simple. You can kick off a full test run of any of the above suites like this:
342
349
<pre>
343
-
RunTests.cmd fsharp [tags to run] [tags not to run]
344
-
RunTests.cmd fsharpqa [tags to run] [tags not to run]
345
-
RunTests.cmd coreunit
350
+
RunTests.cmd<debug|release>fsharp [tags to run] [tags not to run]
351
+
RunTests.cmd<debug|release>fsharpqa [tags to run] [tags not to run]
352
+
RunTests.cmd<debug|release>coreunit
346
353
</pre>
347
354
348
355
<p><code>RunTests.cmd</code> sets a handful of environment variables which allow for the tests to work, then puts together and executes the appropriate command line to start the specified test suite.
@@ -357,17 +364,17 @@ <h3>Test Suites</h3>
357
364
358
365
<p>Tags are in the left column, paths to to corresponding test folders are in the right column. If no tags are specified to<code>RunTests.cmd</code>, all tests will be run.
359
366
360
-
<p>If you want to re-run a particular test area, the easiest way to do so is to set a temporary tag for that area in test.lst (e.g. "RERUN"), then call<code>RunTests.cmd <fsharp|fsharpqa> RERUN</code>.
367
+
<p>If you want to re-run a particular test area, the easiest way to do so is to set a temporary tag for that area in test.lst (e.g. "RERUN"), then call<code>RunTests.cmd <debug|release> <fsharp|fsharpqa> RERUN</code>.
361
368
362
-
<p>If you want to specify multiple tags to run or not run, pass them comma-delimited and enclosed in double quotes, e.g.<code>RunTests.cmd fsharp "Core01,Core02"</code>. From a Powershell environment, make sure the double quotes are passed literally, e.g.<code>.\RunTests.cmd fsharp '"Core01,Core02"'</code> or<code>.\RunTests.cmd --% fsharp "Core01,Core02"</code>.
369
+
<p>If you want to specify multiple tags to run or not run, pass them comma-delimited and enclosed in double quotes, e.g.<code>RunTests.cmddebugfsharp "Core01,Core02"</code>. From a Powershell environment, make sure the double quotes are passed literally, e.g.<code>.\RunTests.cmddebugfsharp '"Core01,Core02"'</code> or<code>.\RunTests.cmd --% debug fsharp "Core01,Core02"</code>.
363
370
364
371
<p><code>RunTests.cmd</code> is mostly just a simple wrapper over<code>tests\fsharpqa\testenv\bin\RunAll.pl</code>, which has capabilities not discussed here. More advanced test execution scenarios can be achieved by invoking<code>RunAll.pl</code> directly. Run<code>perl tests\fsharpqa\testenv\bin\RunAll.pl -?</code> to see a full list of flags and options.
365
372
366
373
<h3>More Details</h3>
367
374
368
375
<p><b>FSharp Suite</b>
369
376
370
-
<p>These tests are fairly easy to execute directly when needed, without help from<code>RunTests.cmd</code> or<code>RunAll.pl</code>. Test area directories in this suite will have either a<code>Build.bat</code> script, a<code>Run.bat</code> script, or both. To run the test area, you can simply call<code>Build.bat</code> (if it exists), then<code>Run.bat</code> (if it exists). In this way it is simple to re-run a specific test area by itself.
377
+
<p>These tests are fairly easy to execute directly when needed, without help from<code>RunTests.cmd</code> or<code>RunAll.pl</code>. Test area directories in this suite will have either a<code>Build.bat</code> script, a<code>Run.bat</code> script, or both. To run the test area, you can simply call<code>Build.bat</code> (if it exists), then<code>Run.bat</code> (if it exists). In this way it is simple to re-run a specific test area by itself.<b><fontcolor="red">NOTE:</font></b> If you are re-running tests manually like this, make sure you set environment variables similarly to how RunTests.cmd does (e.g. %FSCBINPATH%), to ensure tests are running against your open-built bits, and not against a Visual Studio deployment of F#.
371
378
372
379
<p><code>Build.bat</code> and<code>Run.bat</code> scripts typically invoke<code>tests\Config.bat</code> to pick up a variety of environment variables and configuration options, then invoke<code>tests\fsharp\single-test-build.bat</code> and<code>tests\fsharp\single-test-run.bat</code>. This will compile and execute the local<code>test.fsx</code> file using some combination of compiler or fsi flags. If the compilation and execution encounter no errors, the test is considered to have passed.
373
380
@@ -383,7 +390,13 @@ <h3>More Details</h3>
383
390
384
391
<h3>Other Tips</h3>
385
392
<ul>
386
-
<li>NGen-ing the F# bits (fsc, fsi, FSharp.Core, etc) will result in tests executing much faster</li>
387
-
<li>Tests from the FSharp and FSharpQA suites can be run in parallel using the<code>-procs:N</code> argument to<code>RunAll.pl</code>, or by uncommenting the relevant line in<code>RunTests.cmd</code> (look for PARALLEL_ARG).</li>
393
+
<li>Run as admin, or a handful of tests will fail</li>
394
+
<li><b>Don't</b> run tests from a Visual Studio developer command prompt. Running from a developer command prompt will put Visual Studio F# tools on the %PATH%, which is not desirable when testing open F# tools.</li>
395
+
<li>Making the tests run faster</li>
396
+
<ul>
397
+
<li>NGen-ing the F# bits (fsc, fsi, FSharp.Core, etc) will result in tests executing much faster. Make sure you run<code>src\update.cmd</code> with the<code>-ngen</code> flag before running tests.</li>
398
+
<li>Tests can be run in parallel by uncommenting the relevant line in<code>RunTests.cmd</code> (look for PARALLEL_ARG).</li>
399
+
<li>Tests from the FSharpQA suite can 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 enable this, uncomment the relevant line in<code>RunTests.cmd</code> (look for HOSTED_COMPILER).</li>