Making the test scripts work with dotnet test.

This commit is contained in:
Livar Cunha 2016-02-02 12:17:56 -08:00
parent fd604355fe
commit e618ff091f
8 changed files with 27 additions and 24 deletions

View file

@ -7,9 +7,10 @@
# Publish each test project
loadTestProjectList | foreach {
dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$TestBinRoot" --configuration "$Configuration" "$RepoRoot\test\$($_.ProjectName)"
#we should use publish to an output path, we will once issue #1183 has been fixed and we can point dotnet test do a dll.
dotnet build --framework "dnxcore50" --runtime "$Rid" --configuration "$Configuration" "$RepoRoot\test\$($_.ProjectName)"
if (!$?) {
Write-Host Command failed: dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$TestBinRoot" --configuration "$Configuration" "$RepoRoot\test\$($_.ProjectName)"
Write-Host Command failed: dotnet publish --framework "dnxcore50" --runtime "$Rid" --configuration "$Configuration" "$RepoRoot\test\$($_.ProjectName)"
exit 1
}
}

View file

@ -21,6 +21,7 @@ PROJECTS=$(loadTestProjectList)
for project in $PROJECTS
do
dotnet publish --framework "dnxcore50" --runtime "$RID" --output "$TEST_BIN_ROOT" --configuration "$CONFIGURATION" "$REPOROOT/test/$project"
#we should use publish to an output path, we will once issue #1183 has been fixed and we can point dotnet test do a dll.
dotnet build --framework "dnxcore50" --runtime "$RID" --configuration "$CONFIGURATION" "$REPOROOT/test/$project"
done

View file

@ -29,10 +29,13 @@ popd
mkdir -Force "$TestBinRoot\TestProjects"
cp -rec -Force "$RepoRoot\test\TestProjects\*" "$TestBinRoot\TestProjects"
pushd "$TestBinRoot"
# Run each test project
$TestProjects | foreach {
& ".\corerun" "xunit.console.netcore.exe" "$($_.ProjectName).dll" -xml "$($_.ProjectName)-testResults.xml" -notrait category=failing
# This is a workaroudn for issue #1184, where dotnet test needs to be executed from the folder containing the project.json.
pushd "$RepoRoot\test\$($_.ProjectName)"
dotnet test -xml "$TestBinRoot\$($_.ProjectName)-testResults.xml" -notrait category=failing
popd
$exitCode = $LastExitCode
if ($exitCode -ne 0) {
$failingTests += "$($_.ProjectName)"
@ -41,8 +44,6 @@ $TestProjects | foreach {
$failCount += $exitCode
}
popd
$TestScripts | foreach {
$scriptName = "$($_.ProjectName).ps1"

View file

@ -31,7 +31,11 @@ set +e
for project in $TestProjects
do
./corerun "xunit.console.netcore.exe" "$project.dll" -xml "${project}-testResults.xml" -notrait category=failing
# This is a workaroudn for issue #1184, where dotnet test needs to be executed from the folder containing the project.json.
pushd "$REPOROOT/test/$project"
dotnet test -xml "$TEST_BIN_ROOT\$project-testResults.xml" -notrait category=failing
popd
exitCode=$?
failCount+=$exitCode
if [ $exitCode -ne 0 ]; then

View file

@ -9,11 +9,7 @@
"NETStandard.Library": "1.0.0-rc2-23728",
"Microsoft.DotNet.ProjectModel": "1.0.0-*",
"System.Reflection.Metadata": "1.2.0-rc2-23728",
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc2-16537",
"Microsoft.DotNet.Files": {
"type": "build",
"version": "1.0.0-*"
}
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc2-16537"
},
"frameworks": {

View file

@ -11,7 +11,7 @@
"Microsoft.CodeAnalysis.CSharp": "1.2.0-beta1-20160108-01",
"Microsoft.DotNet.ProjectModel": "1.0.0-*",
"Microsoft.DotNet.Cli.Utils": "1.0.0-*",
"Microsoft.DotNet.Files": {"version": "1.0.0-*", "type": "build"}
"Microsoft.DotNet.Files": {"version": "1.0.0-*", "target": "project"}
},
"frameworks": {
"dnxcore50": {

View file

@ -5,8 +5,8 @@
},
"description": "Abstraction to interact with the file system and file paths.",
"dependencies": {
"NETStandard.Library": "1.0.0-rc2-23727",
"System.Linq.Expressions": "4.0.11-rc2-23727",
"NETStandard.Library": "1.0.0-rc2-23728",
"System.Linq.Expressions": "4.0.11-rc2-23728",
"Microsoft.Extensions.FileSystemGlobbing": "1.0.0-rc2-15975",

View file

@ -7,20 +7,20 @@
"dependencies": {
"NETStandard.Library" : "1.0.0-rc2-23728",
"xunit": "2.1.0",
"xunit.console.netcore": "1.0.2-prerelease-00101",
"xunit.netcore.extensions": "1.0.0-prerelease-00153",
"xunit.runner.utility": "2.1.0",
"Microsoft.DotNet.ProjectModel": { "target": "project" },
"Microsoft.DotNet.Cli.Utils": { "target": "project" },
"Microsoft.DotNet.Tools.Tests.Utilities": { "target": "project" }
"Microsoft.DotNet.Tools.Tests.Utilities": { "target": "project" },
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-45337-57"
},
"frameworks": {
"dnxcore50": {
"imports": "portable-net45+win8"
}
}
},
"testRunner": "xunit"
}