Make --no-build imply --no-restore for test command.

This commit makes the `--no-build` option for the test command
automatically imply `--no-restore`.

Fixes issue #7472.
This commit is contained in:
Peter Huene 2017-11-25 16:45:38 -08:00
parent df414ddcfa
commit de10b22bcd
16 changed files with 30 additions and 29 deletions

View file

@ -193,7 +193,7 @@
Logs are written to the provided file.</value>
</data>
<data name="CmdNoBuildDescription" xml:space="preserve">
<value>Do not build project before testing.</value>
<value>Do not build project before testing. Implies --no-restore.</value>
</data>
<data name="CmdResultsDirectoryDescription" xml:space="preserve">
<value>The directory where the test results are going to be placed. The specified directory will be created if it does not exist.

View file

@ -70,7 +70,7 @@ namespace Microsoft.DotNet.Tools.Test
}
}
bool noRestore = parsedTest.HasOption("--no-restore");
bool noRestore = parsedTest.HasOption("--no-restore") || parsedTest.HasOption("--no-build");
return new TestCommand(
msbuildArgs,

View file

@ -125,8 +125,8 @@
<note />
</trans-unit>
<trans-unit id="CmdNoBuildDescription">
<source>Do not build project before testing.</source>
<target state="translated">Nesestavujte projekt dříve, než ho otestujete.</target>
<source>Do not build project before testing. Implies --no-restore.</source>
<target state="needs-review-translation">Nesestavujte projekt dříve, než ho otestujete.</target>
<note />
</trans-unit>
<trans-unit id="CmdTestAdapterPath">

View file

@ -125,8 +125,8 @@
<note />
</trans-unit>
<trans-unit id="CmdNoBuildDescription">
<source>Do not build project before testing.</source>
<target state="translated">Erstellen Sie das Projekt nicht vor dem Testen.</target>
<source>Do not build project before testing. Implies --no-restore.</source>
<target state="needs-review-translation">Erstellen Sie das Projekt nicht vor dem Testen.</target>
<note />
</trans-unit>
<trans-unit id="CmdTestAdapterPath">

View file

@ -125,8 +125,8 @@
<note />
</trans-unit>
<trans-unit id="CmdNoBuildDescription">
<source>Do not build project before testing.</source>
<target state="translated">El proyecto no se compila antes de probarlo.</target>
<source>Do not build project before testing. Implies --no-restore.</source>
<target state="needs-review-translation">El proyecto no se compila antes de probarlo.</target>
<note />
</trans-unit>
<trans-unit id="CmdTestAdapterPath">

View file

@ -125,8 +125,8 @@
<note />
</trans-unit>
<trans-unit id="CmdNoBuildDescription">
<source>Do not build project before testing.</source>
<target state="translated">Ne générez pas le projet avant les tests.</target>
<source>Do not build project before testing. Implies --no-restore.</source>
<target state="needs-review-translation">Ne générez pas le projet avant les tests.</target>
<note />
</trans-unit>
<trans-unit id="CmdTestAdapterPath">

View file

@ -125,8 +125,8 @@
<note />
</trans-unit>
<trans-unit id="CmdNoBuildDescription">
<source>Do not build project before testing.</source>
<target state="translated">Il progetto non viene compilato prima del test.</target>
<source>Do not build project before testing. Implies --no-restore.</source>
<target state="needs-review-translation">Il progetto non viene compilato prima del test.</target>
<note />
</trans-unit>
<trans-unit id="CmdTestAdapterPath">

View file

@ -125,8 +125,8 @@
<note />
</trans-unit>
<trans-unit id="CmdNoBuildDescription">
<source>Do not build project before testing.</source>
<target state="translated">テストする前にプロジェクトを構築しないでください。</target>
<source>Do not build project before testing. Implies --no-restore.</source>
<target state="needs-review-translation">テストする前にプロジェクトを構築しないでください。</target>
<note />
</trans-unit>
<trans-unit id="CmdTestAdapterPath">

View file

@ -125,8 +125,8 @@
<note />
</trans-unit>
<trans-unit id="CmdNoBuildDescription">
<source>Do not build project before testing.</source>
<target state="translated">테스트하기 전에 프로젝트를 빌드하지 않습니다.</target>
<source>Do not build project before testing. Implies --no-restore.</source>
<target state="needs-review-translation">테스트하기 전에 프로젝트를 빌드하지 않습니다.</target>
<note />
</trans-unit>
<trans-unit id="CmdTestAdapterPath">

View file

@ -125,8 +125,8 @@
<note />
</trans-unit>
<trans-unit id="CmdNoBuildDescription">
<source>Do not build project before testing.</source>
<target state="translated">Nie kompiluj projektu przed przeprowadzeniem testów.</target>
<source>Do not build project before testing. Implies --no-restore.</source>
<target state="needs-review-translation">Nie kompiluj projektu przed przeprowadzeniem testów.</target>
<note />
</trans-unit>
<trans-unit id="CmdTestAdapterPath">

View file

@ -125,8 +125,8 @@
<note />
</trans-unit>
<trans-unit id="CmdNoBuildDescription">
<source>Do not build project before testing.</source>
<target state="translated">Não compile o projeto antes de testar.</target>
<source>Do not build project before testing. Implies --no-restore.</source>
<target state="needs-review-translation">Não compile o projeto antes de testar.</target>
<note />
</trans-unit>
<trans-unit id="CmdTestAdapterPath">

View file

@ -125,8 +125,8 @@
<note />
</trans-unit>
<trans-unit id="CmdNoBuildDescription">
<source>Do not build project before testing.</source>
<target state="translated">Не выполнять сборку проектов перед тестированием.</target>
<source>Do not build project before testing. Implies --no-restore.</source>
<target state="needs-review-translation">Не выполнять сборку проектов перед тестированием.</target>
<note />
</trans-unit>
<trans-unit id="CmdTestAdapterPath">

View file

@ -125,8 +125,8 @@
<note />
</trans-unit>
<trans-unit id="CmdNoBuildDescription">
<source>Do not build project before testing.</source>
<target state="translated">Projeyi derlemeden önce test edin.</target>
<source>Do not build project before testing. Implies --no-restore.</source>
<target state="needs-review-translation">Projeyi derlemeden önce test edin.</target>
<note />
</trans-unit>
<trans-unit id="CmdTestAdapterPath">

View file

@ -125,8 +125,8 @@
<note />
</trans-unit>
<trans-unit id="CmdNoBuildDescription">
<source>Do not build project before testing.</source>
<target state="translated">测试之前不要生成项目。</target>
<source>Do not build project before testing. Implies --no-restore.</source>
<target state="needs-review-translation">测试之前不要生成项目。</target>
<note />
</trans-unit>
<trans-unit id="CmdTestAdapterPath">

View file

@ -125,8 +125,8 @@
<note />
</trans-unit>
<trans-unit id="CmdNoBuildDescription">
<source>Do not build project before testing.</source>
<target state="translated">請勿在測試前建置專案。</target>
<source>Do not build project before testing. Implies --no-restore.</source>
<target state="needs-review-translation">請勿在測試前建置專案。</target>
<note />
</trans-unit>
<trans-unit id="CmdTestAdapterPath">

View file

@ -123,11 +123,12 @@ namespace Microsoft.DotNet.Cli.Test.Tests
// Call test
CommandResult result = new DotnetTestCommand()
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput("--no-build");
.ExecuteWithCapturedOutput("--no-build -v:m");
// Verify
if (!DotnetUnderTest.IsLocalized())
{
result.StdOut.Should().NotContain("Restore");
result.StdErr.Should().Contain(expectedError);
}