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

Commit5b4b633

Browse files
smoothdeveloperKevinRansom
authored andcommitted
update testguide.md relative to fsharpqa tests (#5160)
* Adjustments to TESTGUIDE.md relative to usage of fsharpqa testsTentative to add a .fsx test runner calling into perl, idea will be, once it is having tests pass, to make the script modify the test list file to tag arbitrary tests and run only those, and then revert the tagging. I'm not sure if this can be made to work consistently but it is worth trying.* make run.fsharpqa.test.fsx work* * add tests/fsharpqa/readme.md file, giving overview of the suite, description of file formats and describing a workflow when adding / fixing F# QA tests* mention above readme.md in TESTGUIDE.md* add helper project to FSharp.sln to navigate among the F# QA test files (find env.lst, source and log files, etc.)
1 parent3e53374 commit5b4b633

File tree

5 files changed

+121
-5
lines changed

5 files changed

+121
-5
lines changed

‎FSharp.sln‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{B8DDA694
3939
EndProject
4040
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") ="Libraries","Libraries","{3058BC79-8E79-4645-B05D-48CC182FA8A6}"
4141
EndProject
42+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") ="fsharpqafiles","tests\fsharpqa\fsharpqafiles.csproj","{AAAAD274-696A-49EC-AAAA-F870BE91AAAA}"
43+
EndProject
4244
Global
4345
GlobalSection(SolutionConfigurationPlatforms) =preSolution
4446
Debug|Any CPU=Debug|Any CPU
@@ -181,6 +183,17 @@ Global
181183
{88E2D422-6852-46E3-A740-83E391DC7973}.Release|Any CPU.Build.0=Release|Any CPU
182184
{88E2D422-6852-46E3-A740-83E391DC7973}.Release|x86.ActiveCfg=Release|Any CPU
183185
{88E2D422-6852-46E3-A740-83E391DC7973}.Release|x86.Build.0=Release|Any CPU
186+
{AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Debug|Any CPU.ActiveCfg=Debug|x86
187+
{AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Debug|x86.ActiveCfg=Debug|x86
188+
{AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Debug|x86.Build.0=Debug|x86
189+
{AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Proto|Any CPU.ActiveCfg=Debug|x86
190+
{AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Proto|Any CPU.Build.0=Debug|x86
191+
{AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Proto|x86.ActiveCfg=Debug|x86
192+
{AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Proto|x86.Build.0=Debug|x86
193+
{AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Release|Any CPU.ActiveCfg=Debug|x86
194+
{AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Release|Any CPU.Build.0=Debug|x86
195+
{AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Release|x86.ActiveCfg=Debug|x86
196+
{AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Release|x86.Build.0=Debug|x86
184197
EndGlobalSection
185198
GlobalSection(SolutionProperties) =preSolution
186199
HideSolutionNode =FALSE
@@ -197,5 +210,9 @@ Global
197210
{C163E892-5BF7-4B59-AA99-B0E8079C67C4} ={CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
198211
{A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5} ={CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
199212
{88E2D422-6852-46E3-A740-83E391DC7973} ={CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
213+
{AAAAD274-696A-49EC-AAAA-F870BE91AAAA} ={CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
214+
EndGlobalSection
215+
GlobalSection(ExtensibilityGlobals) =postSolution
216+
SolutionGuid ={BD5177C7-1380-40E7-94D2-7768E1A8B1B8}
200217
EndGlobalSection
201218
EndGlobal

‎TESTGUIDE.md‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ To run tests, use variations such as the following, depending on which test suit
1212

1313
##Prerequisites
1414

15-
In order to run the FSharpQA suite, you will need to install[Perl](http://www.perl.org/get.html) (ActiveState Perl 5.16.3 is known to work fine).
16-
Perl must be included in the`%PATH%` for the below steps to work. It is also recommended that you run tests from an elevated command prompt, as there are a couple of test cases which require administrative privileges.
17-
18-
The Perl requirement is gradually being removed.
15+
It is recommended that you run tests from an elevated command prompt, as there are a couple of test cases which require administrative privileges.
1916

2017
##Test Suites
2118

@@ -47,12 +44,18 @@ See note about baseline under "Other Tips" bellow for tests checking expectation
4744

4845
###FSharpQA Suite
4946

47+
The FSharpQA suite relies on[Perl](http://www.perl.org/get.html), StrawberryPerl64 package from nuget is used automatically by the test suite.
48+
5049
These tests use the`RunAll.pl` framework to execute, however the easiest way to run them is via the`build.cmd` script, see[usage examples](https://github.com/Microsoft/visualfsharp/blob/master/build.cmd#L31).
5150

5251
Tests are grouped in folders per area. Each folder contains a number of source code files and a single`env.lst` file. The`env.lst` file defines a series of test cases, one per line.
53-
Each test case runs an optional "pre command," compiles a given set of source files using given flags, optionally runs the resulting binary, then optionally runs a final "post command."
52+
53+
Each test case runs an optional "pre command," compiles a given set of source files using given flags, optionally runs the resulting binary, then optionally runs a final "post command".
54+
5455
If all of these steps complete without issue, the test is considered to have passed.
5556

57+
Read more at[tests/fsharpqa/readme.md](tests/fsharpqa/readme.md).
58+
5659
####Test lists
5760

5861
For the FSharpQA suite, the list of test areas and their associated "tags" is stored at
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ProjectToolsVersion="12.0"DefaultTargets="Build"xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<ProjectGuid>{AAAAD274-696A-49EC-AAAA-F870BE91AAAA}</ProjectGuid>
5+
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<ContentInclude="**\*.env" />
9+
<ContentInclude="**\*.lst" />
10+
<ContentInclude="**\*.log" />
11+
<ContentInclude="**\*.fsx" />
12+
<ContentInclude="**\*.fs" />
13+
</ItemGroup>
14+
<TargetName="Build">
15+
</Target>
16+
</Project>

‎tests/fsharpqa/readme.md‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#F# QA Tests
2+
3+
##Layout description
4+
5+
###Source/test.lst
6+
7+
This file is the entry point in the test discovery system of F# QA suite.
8+
9+
About the format:
10+
* lines starting with`#` are considered as comments,
11+
* each entry is defined in a single line
12+
* elements within entry are tab delimited
13+
** first element is a comma separated list of tags classifying the tests of that entry
14+
** last element is the folder containing the tests
15+
* each of the entries' folder have a`env.lst` file listing individual tests
16+
17+
###env.lst
18+
19+
(TODO, describe the format)
20+
21+
##Workflow when adding or fixing tests
22+
23+
You can use[run.fsharpqa.test.fsx](run.fsharpqa.test.fsx) script, and edit the end of it to specify which classifying tag you are working with. Evaluating the script should run the relevant tests.
24+
25+
A convenience "fsharpqafiles.csproj" project is located in the fsharp.sln solution, the only purpose is to facillitate navigation to test files that frequently need to be edited from within the IDE/text editor environment.
26+
27+
* edit Source/test.lst, find the entry you like to work with and give it a unique tag (e.g. "RERUN")
28+
* within the suite, if you are only interested about a specific test, you can comment lines in`env.lst` files by prepending those with`#`
29+
* adjust[run.fsharpqa.test.fsx](run.fsharpqa.test.fsx) and evaluate it
30+
* open`../TestResults/runpl.log` which should contain failures or be empty (in which cases, your tests are passing).
31+
* adjust the tests and repeat from step 2
32+
33+
(TODO, provide some guidance about how to define env.lst files)
34+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Work In Progress
2+
// this script helps run a subset of the fsharpqa tests without calling a full build.cmd
3+
4+
openSystem.IO
5+
openSystem.Diagnostics
6+
7+
letreleaseOrDebug="Debug"
8+
letsetEnvVar name value=
9+
System.Environment.SetEnvironmentVariable(name, value)
10+
11+
letaddToPath path=
12+
letcurrentPath= System.Environment.GetEnvironmentVariable"PATH"
13+
14+
letsplits= currentPath.Split(Path.PathSeparator)
15+
ifnot(Array.contains path splits)then
16+
setEnvVar"PATH"(path+(string Path.PathSeparator)+ currentPath)
17+
18+
letrootFolder= Path.Combine(__SOURCE_DIRECTORY__,"..","..")
19+
letcompilerBinFolder= Path.Combine(rootFolder, releaseOrDebug,"net40","bin")
20+
setEnvVar"CSC_PIPE"(Path.Combine(rootFolder,"packages","Microsoft.Net.Compilers.2.7.0","tools","csc.exe"))
21+
setEnvVar"FSC"(Path.Combine(compilerBinFolder,"fsc.exe"))
22+
setEnvVar"FSCOREDLLPATH"(Path.Combine(compilerBinFolder,"FSharp.Core.dll"))
23+
addToPath compilerBinFolder
24+
25+
letrunPerl arguments=
26+
// a bit expeditive, but does the deed
27+
Process.GetProcessesByName("perl")|> Array.iter(fun p-> p.Kill())
28+
use perlProcess=new Process()
29+
perlProcess.StartInfo.set_FileName(Path.Combine(rootFolder,"packages","StrawberryPerl64.5.22.2.1","Tools","perl","bin","perl.exe"))
30+
perlProcess.StartInfo.set_Arguments(arguments|> Array.map(fun a->@""""+ a+@"""")|> String.concat"")
31+
perlProcess.StartInfo.set_WorkingDirectory(Path.Combine(rootFolder,"tests","fsharpqa","source"))
32+
perlProcess.StartInfo.set_RedirectStandardOutputtrue
33+
perlProcess.StartInfo.set_RedirectStandardErrortrue
34+
perlProcess.StartInfo.set_UseShellExecutefalse
35+
perlProcess.Start()|> ignore
36+
while(not perlProcess.StandardOutput.EndOfStream)do
37+
perlProcess.StandardOutput.ReadLine()|> printfn"%s"
38+
while(not perlProcess.StandardError.EndOfStream)do
39+
perlProcess.StandardError.ReadLine()|> printfn"%s"
40+
perlProcess.WaitForExit()
41+
if perlProcess.ExitCode<>0then
42+
failwithf"exit code:%i" perlProcess.ExitCode
43+
44+
lettestResultDir= Path.Combine(rootFolder,"tests","TestResults")
45+
letperlScript= Path.Combine(rootFolder,"tests","fsharpqa","testenv","bin","runall.pl")
46+
runPerl[|perlScript;"-resultsroot";testResultDir;"-ttags:Conformance06"|]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp