File tree 1 file changed +25
-2
lines changed
1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,27 @@ $CLIRoot = Join-Path $RepoRoot 'cli'
10
10
$DotNetExe = Join-Path $CLIRoot ' dotnet.exe'
11
11
$NuGetExe = Join-Path $RepoRoot ' .nuget\nuget.exe'
12
12
13
+ Function Error-Log {
14
+ param (
15
+ [string ]$ErrorMessage ,
16
+ [switch ]$Fatal )
17
+ if (-not $Fatal ) {
18
+ Write-Error " [$ ( Trace-Time ) ]`t $ErrorMessage "
19
+ }
20
+ else {
21
+ Write-Error " [$ ( Trace-Time ) ]`t [FATAL] $ErrorMessage " - ErrorAction Stop
22
+ }
23
+ }
24
+
25
+ Function Trace-Time () {
26
+ $currentTime = Get-Date
27
+ $lastTime = $Global :LastTraceTime
28
+ $Global :LastTraceTime = $currentTime
29
+ " {0:HH:mm:ss} +{1:F0}" -f $currentTime , ($currentTime - $lastTime ).TotalSeconds
30
+ }
31
+
32
+ $Global :LastTraceTime = Get-Date
33
+
13
34
rm - r $ArtifactsDir - Force | Out-Null
14
35
15
36
New-Item - ItemType Directory - Force - Path $CLIRoot | Out-Null
@@ -55,18 +76,20 @@ pushd $TestDir
55
76
& $DotNetExe test -- configuration $Configuration -f netcoreapp1.0
56
77
57
78
if (-not $? ) {
79
+ popd
58
80
Error- Log " Tests failed!!!"
59
81
Exit 1
60
82
}
61
83
62
84
# net46
63
85
& $DotNetExe build -- configuration $Configuration -f net46 -- runtime win7- x64
64
86
65
- $xunit = Join-Path $RepoRoot packages\xunit.runner.console.2.1 .0 \tools\xunit.console.x86. exe
87
+ $xunit = Join-Path $RepoRoot packages\xunit.runner.console.2.1 .0 \tools\xunit.console.exe
66
88
67
- & $xunit bin\release \net46\win7- x64\json- ld.net.tests.dll - html (Join-Path $ArtifactsDir " testresults.html" )
89
+ & $xunit bin\$Configuration \net46\win7- x64\json- ld.net.tests.dll - html (Join-Path $ArtifactsDir " testresults.html" )
68
90
69
91
if (-not $? ) {
92
+ popd
70
93
Write-Host " Tests failed!!!"
71
94
Exit 1
72
95
}
You can’t perform that action at this time.
0 commit comments