Skip to content

remove test dependency on peverify.exe #4001

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion VisualFSharp.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27102.0
VisualStudioVersion = 15.0.27116.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Private", "src\fsharp\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj", "{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}"
EndProject
Expand Down Expand Up @@ -138,6 +138,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResourceFile", "vsintegrati
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Build.UnitTests", "src\fsharp\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj", "{400FAB03-786E-40CC-85A8-04B0C2869B14}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PEVerify", "tests\fsharpqa\testenv\src\PEVerify\PEVerify.csproj", "{B0689A4E-07D8-494D-A0C8-791CB1D74E54}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -760,6 +762,18 @@ Global
{400FAB03-786E-40CC-85A8-04B0C2869B14}.Release|Any CPU.Build.0 = Release|Any CPU
{400FAB03-786E-40CC-85A8-04B0C2869B14}.Release|x86.ActiveCfg = Release|Any CPU
{400FAB03-786E-40CC-85A8-04B0C2869B14}.Release|x86.Build.0 = Release|Any CPU
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Debug|x86.ActiveCfg = Debug|Any CPU
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Debug|x86.Build.0 = Debug|Any CPU
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Proto|Any CPU.Build.0 = Debug|Any CPU
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Proto|x86.ActiveCfg = Debug|Any CPU
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Proto|x86.Build.0 = Debug|Any CPU
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|Any CPU.Build.0 = Release|Any CPU
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|x86.ActiveCfg = Release|Any CPU
{B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -823,6 +837,7 @@ Global
{FF76BD3C-5E0A-4752-B6C3-044F6E15719B} = {35636A82-401A-4C3A-B2AB-EB7DC5E9C268}
{0385564F-07B4-4264-AB8A-17C393E9140C} = {F6DAEE9A-8BE1-4C4A-BC83-09215517C7DA}
{400FAB03-786E-40CC-85A8-04B0C2869B14} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
{B0689A4E-07D8-494D-A0C8-791CB1D74E54} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {48EDBBBE-C8EE-4E3C-8B19-97184A487B37}
Expand Down
11 changes: 11 additions & 0 deletions build-everything.proj
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,17 @@

<ItemGroup Condition="'$(TEST_CORECLR_FSHARP_SUITE)'=='1'" >
<ProjectsWithCoreClr Include="tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/FSharp.Tests.FSharpSuite.DrivingCoreCLR.fsproj" />
<ProjectsWithCoreClr Include="tests/fsharpqa/testenv/src/PEVerify/PEVerify.csproj" />

<ProjectsToRestore Include="tests/fsharpqa/testenv/src/PEVerify/PEVerify.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TEST_NET40_FSHARPQA_SUITE)'=='1' OR '$(TEST_NET40_FSHARP_SUITE)'=='1'" >
<ProjectsWithNet40 Include="tests/fsharpqa/testenv/src/ILComparer/ILComparer.fsproj" />
<ProjectsWithNet40 Include="tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj" />
<ProjectsWithNet40 Include="tests/fsharpqa/testenv/src/PEVerify/PEVerify.csproj" />

<ProjectsToRestore Include="tests/fsharpqa/testenv/src/PEVerify/PEVerify.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TEST_VS_IDEUNIT_SUITE)'=='1'" >
Expand Down Expand Up @@ -112,4 +118,9 @@
<MSBuild Projects="@(NugetProjects)" Targets="Clean" BuildInParallel="false" Properties="Configuration=$(Configuration);$(CustomProps)" />
<MSBuild Projects="@(SetupProjects)" Targets="Clean" BuildInParallel="false" Properties="Configuration=$(Configuration);BUILD_PUBLICSIGN=$(BUILD_PUBLICSIGN);$(CustomProps)" />
</Target>

<Target Name="Restore">
<MSBuild Projects="@(ProjectsToRestore)" Targets="Restore" />
</Target>

</Project>
7 changes: 5 additions & 2 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,11 @@ if "%BUILD_PROTO%" == "1" (
echo ---------------- Done with proto, starting build ------------------------

if "%BUILD_PHASE%" == "1" (
echo %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN%
%_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN%
echo %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore
%_msbuildexe% %msbuildflags% build-everything.proj /t:Restore

echo %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN%
%_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN%

@if ERRORLEVEL 1 echo Error build failed && goto :failure
)
Expand Down
19 changes: 4 additions & 15 deletions tests/fsharp/test-framework.fs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ module Commands =
type TestConfig =
{ EnvironmentVariables : Map<string, string>
CORDIR : string
CORSDK : string
CSC : string
csc_flags : string
BUILD_CONFIG : string
Expand All @@ -132,7 +131,7 @@ module WindowsPlatform =
[| "PROCESSOR_ARCHITECTURE" |] |> Seq.tryPick (fun s -> find s) |> function None -> "" | Some x -> x
value = "AMD64"

let clrPaths envVars =
let clrPath envVars =

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

let CORSDK =
let find s = envVars |> Map.tryFind s
[| "WINSDKNETFXTOOLS"; "WindowsSDK_ExecutablePath_x64"; "WindowsSDK_ExecutablePath_x86" |]
|> Seq.tryPick find
|> function
| None -> @"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\"
| Some x -> x

CORDIR, CORSDK
CORDIR

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

{ EnvironmentVariables = envVars
CORDIR = CORDIR |> Commands.pathAddBackslash
CORSDK = CORSDK |> Commands.pathAddBackslash
FSCBinPath = FSCBinPath |> Commands.pathAddBackslash
FSCOREDLLPATH = FSCOREDLLPATH
ILDASM = ILDASM
Expand All @@ -236,7 +226,6 @@ let logConfig (cfg: TestConfig) =
log "Executables"
log ""
log "CORDIR =%s" cfg.CORDIR
log "CORSDK =%s" cfg.CORSDK
log "CSC =%s" cfg.CSC
log "BUILD_CONFIG =%s" cfg.BUILD_CONFIG
log "csc_flags =%s" cfg.csc_flags
Expand Down
11 changes: 7 additions & 4 deletions tests/fsharpqa/Source/run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,14 @@
# check/set PEVerify
my $PEVERIFY = $ENV{PEVERIFY};
unless(defined($PEVERIFY)) {
# Only use peverify if it is in the path
foreach $_ (split /;/, $ENV{PATH}) {
$PEVERIFY = "peverify.exe" if(-e "$_\\peverify.exe");
my $scriptPath = dirname(__FILE__);
$PEVERIFY = "$scriptPath\\..\\testenv\\src\\PEVerify\\bin\\Release\\net46\\PEVerify.exe";
if (-e $PEVERIFY) {
$ENV{PEVERIFY} = $PEVERIFY;
}
else {
$ENV{PEVERIFY} = "$scriptPath\\..\\testenv\\src\\PEVerify\\bin\\Debug\\net46\\PEVerify.exe";
}
$ENV{PEVERIFY} = $PEVERIFY;
}

# Use $ENV{PEVER} if it is defined
Expand Down
Loading