Skip to content

Commit 04d907f

Browse files
committed
Update test scripts for new directory structure
1 parent d62b66d commit 04d907f

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

src/lib/test.net472.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
publicKeyToken="30ad4fe6b2a6aeed"
88
culture="neutral" />
99
<codeBase version="9.0.0.0"
10-
href="../../../../../../lib/Newtonsoft.Json.9.dll"/>
10+
href="../../../../../lib/Newtonsoft.Json.9.dll"/>
1111
<codeBase version="10.0.0.0"
12-
href="../../../../../../lib/Newtonsoft.Json.10.dll"/>
12+
href="../../../../../lib/Newtonsoft.Json.10.dll"/>
1313
</dependentAssembly>
1414
</assemblyBinding>
1515
</runtime>

tools/TestNet472Modules.ps1

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,31 @@ $srcPath = (Join-Path $dirPath -ChildPath 'src')
1212
$libPath = (Join-Path $srcPath -ChildPath 'lib')
1313
$testConfig = (Join-Path $libPath -ChildPath 'test.net472.config')
1414
$rmItems = Get-ChildItem -Recurse -Path $srcPath -Include *.Test.dll `
15-
| Where {$_.FullName.Contains('bin\Debug\net472')}
15+
| Where {$_.FullName.Contains('bin\Debug\netstandard2.0')}
1616

1717
if ($ModuleFilter)
1818
{
1919
$rmItems = $rmItems | Where {$_.FullName.Contains($ModuleFilter)}
2020
}
2121

2222
$rmItems | %{`
23-
Write-Host "Testing $_.FullName"
24-
Start-Process -FilePath $TestExecPath `
23+
Write-Host ("Testing " + $_.FullName)
24+
$testDir = $_.Directory.FullName
25+
$testExec = Get-Item $TestExecPath
26+
$testExecDir = $testExec.Directory.FullName
27+
$testExecFile = $testExec.Name
28+
$newExecPath = Join-Path $testDir -ChildPath $testExecFile
29+
$copiedItems = (Get-ChildItem $testExecDir | Where-Object {$_.Name.StartsWith("xunit")})
30+
$copiedItems | Copy-Item -Destination $testDir
31+
try {
32+
Start-Process -FilePath $newExecPath `
2533
-Wait `
26-
-WorkingDirectory $PSScriptRoot\..\artifacts `
34+
-WorkingDirectory $testDir `
2735
-NoNewWindow `
2836
-ArgumentList $_.FullName, $testConfig, '-trait "AcceptanceType=CheckIn"', '-notrait "Runtype=DesktopOnly"'`
37+
}
38+
finally {
39+
$copiedItems | %{Remove-Item -Force (Join-Path $testDir $_.Name)}
40+
}
2941
}
42+

0 commit comments

Comments
 (0)