This repository has been archived by the owner on Oct 13, 2020. It is now read-only.
forked from Pash-Project/Pash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
46 lines (36 loc) · 1.5 KB
/
appveyor.yml
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
os: Windows Server 2012 R2
build:
project: Pash.proj
verbosity: minimal
branches:
only:
- master
test_script:
- ps: |
function Add-ResultsMessage([string]$Path, [string]$Name) {
$xml = [xml](Get-Content $Path)
$total = $xml.'test-results'.total
$errors = $xml.'test-results'.errors
$failures = $xml.'test-results'.failures
$notrun = $xml.'test-results'.'not-run'
$inconclusive = $xml.'test-results'.inconclusive
$ignored = $xml.'test-results'.ignored
$skipped = $xml.'test-results'.skipped
$invalid = $xml.'test-results'.invalid
$script:errors += $errors + $failures
$message = "Ran $Name. Tests run: $total, Errors: $errors, Failures: $failures, Not run: $notrun, Ignored: $ignored, Skipped: $skipped"
Add-AppveyorMessage $message -Category $(if (($errors -ne 0) -or ($failures -ne 0)) {'Error'} else {'Information'})
}
function Start-NUnit($Path, $Name) {
Tools\NUnit-2.6.1\bin\nunit-console.exe -nologo $Path /xml:results.xml
Add-ResultsMessage results.xml $Name
$wc = New-Object Net.WebClient
$url = "https://ci.appveyor.com/api/testresults/nunit/$Env:APPVEYOR_JOB_ID"
$wc.UploadFile($url, (Resolve-Path .\results.xml))
}
$errors = 0
Start-Nunit Pash.nunit 'Pash tests'
Start-Nunit WindowsPowershellReferenceTests.nunit 'Windows PowerShell reference tests'
if ($errors) {
throw "$errors tests failed."
}