-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_mutations.ps1
43 lines (36 loc) · 1.3 KB
/
run_mutations.ps1
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
$CommonOutputFolder = "./SteganographyApp.Common.Tests/StrykerOutput"
$CommonProject = "./SteganographyApp.Common.Tests"
$ArgumentsOutputFolder = "./SteganographyApp.Common.Arguments.Tests/StrykerOutput"
$ArgumentsProject = "./SteganographyApp.Common.Arguments.Tests"
Write-Host "`n---------- Removing Previous Output Folders ----------`n"
function Remove-Folder {
param([string] $FolderPath)
if (Test-Path $FolderPath) {
Write-Host "Removing folder $FolderPath"
Remove-Item -Recurse -Force $FolderPath | Out-Null
if (Test-Path $FolderPath) {
throw "Could not delete folder $FolderPath"
}
}
}
Remove-Folder $CommonOutputFolder
Remove-Folder $ArgumentsOutputFolder
Write-Host "`n---------- Executing mutation tests ----------`n"
function Run-Mutations {
param(
[string] $Project,
[string] $Output
)
Write-Host "---------- Running $Project mutation tests ----------"
cd $Project
dotnet tool run dotnet-stryker --config-file stryker-config.json
if($LastExitCode -ne 0){
Write-Host("'stryker' failed with status: $LastExitCode")
cd ..
Exit
}
Write-Host "Report available at $Output"
cd ..
}
Run-Mutations $CommonProject $CommonOutputFolder
Run-Mutations $ArgumentsProject $ArgumentsOutputFolder