diff options
author | Alex Ghiondea <AlexGhiondea@users.noreply.github.com> | 2017-03-23 23:02:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-23 23:02:15 +0300 |
commit | b303b55e8e13c9dd02a5e18e6d9587e3b452ac2c (patch) | |
tree | 50df285ca994f78ebdb864c49f22ef173e196665 /Tools-Override | |
parent | ca6babddf64e479d7a9ffa08bc279d42dac76494 (diff) |
Enable running CoreFx tests in UAP on CoreCLR (#17212)
* Enable UAP runs on Core* binaries.
Diffstat (limited to 'Tools-Override')
-rw-r--r-- | Tools-Override/tests.targets | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Tools-Override/tests.targets b/Tools-Override/tests.targets index 32b41ef520..cc210b35ba 100644 --- a/Tools-Override/tests.targets +++ b/Tools-Override/tests.targets @@ -215,6 +215,38 @@ <PostExecutionTestCommandLines Include="copy /y testResults.xml %EXECUTION_DIR%\" /> </ItemGroup> + <PropertyGroup Condition="'$(BuildingUAPVertical)' == 'true'"> + <!-- The location where the logs will be written by the test runner --> + <UAP_Results_Path Condition="'$(UAP_Results_Path)'==''">%USERPROFILE%\Documents\TestResults\</UAP_Results_Path> + + <_Runtime_Path>%RUNTIME_PATH%\UAPLayout\</_Runtime_Path> + <!-- Make sure the path only has one type of slashes --> + <_Runtime_Path>$(_Runtime_Path.Replace('/', '\'))</_Runtime_Path> + + <!-- The test execution command is different for UAP. --> + <TestCommandLine>%RUNTIME_PATH%\Launcher\WindowsStoreAppLauncher.exe -test appxmanifest.xml $(XunitArguments) $(XunitTraitOptions)</TestCommandLine> + </PropertyGroup> + + <ItemGroup Condition="'$(BuildingUAPVertical)' == 'true'" > + <!-- Copy the runner files into the test directory --> + <RunnerFolderContents Include="$(NETCoreAppTestRootPath)\Runner\**\*" /> + + <TestCommandLines Include="mkdir Assets" /> + <TestCommandLines Include="mkdir entrypoint" /> + <TestCommandLines Include="mkdir Properties" /> + <TestCommandLines Include="mkdir WinMetadata" /> + <TestCommandLines Include="mklink /H %(RunnerFolderContents.RecursiveDir)%(RunnerFolderContents.Filename)%(RunnerFolderContents.Extension) %RUNTIME_PATH%\Runner\%(RunnerFolderContents.RecursiveDir)%(RunnerFolderContents.Filename)%(RunnerFolderContents.Extension)" /> + + <!-- Copy the runtime binaries over --> + <RuntimePathContents Include="$(RuntimePath)\**\*" /> + <TestCommandLines Include="mklink /H %(RuntimePathContents.RecursiveDir)%(RuntimePathContents.Filename)%(RuntimePathContents.Extension) $(_Runtime_Path)%(RuntimePathContents.Filename)%(RuntimePathContents.Extension)" /> + + <!-- Copy the log files and the results files from the Documents folder to the test folder --> + <PostExecutionTestCommandLines Include="move $(UAP_Results_Path)$(XunitTestAssembly).xml .\$(XunitResultsFileName)" /> + <PostExecutionTestCommandLines Include="move $(UAP_Results_Path)$(XunitTestAssembly).txt .\logs.txt" /> + <PostExecutionTestCommandLines Include="type logs.txt" /> + </ItemGroup> + <ItemGroup Condition="'$(Performance)'!='true'"> <!-- On Windows, call prevents the test command from making execution end prematurely --> <TestCommandLines Condition="'$(TargetOS)'=='Windows_NT'" Include="call $(TestCommandLine)"/> @@ -248,6 +280,10 @@ <MakeDir Condition="'$(CoverageEnabledForProject)'=='true'" Directories="$(CoverageReportDir)" /> <Error Text="TestILCFolder property is required for running uapaot tests. Please pass in the full path to the directory that contains ilc.exe to msbuild using /p:TestILCFolder=path_to_ilc_dir.exe" Condition="'$(BuildingUAPAOTVertical)' == 'true' AND '$(TestILCFolder)' == ''" /> + <!-- For UAP, make sure the Runner and Launcher folder exist, otherwise the tests cannot run --> + <Error Text="We cannot run the tests for UAP because either the Runner or the Launcher could not be found. You need to specify the UAPToolsFolder property when calling build.cmd to fix this." + Condition="'$(BuildingUAPVertical)'=='true' and (!Exists('$(NETCoreAppTestRootPath)\Runner') or !Exists('$(NETCoreAppTestRootPath)\Launcher'))" /> + <Exec Command="$(TestPath)/$(RunnerScriptName) $(TestSharedFxDir)" CustomErrorRegularExpression="Failed: [^0]" ContinueOnError="true" |