0
0
mirror of https://github.com/zeux/pugixml.git synced 2024-12-25 20:14:10 +08:00
pugixml/tests/cmake-appveyor.ps1
Arseny Kapoulkine f1f1b4e0dd Add basic CMake testing to AppVeyor
To reduce build time impact we just do a quick smoke test (configure &
build).
2024-10-30 13:27:13 -07:00

58 lines
1.0 KiB
PowerShell

$failed = $FALSE
$vs = $args[0]
$vsy = $args[1]
$target = "cmake_vs${vs}_${vsy}"
Add-AppveyorTest $target -Outcome Running
mkdir $target
pushd $target
try
{
Write-Output "# Setting up CMake VS$vs"
& cmake .. -G "Visual Studio $vs $vsy" | Tee-Object -Variable cmakeOutput
$sw = [Diagnostics.Stopwatch]::StartNew()
if ($?)
{
Write-Output "# Building"
& cmake --build . | Tee-Object -Variable cmakeOutput
if ($?)
{
Write-Output "# Passed"
Update-AppveyorTest $target -Outcome Passed -StdOut ($cmakeOutput | out-string) -Duration $sw.ElapsedMilliseconds
}
else
{
Write-Output "# Failed to build"
Update-AppveyorTest $target -Outcome Failed -StdOut ($cmakeOutput | out-string) -ErrorMessage "Building failed"
$failed = $TRUE
}
}
else
{
Write-Output "# Failed to configure"
Update-AppveyorTest $target -Outcome Failed -StdOut ($cmakeOutput | out-string) -ErrorMessage "Configuration failed"
$failed = $TRUE
}
}
finally
{
popd
}
if ($failed) { throw "One or more build steps failed" }
Write-Output "# End"