Fixing dotnet-test.Tests to use a portable test app - ProjectWithTests.
The ProjectWithTests needed to be moved outside of TestAssets\TestProjects because it can't be restored --infer-runtimes and it has to be built with netcoreapp1.0.
This commit is contained in:
parent
8a9068efbf
commit
7d6d74bba2
5 changed files with 36 additions and 11 deletions
|
@ -93,7 +93,17 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
"--fallbacksource", Dirs.TestPackages,
|
||||
"--fallbacksource", Dirs.Corehost)
|
||||
.WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "TestProjects"))
|
||||
.Execute().EnsureSuccessful();
|
||||
.Execute()
|
||||
.EnsureSuccessful();
|
||||
|
||||
// The 'ProjectWithTests' is a portable test app. Cannot call --infer-runtimes on it, since on win x64 machines,
|
||||
// the x86 runtime is being inferred, and there are no x86 DotNetHost packages
|
||||
dotnet.Restore(
|
||||
"--verbosity", "verbose",
|
||||
"--fallbacksource", Dirs.Corehost)
|
||||
.WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "ProjectWithTests"))
|
||||
.Execute()
|
||||
.EnsureSuccessful();
|
||||
|
||||
// The 'ProjectModelServer' directory contains intentionally-unresolved dependencies, so don't check for success. Also, suppress the output
|
||||
dotnet.Restore(
|
||||
|
@ -248,6 +258,14 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
.EnsureSuccessful();
|
||||
}
|
||||
|
||||
// build ProjectWithTests, which is outside of TestProjects and targets netcoreapp
|
||||
string projectWithTests = Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "ProjectWithTests");
|
||||
c.Info($"Building: {projectWithTests}");
|
||||
dotnet.Build("--framework", "netcoreapp1.0")
|
||||
.WorkingDirectory(projectWithTests)
|
||||
.Execute()
|
||||
.EnsureSuccessful();
|
||||
|
||||
return c.Success();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue