forked from authorunknown/SpecFlow-Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildandtest.ps1
More file actions
44 lines (37 loc) · 1.34 KB
/
Copy pathbuildandtest.ps1
File metadata and controls
44 lines (37 loc) · 1.34 KB
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
$skipTestExecution = ('*ExternalDataSample\Specs.sln', '*GherkinFormattingExamples\GherkinFormattingExamples.sln')
ForEach ($file in get-childitem . -recurse | where {$_.extension -like "*sln"})
{
$fullname = $file.fullname
# MSBuild contains old specflow versions, do not touch it
if (!($fullname -match 'MSBuild') -And !($fullname -match 'Webinars'))
{
Write-Output "File name: $file"
Write-Output "Fullpath: $fullname"
# dotnet test restores and builds the solution
if (!(($skipTestExecution | %{$fullname -like $_}) -contains $true))
{
# it has a local nuget feed, so build the nuget package first
if ($fullname -match 'SampleMethodTagDecorator')
{
$generatorPlugin = $fullname.Replace('SampleMethodTagDecorator.sln', 'GeneratorPlugin\SampleGeneratorPlugin.csproj')
Write-Output $generatorPlugin
iex "dotnet build '$generatorPlugin'"
}
iex "dotnet test '$fullname'"
if ($lastexitcode -ne 0)
{
break;
}
}
else
{
Write-Output "Test execution of '$fullname' was skipped because it contains failing tests. Building solution."
iex "dotnet build '$fullname'"
if ($lastexitcode -ne 0)
{
break;
}
}
Write-Output "------------------------------------------------------------------------------------------------------------"
}
}