-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtestWebConfigTransforms.ps1
More file actions
33 lines (25 loc) · 978 Bytes
/
testWebConfigTransforms.ps1
File metadata and controls
33 lines (25 loc) · 978 Bytes
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
#
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
$testPath = (join-path $scriptPath "webConfigTransformTestFiles")
$transformPath = (join-path $scriptPath "src\Nancy.AspNet.WebSockets\install")
$testTool = (join-path $scriptPath "src\WebConfigTransformTester\bin\Release\WebConfigTransformTester.exe")
$tests = 0
$failures = 0
Get-ChildItem $testPath -Filter *.input.config -recurse | foreach-object {
$subFolder = $_.Directory.Name
$transformFile = (join-path $transformPath "Web.config.$subFolder.xdt")
$dirName = $_.Directory.Name
$input = $_.FullName
$output = $_.FullName -replace ".input.config",".output.config"
write-host "==> Testing $dirName\$_ ..." -foreground yellow
& $testTool $input $transformFile $output
if ($LastExitCode -ne 0) {
$failures++
write-host "==> Failure"
} else {
write-host "==> Success"
}
$tests++
}
write-host "$tests test(s) run, of which $failures failed"
exit $failures