-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ubuntu1604 collect results * pared back for testing * fix indentation * add publish results * switch to windows * fix parenthesis * fix * adding options to ctest * fix ci yaml * debug issue * tweak * trying fixes * trying powershell task instead * fix xsl path * uncommented windows build * move files and update vsts ci yaml * fix childitem path * fix jenkins path * add verbose logging * Update ctest ps1 * Update .vsts-ci.yml * Fixing Path Issues * adjusted path for script * added cl arg * parameters for builds * bugfix * bugfix * fix path * fixing scripts * update yaml * filled yml * Update .vsts-ci.yml * Update ctest_to_junit.ps1
- Loading branch information
Showing
5 changed files
with
91 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@REM Copyright (c) Microsoft. All rights reserved. | ||
@REM Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
setlocal | ||
|
||
set working-dir=%~dp0.. | ||
rem // resolve to fully qualified path | ||
|
||
for %%i in ("%working-dir%") do set working-dir=%%~fi | ||
|
||
echo %working-dir% | ||
|
||
REM -- C -- | ||
|
||
pushd "%working-dir%" | ||
|
||
Powershell.exe -executionpolicy remotesigned -File %working-dir%\jenkins\ctest_to_junit.ps1 %1 | ||
if not %ERRORLEVEL%==0 exit /b %ERRORLEVEL% | ||
|
||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright (c) Microsoft. All rights reserved. | ||
# Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
# This script will be running on working dir set as ./jenkins | ||
$build_folder = $args[0] | ||
$PSScriptRoot | ||
Push-Location $PSScriptRoot | ||
$xsl = Join-Path -Path (Get-Location) -ChildPath "..\jenkins\ctest_to_junit.xsl" | ||
$ctest_xml = (Get-ChildItem "../cmake/$build_folder/*/Test.xml" -Recurse).FullName | ||
$junit_xml = Join-Path -Path (Get-Location) -ChildPath "results-junit.xml" | ||
$xslt = New-Object System.Xml.Xsl.XslCompiledTransform | ||
$xslt.Load($xsl) | ||
$xslt.Transform($ctest_xml, $junit_xml) | ||
|
||
Pop-Location |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | ||
<xsl:output method="xml" indent="yes" /> | ||
<xsl:template match="/"> | ||
<testsuites> | ||
<xsl:variable name="buildName" select="//Site/@BuildName"/> | ||
<xsl:variable name="numberOfTests" select="count(//Site/Testing/Test)"/> | ||
<xsl:variable name="numberOfFailures" select="count(//Site/Testing/Test[@Status!='passed'])" /> | ||
<testsuite name="CTest" | ||
tests="{$numberOfTests}" time="0" | ||
failures="{$numberOfFailures}" errors="0" | ||
skipped="0"> | ||
<xsl:for-each select="//Site/Testing/Test"> | ||
<xsl:variable name="testName" select="translate(Name, '-', '_')"/> | ||
<xsl:variable name="duration" select="Results/NamedMeasurement[@name='Execution Time']/Value"/> | ||
<xsl:variable name="status" select="@Status"/> | ||
<xsl:variable name="output" select="Results/Measurement/Value"/> | ||
<xsl:variable name="className" select="translate(Path, '/.', '.')"/> | ||
<testcase classname="projectroot{$className}" | ||
name="{$testName}" | ||
time="{$duration}"> | ||
<xsl:if test="@Status!='passed'"> | ||
<failure> | ||
<xsl:value-of select="$output" /> | ||
</failure> | ||
</xsl:if> | ||
<system-out> | ||
<xsl:value-of select="$output" /> | ||
</system-out> | ||
</testcase> | ||
</xsl:for-each> | ||
</testsuite> | ||
</testsuites> | ||
</xsl:template> | ||
</xsl:stylesheet> |