Skip to content
Prev Previous commit
Next Next commit
Fix - build 'test-only' assembly in a different output folder.
  • Loading branch information
springcomp committed Nov 6, 2019
commit a8da93c0687604f3aca17beabb800e9727fcff1d
16 changes: 2 additions & 14 deletions PSReadLine.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ $binaryModuleParams = @{
Outputs = "PSReadLine/bin/$Configuration/$Framework/Microsoft.PowerShell.PSReadLine2.dll"
}

$xUnitTestOnlyModuleParams = @{
Inputs = { Get-ChildItem PSReadLine/*.cs, PSReadLine/PSReadLine.csproj, PSReadLine/PSReadLineResources.resx }
Outputs = "PSReadLine/bin/$Configuration/$Framework/Microsoft.PowerShell.PSReadLine2.UnitTests.dll"
}

$xUnitTestParams = @{
Inputs = { Get-ChildItem test/*.cs, test/*.json, test/PSReadLine.Tests.csproj }
Outputs = "test/bin/$Configuration/$Framework/PSReadLine.Tests.dll"
Expand All @@ -119,13 +114,6 @@ task BuildXUnitTests @xUnitTestParams {
exec { dotnet publish -f $Framework -c $Configuration test }
}

<#
Synopsis: Build "test-only" PSReadLine module
#>
task BuildXUnitTestModule @xUnitTestOnlyModuleParams {
exec { dotnet build -f $Framework -c $Configuration PSReadLine /p:UnitTests=yes }
}

<#
Synopsis: Build the mock powershell console.
#>
Expand All @@ -148,8 +136,8 @@ task GenerateCatalog {
<#
Synopsis: Run the unit tests
#>
task RunTests BuildMainModule, BuildxUnitTestModule, BuildXUnitTests, {
dotnet test .\PSReadLine\PSReadLine.csproj /p:UnitTests=yes
task RunTests BuildMainModule, BuildXUnitTests, {
dotnet test .\PSReadLine\PSReadLine.csproj --configuration $Configuration --framework $Framework --output .\bin\$configuration\test-only\$Framework /p:UnitTests=yes
Start-TestRun -Configuration $Configuration -Framework $Framework
}

Expand Down