Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a5d325f

Browse files
committed
Refactor AppVeyor/Travis embedded test_runner
Make it easier to diff and upgrade versions by breaking into multiple lines and using path completion Powershell continuation: http://stackoverflow.com/a/2608186/5208670 Powershell options splatting: http://stackoverflow.com/a/24313253/5208670
1 parent 54841da commit a5d325f

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ install:
3535
script:
3636
- export PYTHONPATH=`pwd`:$PYTHONPATH
3737
- python src/tests/runtests.py
38-
# - mono ./packages/NUnit.Runners*/tools/nunit-console.exe src/embed_tests/bin/Python.EmbeddingTest.dll
38+
# - mono ./packages/NUnit.*/tools/nunit-console.exe src/embed_tests/bin/Python.EmbeddingTest.dll
3939

4040
after_success:
4141
# Uncomment if need to geninterop, ie. py37 final

ci/appveyor_run_tests.ps1

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Executable paths for OpenCover
44
# Note if OpenCover fails, it won't affect the exit codes.
55
$OPENCOVER = Resolve-Path .\packages\OpenCover.*\tools\OpenCover.Console.exe
6-
$NUNIT = Resolve-Path .\packages\NUnit.Runners*\tools\"$env:NUNIT".exe
6+
$NUNIT = Resolve-Path .\packages\NUnit.*\tools\"$env:NUNIT".exe
77
$PY = Get-Command python
88

99
# Can't use ".\build\*\Python.EmbeddingTest.dll". Missing framework files.
@@ -13,15 +13,22 @@ $RUNTIME_DIR = ".\src\runtime\bin\"
1313
# Run python tests with C# coverage
1414
# why `2>&1 | %{ "$_" }`? see: http://stackoverflow.com/a/20950421/5208670
1515
Write-Host ("Starting Python tests") -ForegroundColor "Green"
16-
.$OPENCOVER -register:user -searchdirs:"$RUNTIME_DIR" -output:py.coverage -target:"$PY" -targetargs:src\tests\runtests.py -returntargetcode 2>&1 | %{ "$_" }
16+
.$OPENCOVER -register:user -searchdirs:"$RUNTIME_DIR" -output:py.coverage `
17+
-target:"$PY" -targetargs:src\tests\runtests.py `
18+
-returntargetcode `
19+
2>&1 | %{ "$_" }
1720
$PYTHON_STATUS = $LastExitCode
1821
if ($PYTHON_STATUS -ne 0) {
1922
Write-Host "Python tests failed, continuing to embedded tests" -ForegroundColor "Red"
2023
}
2124

2225
# Run Embedded tests with C# coverage
26+
# Powershell continuation: http://stackoverflow.com/a/2608186/5208670
27+
# Powershell options splatting: http://stackoverflow.com/a/24313253/5208670
2328
Write-Host ("Starting embedded tests") -ForegroundColor "Green"
24-
.$OPENCOVER -register:user -searchdirs:"$RUNTIME_DIR" -output:cs.coverage -target:"$NUNIT" -targetargs:"$CS_TESTS" -returntargetcode
29+
.$OPENCOVER -register:user -searchdirs:"$RUNTIME_DIR" -output:cs.coverage `
30+
-target:"$NUNIT" -targetargs:"$CS_TESTS" `
31+
-returntargetcode
2532
$NUNIT_STATUS = $LastExitCode
2633
if ($NUNIT_STATUS -ne 0) {
2734
Write-Host "Embedded tests failed" -ForegroundColor "Red"

0 commit comments

Comments
 (0)