Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit27333a7

Browse files
committed
Various cleanup of RunTests.cmd, in particular setting all suites to write similarly-named log files directly to \tests. Also updating the docs and adding .gitignore for test logs. (changeset 1219334)
1 parentac90475 commit27333a7

File tree

4 files changed

+61
-23
lines changed

4 files changed

+61
-23
lines changed

‎DEVGUIDE.html‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -414,18 +414,17 @@ <h3>3. Verify the F# compiler build with simple smoke test</h3>
414414
del /q FSharp.Core.dll
415415
</pre>
416416

417-
<h3>4. Compiler Tests</h3>
418-
<p>Below are the very basic commands you can use to execute the included tests. For more details on how to run, debug, and write tests,
419-
see<ahref="tests\TESTGUIDE.html">tests\TESTGUIDE.html</a>.</p>
420-
<li>Building F# Core Unit Tests for .NET 4.0</li>
417+
<h3>4. Building F# Core Unit Tests for .NET 4.0</h3>
418+
421419
<p>This uses the proto compiler to build the unit tests that check some parts of FSharp.Core.dll and FSharp.Compiler.dll. You must have NUnit installed.</p>
422420
<pre>
423-
msbuild fsharp-library-unittests-build.proj /p:TargetFramework=net40
424-
nunit.exe ..\Debug\net40\bin\FSharp.Core.Unittests.dll</pre>
425-
426-
<li>Running Compiler tests on Windows</li>
421+
msbuild fsharp-library-unittests-build.proj /p:TargetFramework=net40
422+
</pre>
423+
<p><b>Running Tests</b>
424+
<p>Below are the very basic commands you can use to execute the included unit tests and general compiler/runtime tests.
425+
For more details on how to run, debug, and write tests, see<ahref="tests\TESTGUIDE.html">tests\TESTGUIDE.html</a>.</p>
427426

428-
<p>There are language tests under the<tt>tests</tt> directory. The test apparatus uses batch files, assuming perl is installed. You can run these on Windows using:</p>
427+
<p>There are language tests under the<tt>tests</tt> directory. The test apparatus uses batch files, assuming perl is installed. You can run these on Windows using:</p>
429428
<pre>
430429
cd tests
431430
Runtests.cmd fsharp

‎tests/.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FSharp_*
2+
FSharpQA_*
3+
CoreUnit_*

‎tests/RunTests.cmd‎

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ if not "%_tmp%" == "" set TTAGS_ARG=-ttags:%_tmp:"=%
99
rem "nottags" indicates which test areas/test cases will NOT be run, based on the tags in the test.lst and env.lst files
1010
setNO_TTAGS_ARG=-nottags:ReqPP
1111
set_tmp=%3
12-
ifnot"%3"==""setNO_TTAGS_ARG=-nottags:ReqPP,%_tmp:"=%
12+
ifnot"%_tmp%"==""setNO_TTAGS_ARG=-nottags:ReqPP,%_tmp:"=%
1313

1414
rem Use commented line to enable parallel execution of tests
15-
setPARALLEL_ARG=
16-
setPARALLEL_ARG=-procs:3
15+
rem set PARALLEL_ARG=-procs:3
1716

1817
rem This can be set to 1 to reduce the number of permutations used and avoid some of the extra-time-consuming tests
1918
setREDUCED_RUNTIME=1
@@ -26,18 +25,29 @@ rem set HOSTED_COMPILER=1
2625

2726
if /I"%1"=="fsharp" (goto :FSHARP)
2827
if /I"%1"=="fsharpqa" (goto :FSHARPQA)
28+
if /I"%1"=="coreunit" (goto :COREUNIT)
2929

3030
echo Usage:
3131
echo.
32-
echo RunTests.cmd^<fsharp^|fsharpqa^>
32+
echo RunTests.cmd^<fsharp^|fsharpqa^|coreunit^>
3333
echo.
3434
exit /b1
3535

3636

3737
:FSHARP
3838

39-
echo perl%~dp0\fsharpqa\testenv\bin\runall.pl%TTAGS_ARG%%NO_TTAGS_ARG%%PARALLEL_ARG%
40-
perl%~dp0\fsharpqa\testenv\bin\runall.pl%TTAGS_ARG%%NO_TTAGS_ARG%%PARALLEL_ARG%
39+
setRESULTFILE=FSharp_Results.log
40+
setFAILFILE=FSharp_Failures.log
41+
setFAILENV=FSharp_Failures
42+
43+
where.exe perl>NUL2>NUL
44+
iferrorlevel1 (
45+
echo Error: perl is not in the PATH
46+
exit /b1
47+
)
48+
49+
echo perl%~dp0\fsharpqa\testenv\bin\runall.pl -resultsroot%~dp0 -results%RESULTFILE% -log%FAILFILE% -fail%FAILENV% -cleanup:yes%TTAGS_ARG%%NO_TTAGS_ARG%%PARALLEL_ARG%
50+
perl%~dp0\fsharpqa\testenv\bin\runall.pl -resultsroot%~dp0 -results%RESULTFILE% -log%FAILFILE% -fail%FAILENV% -cleanup:yes%TTAGS_ARG%%NO_TTAGS_ARG%%PARALLEL_ARG%
4151
goto :EOF
4252

