-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.ps1
32 lines (26 loc) · 1.04 KB
/
test.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#########################################################
# #
# Build and Test QT for Windows using MSVC compiler #
# #
#########################################################
cd .\build\
# Generate executable using CMake
""
Write-Host "===== Building... =====" -Foreground Yellow
""
cmake --build .
if ($LastExitCode -ne 0) {$host.SetShouldExit($LastExitCode)}
# Tests using googletest suite
""
Write-Host "===== Testing... =====" -Foreground Yellow
""
ctest -C Debug -V
if ($LastExitCode -ne 0) {$host.SetShouldExit($LastExitCode)} # Exit with test error code
# Generate Coverage Report
""
OpenCppCoverage --export_type=cobertura:cobertura-gui.xml (get-item .\bin\TestGui.exe)>$null 2>$null
OpenCppCoverage --export_type=cobertura:cobertura.xml (get-item .\bin\test\*.exe)>$null 2>$null
#if($LastExitCode -ne 0) {$host.SetShouldExit($LastExitCode)} # Exit with test error code
Write-Host "Coverage Report generated." -Foreground Green
""
cd ..