1
1
# Script to simplify AppVeyor configuration and resolve path to tools
2
2
3
+ $stopwatch = [Diagnostics.Stopwatch ]::StartNew()
4
+
3
5
# Test Runner framework being used for embedded tests
4
6
$CS_RUNNER = " nunit3-console"
5
7
@@ -25,6 +27,16 @@ $PY = Get-Command python
25
27
$CS_TESTS = " .\src\embed_tests\bin\Python.EmbeddingTest.dll"
26
28
$RUNTIME_DIR = " .\src\runtime\bin\"
27
29
30
+ function ReportTime {
31
+ param ([string ] $action )
32
+
33
+ $timeSpent = $stopwatch.Elapsed
34
+ Write-Host $action " in " $timeSpent - ForegroundColor " Green"
35
+ $stopwatch.Restart ()
36
+ }
37
+
38
+ ReportTime " Preparation done"
39
+
28
40
# Run python tests with C# coverage
29
41
Write-Host (" Starting Python tests" ) - ForegroundColor " Green"
30
42
.$OPENCOVER - register:user - searchdirs:" $RUNTIME_DIR " - output:py.coverage `
@@ -33,6 +45,9 @@ Write-Host ("Starting Python tests") -ForegroundColor "Green"
33
45
$PYTHON_STATUS = $LastExitCode
34
46
if ($PYTHON_STATUS -ne 0 ) {
35
47
Write-Host " Python tests failed, continuing to embedded tests" - ForegroundColor " Red"
48
+ ReportTime " "
49
+ } else {
50
+ ReportTime " Python tests completed"
36
51
}
37
52
38
53
# Run Embedded tests with C# coverage
@@ -44,7 +59,10 @@ Write-Host ("Starting embedded tests") -ForegroundColor "Green"
44
59
$CS_STATUS = $LastExitCode
45
60
if ($CS_STATUS -ne 0 ) {
46
61
Write-Host " Embedded tests failed" - ForegroundColor " Red"
62
+ ReportTime " "
47
63
} else {
64
+ ReportTime " Embedded tests completed"
65
+
48
66
# NuGet for pythonnet-2.3 only has 64-bit binary for Python 3.5
49
67
# the test is only built using modern stack
50
68
if (($env: PLATFORM -eq " x64" ) -and ($XPLAT ) -and ($env: PYTHON_VERSION -eq " 3.5" )) {
@@ -60,6 +78,9 @@ if ($CS_STATUS -ne 0) {
60
78
$CS_PERF_STATUS = $LastExitCode
61
79
if ($CS_PERF_STATUS -ne 0 ) {
62
80
Write-Host " Performance tests (C#) failed" - ForegroundColor " Red"
81
+ ReportTime " "
82
+ } else {
83
+ ReportTime " Performance tests (C#) completed"
63
84
}
64
85
} else {
65
86
Write-Host (" Skipping performance tests for " , $env: PYTHON_VERSION ) - ForegroundColor " Yellow"
@@ -82,6 +103,9 @@ if ($XPLAT){
82
103
$CS_STATUS = $LastExitCode
83
104
if ($CS_STATUS -ne 0 ) {
84
105
Write-Host " Embedded tests for netcoreapp2.0 failed" - ForegroundColor " Red"
106
+ ReportTime " "
107
+ } else {
108
+ ReportTime " .NET Core 2.0 tests completed"
85
109
}
86
110
}
87
111
0 commit comments