If xUnit Console NuGet package contains multiple xunit.console.exe files, current code will include them all in the command line causing the xUnit execution to fail. For example, the standard xunit.runner.console.2.4.1 package contains exe's for net542, net46, net461, net462, etc.
May want to add a parameter for specific framework version or at least check for multiple results and just grab the first one (that's what I ended up doing).
Original code:
## get xunit runner from nuget package feed
Invoke-Expression "$nugetExe install xunit.runner.console -source $xUnitNuget"
$xunit = Join-Path $workingDir "xunit.runner.console.*\tools\$xUnitExe" | Resolve-Path
if (-not $xunit) {
# Try finding xunit under framework specific folder
$xunit = Join-Path $workingDir "xunit.runner.console.*\tools\net4*\$xUnitExe" | Resolve-Path
}
Workaround with check for multiple results (also include fix for space in path mentioned in #135:
## get xunit runner from nuget package feed
Invoke-Expression "& '$nugetExe' install xunit.runner.console -source $xUnitNuget"
$xunit = Join-Path $workingDir "xunit.runner.console.*\tools\$xUnitExe" -Resolve
if ($xunit.Length -gt 0) {$xunit = $xunit[0]}
if (-not $xunit) {
# Try finding xunit under framework specific folder
$xunit = Join-Path $workingDir "xunit.runner.console.*\tools\net4*\$xUnitExe" -Resolve
if ($xunit.Length -gt 0) {$xunit = $xunit[0]}
}
If xUnit Console NuGet package contains multiple xunit.console.exe files, current code will include them all in the command line causing the xUnit execution to fail. For example, the standard xunit.runner.console.2.4.1 package contains exe's for net542, net46, net461, net462, etc.
May want to add a parameter for specific framework version or at least check for multiple results and just grab the first one (that's what I ended up doing).
Original code:
Workaround with check for multiple results (also include fix for space in path mentioned in #135: