From ad4df07bf2ea70334ada357d1240099e61b1d170 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 24 Jul 2018 08:22:31 -0700 Subject: [PATCH] Work around cmd command length limit in xunit Exec task (#19095) On Windows, the Exec task passes the command to cmd, so long commands run into the command length limit (see https://github.com/Microsoft/msbuild/issues/2530). This workaround shortens the xunit command line by replacing the path to the test binary directory with an environment variable. --- tests/src/dir.props | 2 +- tests/tests.targets | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/src/dir.props b/tests/src/dir.props index f3f229d..2730073 100644 --- a/tests/src/dir.props +++ b/tests/src/dir.props @@ -33,7 +33,7 @@ - $(ProjectDir)\..\bin\tests + $(ProjectDir)..\bin\tests $(__TestRootDir) $(BaseOutputPath)\$(OSPlatformConfig)\ $(BaseOutputPathWithConfig) diff --git a/tests/tests.targets b/tests/tests.targets index 9a16cb0..e1e6f58 100644 --- a/tests/tests.targets +++ b/tests/tests.targets @@ -50,9 +50,24 @@ $(CORE_ROOT)\corerun $(CORE_ROOT)\corerun.exe + + + + + <_TestAssembliesRelative Include="@(TestAssemblies -> Replace('$(BaseOutputPathWithConfig)', '.\'))" /> + + + + + $(CorerunExecutable) $(XunitConsoleRunner) @(TestAssemblies->'%(Identity)', ' ') $(XunitArgs) - + + + -- 2.7.4