4353

@@ -70,10 +80,36 @@ set PATH=%PATH%;%CORDIR%
7080

7181
ifnotexist%WINDIR%\Microsoft.NET\Framework\v2.0.50727\mscorlib.dllsetNO_TTAGS_ARG=%NO_TTAGS_ARG%,Req20
7282

73-
pushd%~dp0\fsharpqa\source
83+
setRESULTFILE=FSharpQA_Results.log
84+
setFAILFILE=FSharpQA_Failures.log
85+
setFAILENV=FSharpQA_Failures
7486

75-
echo perl%~dp0\fsharpqa\testenv\bin\runall.pl%TTAGS_ARG%%NO_TTAGS_ARG%%PARALLEL_ARG%
76-
perl%~dp0\fsharpqa\testenv\bin\runall.pl%TTAGS_ARG%%NO_TTAGS_ARG%%PARALLEL_ARG%
87+
where.exe perl>NUL2>NUL
88+
iferrorlevel1 (
89+
echo Error: perl is not in the PATH
90+
exit /b1
91+
)
92+
93+
pushd%~dp0\fsharpqa\source
94+
echo perl%~dp0\fsharpqa\testenv\bin\runall.pl -resultsroot%~dp0 -results%RESULTFILE% -log%FAILFILE% -fail%FAILENV% -cleanup:yes%TTAGS_ARG%%NO_TTAGS_ARG%%PARALLEL_ARG%
95+
perl%~dp0\fsharpqa\testenv\bin\runall.pl -resultsroot%~dp0 -results%RESULTFILE% -log%FAILFILE% -fail%FAILENV% -cleanup:yes%TTAGS_ARG%%NO_TTAGS_ARG%%PARALLEL_ARG%
7796

7897
popd
7998
goto :EOF
99+
100+
:COREUNIT
101+
102+
setXMLFILE=CoreUnit_Xml.xml
103+
setOUTPUTFILE=CoreUnit_Output.log
104+
setERRORFILE=CoreUnit_Error.log
105+
setFILEDIR=%~dp0
106+
107+
where.exe nunit-console.exe>NUL2>NUL
108+
iferrorlevel1 (
109+
echo Error: nunit-console.exe is not in the PATH
110+
exit /b1
111+
)
112+
echo nunit-console.exe /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%FILEDIR%%~dp0..\Debug\net40\bin\FSharp.Core.Unittests.dll
113+
nunit-console.exe /nologo /result=%XMLFILE% /output=%OUTPUTFILE% /err=%ERRORFILE% /work=%FILEDIR%%~dp0..\Debug\net40\bin\FSharp.Core.Unittests.dll
114+
115+
goto :EOF

‎tests/TESTGUIDE.html‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,14 +331,14 @@ <h3>Test Suites</h3>
331331

332332
<p>The script<tt>tests\RunTests.cmd</tt> 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:
333333
<pre>
334-
RunTests.cmd fsharp
335-
RunTests.cmd fsharpqa
336-
RunTests.cmd coreunit
334+
RunTests.cmd fsharp
335+
RunTests.cmd fsharpqa
336+
RunTests.cmd coreunit
337337
</pre>
338338

339339
<p><tt>RunTests.cmd</tt> 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.
340340

341-
<p>If anytestcases fail, the FSharpandFSharpQA suites willdrop failure detail logs to<tt>tests\runpl.log</tt>or<tt>tests\fsharpqa\source\runpl.log</tt>,respectively. If execution is halted by the user before completion, the failures file name is instead<tt>xrunpl.log</tt>.
341+
<p>Alltestexecution logsandresult files willbe dropped into the<tt>tests</tt>folder, and have file names matching<tt>FSharp_*.*</tt>,<tt>FSharpQA_*.*</tt>, or<tt>CoreUnit_*.*</tt>.
342342

343343
<p><tt>RunTests.cmd</tt> is mostly just a simple wrapper over<tt>tests\fsharpqa\testenv\bin\RunAll.pl</tt>, which has capabilities not discussed here. More advanced test execution scenarios can be achieved by invoking<tt>RunAll.pl</tt> directly. Run<tt>perl tests\fsharpqa\testenv\bin\RunAll.pl -?</tt> to see a full list of flags and options.
344344
<h3>More Details</h3>
@@ -366,6 +366,6 @@ <h3>More Details</h3>
366366
<h3>Other Tips</h3>
367367
<ul>
368368
<li>NGen-ing the F# bits (fsc, fsi, FSharp.Core, etc) will result in tests executing much faster</li>
369-
<li>Tests from the FSharp and FSharpQA suites can be run in parallel using the<tt>-procs:N</tt> argument to<tt>RunAll.pl</tt>, or by uncommenting the relevant line in<tt>RunTests.cmd</tt>.</li>
369+
<li>Tests from the FSharp and FSharpQA suites can be run in parallel using the<tt>-procs:N</tt> argument to<tt>RunAll.pl</tt>, or by uncommenting the relevant line in<tt>RunTests.cmd</tt> (look for PARALLEL_ARG).</li>
370370
</ul>
371371
</body>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp