Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Xunit xml output #248

Merged
merged 1 commit into from
Feb 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions tests/runtest.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ if not exist %__LogsDir% md %__LogsDir%
:SkipDefaultCoreRootSetup
set __XunitWrapperBuildLog=%__LogsDir%\Tests_XunitWrapper_%__BuildArch%__%__BuildType%.log
set __TestRunBuildLog=%__LogsDir%\TestRunResults_%__BuildArch%__%__BuildType%.log
set __TestRunHtmlLog=%CD%\TestRun_%__BuildArch%_%__BuildType%.html
set __TestRunHtmlLog=%__LogsDir%\TestRun_%__BuildArch%_%__BuildType%.html
set __TestRunXmlLog=%__LogsDir%\TestRun_%__BuildArch%_%__BuildType%.xml

echo "Core_Root that will be used is : %Core_Root%"
echo "Starting The Test Run .. "
Expand Down Expand Up @@ -109,7 +110,12 @@ md %Core_Root%
xcopy /s %__BinDir% %Core_Root%
call :runtests

IF %BUILDERRORLEVEL% NEQ 0 echo Test Run failed. Refer %__TestRunBuildLog% for details. && exit /b %BUILDERRORLEVEL%
IF %BUILDERRORLEVEL% NEQ 0 (
echo Test Run failed. Refer to the following"
echo Msbuild log: %__TestRunBuildLog%
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this log actually shows the console output of xunit runner and steps taken to prep the run. Not building the tests

echo Html report: %__TestRunHtmlLog%
exit /b %BUILDERRORLEVEL%
)
goto :eof

:runtests
Expand All @@ -118,12 +124,6 @@ goto :eof
set BUILDERRORLEVEL=%ERRORLEVEL%
goto :eof
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove this instead so that following are no longer dead code

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We call to runtests, which if it returns as failing will print a message about where to look for results. I think removing the dead code is the right option.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That message actually points to the msbuild log which will contain all possible failures , the html is sufficient for most people and is much easier to use to diagnose test failures

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with new info in the message after the runtest call


%_buildprefix% echo "Core_Root that was used is %Core_Root%" %_buildpostfix%
echo "Find details of the run in %__TestRunHtmlLog%


goto :eof

:Usage
echo.
echo Usage:
Expand Down
23 changes: 9 additions & 14 deletions tests/tests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<PropertyGroup>
<TestAssemblyDir Condition="'$(TestAssemblyDir)' == ''">$(BaseOutputPathWithConfig)\tests\XunitRunner\</TestAssemblyDir>
<__TestRunHtmlLog Condition="'$(__TestRunHtmlLog)' == ''">$(__LogsDir)\TestRun.html</__TestRunHtmlLog>
<__TestRunXmlLog Condition="'$(__TestRunXmlLog)' == ''">$(__LogsDir)\TestRun.xml</__TestRunXmlLog>
</PropertyGroup>
<Target Name="FindTestDirectories">
<ItemGroup>
Expand Down Expand Up @@ -46,21 +47,15 @@
<IncludeTraitsItems Include="$(IncludeTraits)" />
<ExcludeTraitsItems Include="$(ExcludeTraits)" />
</ItemGroup>

<PropertyGroup>
<XunitOptions Condition="'@(IncludeTraitsItems)'!=''">$(XunitOptions)-trait @(IncludeTraitsItems, ' -trait ') </XunitOptions>
<XunitOptions Condition="'@(ExcludeTraitsItems)'!=''">$(XunitOptions)-notrait @(ExcludeTraitsItems, ' -notrait ') </XunitOptions>
<XunitOptions >$(XunitOptions) -parallel all </XunitOptions>
<ParallelizeAssemblies>True</ParallelizeAssemblies>
<ParallelizeTestCollections>True</ParallelizeTestCollections>
</PropertyGroup>

<xunit Assemblies="@(TestAssemblies)"
WorkingFolder ="$(ThisTestWorkingDir)"
ParallelizeAssemblies="True"
ParallelizeTestCollections="True"
Html="$(__TestRunHtmlLog)"
/>
<xunit Assemblies="@(TestAssemblies)"
WorkingFolder="$(ThisTestWorkingDir)"
ParallelizeAssemblies="True"
ParallelizeTestCollections="True"
Html="$(__TestRunHtmlLog)"
Xml="$(__TestRunXmlLog)"
IncludeTraits="@(IncludeTraitsItems)"
ExcludeTraits="@(ExcludeTraitsItems)" />

</Target>

Expand Down