提交 2effc41b 编写于 作者: L Lukas Rieger 提交者: Kevin Ransom (msft)

make unit tests runnable from Visual Studio Test Explorer (#2868)

上级 cee204af
......@@ -36,6 +36,7 @@
<Compile Include="single-test.fs" />
<Compile Include="TypeProviderTests.fs" />
<Compile Include="tests.fs" />
<Content Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib" />
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit3TestAdapter" version="3.7.0" targetFramework="net45" />
</packages>
\ No newline at end of file
......@@ -181,7 +181,17 @@ let config configurationName envVars =
let ILDASM = requireFile (CORSDK ++ "ildasm.exe")
let SN = requireFile (CORSDK ++ "sn.exe")
let PEVERIFY = requireFile (CORSDK ++ "peverify.exe")
let FSI_FOR_SCRIPTS = requireFile (SCRIPT_ROOT ++ ".." ++ ".." ++ (System.Environment.GetEnvironmentVariable("_fsiexe").Trim([| '\"' |])))
let FSI_FOR_SCRIPTS =
match envVars |> Map.tryFind "_fsiexe" with
| Some fsiexe when (not (String.IsNullOrWhiteSpace fsiexe)) -> requireFile (SCRIPT_ROOT ++ ".." ++ ".." ++ (fsiexe.Trim([| '\"' |])))
| _ ->
// build.cmd sets that var, if it is not set, we are probably called directly from visual studio or the nunit console runner.
let packagesDir = SCRIPT_ROOT ++ ".." ++ ".." ++ @"packages"
let fsharpCompilerTools = Directory.GetDirectories(packagesDir, "FSharp.Compiler.Tools.*")
match fsharpCompilerTools with
| [||] -> failwithf "Could not find any 'FSharp.Compiler.Tools' inside '%s'" packagesDir
| [| dir |] -> Path.Combine(dir, "tools", "fsi.exe")
| _ -> failwithf "Found more than one 'FSharp.Compiler.Tools' inside '%s', please clean up." packagesDir
let dotNetExe = SCRIPT_ROOT ++ ".." ++ ".." ++ "Tools" ++ "dotnetcli" ++ "dotnet.exe"
#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册