Skip to content

Commit 95fd5e5

Browse files
authored
remove test dependency on peverify.exe (#4001)
* remove test dependency on peverify.exe * enable metadata-only validation
1 parent 62e9bdf commit 95fd5e5

File tree

10 files changed

+469
-48
lines changed

10 files changed

+469
-48
lines changed

VisualFSharp.sln

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27102.0
4+
VisualStudioVersion = 15.0.27116.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Private", "src\fsharp\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj", "{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}"
77
EndProject
@@ -138,6 +138,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResourceFile", "vsintegrati
138138
EndProject
139139
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Build.UnitTests", "src\fsharp\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj", "{400FAB03-786E-40CC-85A8-04B0C2869B14}"
140140
EndProject
141+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PEVerify", "tests\fsharpqa\testenv\src\PEVerify\PEVerify.csproj", "{B0689A4E-07D8-494D-A0C8-791CB1D74E54}"
142+
EndProject
141143
Global
142144
GlobalSection(SolutionConfigurationPlatforms) = preSolution
143145
Debug|Any CPU = Debug|Any CPU
@@ -760,6 +762,18 @@ Global
760762
{400FAB03-786E-40CC-85A8-04B0C2869B14}.Release|Any CPU.Build.0 = Release|Any CPU
761763
{400FAB03-786E-40CC-85A8-04B0C2869B14}.Release|x86.ActiveCfg = Release|Any CPU
762764
{400FAB03-786E-40CC-85A8-04B0C2869B14}.Release|x86.Build.0 = Release|Any CPU
765+
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
766+
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Debug|Any CPU.Build.0 = Debug|Any CPU
767+
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Debug|x86.ActiveCfg = Debug|Any CPU
768+
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Debug|x86.Build.0 = Debug|Any CPU
769+
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
770+
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Proto|Any CPU.Build.0 = Debug|Any CPU
771+
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Proto|x86.ActiveCfg = Debug|Any CPU
772+
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Proto|x86.Build.0 = Debug|Any CPU
773+
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|Any CPU.ActiveCfg = Release|Any CPU
774+
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|Any CPU.Build.0 = Release|Any CPU
775+
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|x86.ActiveCfg = Release|Any CPU
776+
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|x86.Build.0 = Release|Any CPU
763777
EndGlobalSection
764778
GlobalSection(SolutionProperties) = preSolution
765779
HideSolutionNode = FALSE
@@ -823,6 +837,7 @@ Global
823837
{FF76BD3C-5E0A-4752-B6C3-044F6E15719B} = {35636A82-401A-4C3A-B2AB-EB7DC5E9C268}
824838
{0385564F-07B4-4264-AB8A-17C393E9140C} = {F6DAEE9A-8BE1-4C4A-BC83-09215517C7DA}
825839
{400FAB03-786E-40CC-85A8-04B0C2869B14} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
840+
{B0689A4E-07D8-494D-A0C8-791CB1D74E54} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
826841
EndGlobalSection
827842
GlobalSection(ExtensibilityGlobals) = postSolution
828843
SolutionGuid = {48EDBBBE-C8EE-4E3C-8B19-97184A487B37}

build-everything.proj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,17 @@
7373

7474
<ItemGroup Condition="'$(TEST_CORECLR_FSHARP_SUITE)'=='1'" >
7575
<ProjectsWithCoreClr Include="tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/FSharp.Tests.FSharpSuite.DrivingCoreCLR.fsproj" />
76+
<ProjectsWithCoreClr Include="tests/fsharpqa/testenv/src/PEVerify/PEVerify.csproj" />
77+
78+
<ProjectsToRestore Include="tests/fsharpqa/testenv/src/PEVerify/PEVerify.csproj" />
7679
</ItemGroup>
7780

7881
<ItemGroup Condition="'$(TEST_NET40_FSHARPQA_SUITE)'=='1' OR '$(TEST_NET40_FSHARP_SUITE)'=='1'" >
7982
<ProjectsWithNet40 Include="tests/fsharpqa/testenv/src/ILComparer/ILComparer.fsproj" />
8083
<ProjectsWithNet40 Include="tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj" />
84+
<ProjectsWithNet40 Include="tests/fsharpqa/testenv/src/PEVerify/PEVerify.csproj" />
85+
86+
<ProjectsToRestore Include="tests/fsharpqa/testenv/src/PEVerify/PEVerify.csproj" />
8187
</ItemGroup>
8288

8389
<ItemGroup Condition="'$(TEST_VS_IDEUNIT_SUITE)'=='1'" >
@@ -112,4 +118,9 @@
112118
<MSBuild Projects="@(NugetProjects)" Targets="Clean" BuildInParallel="false" Properties="Configuration=$(Configuration);$(CustomProps)" />
113119
<MSBuild Projects="@(SetupProjects)" Targets="Clean" BuildInParallel="false" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
114120
</Target>
121+
122+
<Target Name="Restore">
123+
<MSBuild Projects="@(ProjectsToRestore)" Targets="Restore" />
124+
</Target>
125+
115126
</Project>

build.cmd

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,11 @@ if "%BUILD_PROTO%" == "1" (
664664
echo ---------------- Done with proto, starting build ------------------------
665665

666666
if "%BUILD_PHASE%" == "1" (
667-
echo %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN%
668-
%_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN%
667+
echo %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore
668+
%_msbuildexe% %msbuildflags% build-everything.proj /t:Restore
669+
670+
echo %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN%
671+
%_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN%
669672

670673
@if ERRORLEVEL 1 echo Error build failed && goto :failure
671674
)

tests/fsharp/test-framework.fs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ module Commands =
106106
type TestConfig =
107107
{ EnvironmentVariables : Map<string, string>
108108
CORDIR : string
109-
CORSDK : string
110109
CSC : string
111110
csc_flags : string
112111
BUILD_CONFIG : string
@@ -132,7 +131,7 @@ module WindowsPlatform =
132131
[| "PROCESSOR_ARCHITECTURE" |] |> Seq.tryPick (fun s -> find s) |> function None -> "" | Some x -> x
133132
value = "AMD64"
134133

135-
let clrPaths envVars =
134+
let clrPath envVars =
136135

137136
let windir =
138137
match envVars |> Map.tryFind "windir" with
@@ -149,15 +148,7 @@ module WindowsPlatform =
149148
if Is64BitOperatingSystem envVars then
150149
CORDIR <- CORDIR.Replace("Framework", "Framework64")
151150

152-
let CORSDK =
153-
let find s = envVars |> Map.tryFind s
154-
[| "WINSDKNETFXTOOLS"; "WindowsSDK_ExecutablePath_x64"; "WindowsSDK_ExecutablePath_x86" |]
155-
|> Seq.tryPick find
156-
|> function
157-
| None -> @"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\"
158-
| Some x -> x
159-
160-
CORDIR, CORSDK
151+
CORDIR
161152

162153
type FSLibPaths =
163154
{ FSCOREDLLPATH : string }
@@ -173,13 +164,13 @@ let config configurationName envVars =
173164
let csc_flags = "/nologo"
174165
let fsc_flags = "-r:System.Core.dll --nowarn:20 --define:COMPILED"
175166
let fsi_flags = "-r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror"
176-
let CORDIR, CORSDK = WindowsPlatform.clrPaths envVars
167+
let CORDIR = WindowsPlatform.clrPath envVars
177168
let Is64BitOperatingSystem = WindowsPlatform.Is64BitOperatingSystem envVars
178169
let architectureMoniker = if Is64BitOperatingSystem then "x64" else "x86"
179170
let CSC = requireFile (CORDIR ++ "csc.exe")
180171
let ILDASM = requireFile (packagesDir ++ ("runtime.win-" + architectureMoniker + ".Microsoft.NETCore.ILDAsm.2.0.3") ++ "runtimes" ++ ("win-" + architectureMoniker) ++ "native" ++ "ildasm.exe")
181172
let coreclrdll = requireFile (packagesDir ++ ("runtime.win-" + architectureMoniker + ".Microsoft.NETCore.Runtime.CoreCLR.2.0.3") ++ "runtimes" ++ ("win-" + architectureMoniker) ++ "native" ++ "coreclr.dll")
182-
let PEVERIFY = requireFile (CORSDK ++ "peverify.exe")
173+
let PEVERIFY = requireFile (SCRIPT_ROOT ++ ".." ++ "fsharpqa" ++ "testenv" ++ "src" ++ "PEVerify" ++ "bin" ++ configurationName ++ "net46" ++ "PEVerify.exe")
183174
let FSI_FOR_SCRIPTS =
184175
match envVars |> Map.tryFind "_fsiexe" with
185176
| Some fsiexe when (not (String.IsNullOrWhiteSpace fsiexe)) -> requireFile (SCRIPT_ROOT ++ ".." ++ ".." ++ (fsiexe.Trim([| '\"' |])))
@@ -214,7 +205,6 @@ let config configurationName envVars =
214205

215206
{ EnvironmentVariables = envVars
216207
CORDIR = CORDIR |> Commands.pathAddBackslash
217-
CORSDK = CORSDK |> Commands.pathAddBackslash
218208
FSCBinPath = FSCBinPath |> Commands.pathAddBackslash
219209
FSCOREDLLPATH = FSCOREDLLPATH
220210
ILDASM = ILDASM
@@ -236,7 +226,6 @@ let logConfig (cfg: TestConfig) =
236226
log "Executables"
237227
log ""
238228
log "CORDIR =%s" cfg.CORDIR
239-
log "CORSDK =%s" cfg.CORSDK
240229
log "CSC =%s" cfg.CSC
241230
log "BUILD_CONFIG =%s" cfg.BUILD_CONFIG
242231
log "csc_flags =%s" cfg.csc_flags

tests/fsharpqa/Source/run.pl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,14 @@
264264
# check/set PEVerify
265265
my $PEVERIFY = $ENV{PEVERIFY};
266266
unless(defined($PEVERIFY)) {
267-
# Only use peverify if it is in the path
268-
foreach $_ (split /;/, $ENV{PATH}) {
269-
$PEVERIFY = "peverify.exe" if(-e "$_\\peverify.exe");
267+
my $scriptPath = dirname(__FILE__);
268+
$PEVERIFY = "$scriptPath\\..\\testenv\\src\\PEVerify\\bin\\Release\\net46\\PEVerify.exe";
269+
if (-e $PEVERIFY) {
270+
$ENV{PEVERIFY} = $PEVERIFY;
271+
}
272+
else {
273+
$ENV{PEVERIFY} = "$scriptPath\\..\\testenv\\src\\PEVerify\\bin\\Debug\\net46\\PEVerify.exe";
270274
}
271-
$ENV{PEVERIFY} = $PEVERIFY;
272275
}
273276

274277
# Use $ENV{PEVER} if it is defined

0 commit comments

Comments
 (0)