Enable running tests using dotnet xunit test runner
This commit is contained in:
parent
33ddbf8f4c
commit
c0ed67e96f
|
|
@ -17,7 +17,10 @@ projectFile=''
|
|||
var projectText = File.ReadAllText(projectFile);
|
||||
var project = (JsonObject)Json.Deserialize(projectText);
|
||||
|
||||
if (project.Keys.Contains("testRunner"))
|
||||
// This check is just used to transition from dnx to dotnet
|
||||
var commands = project.ValueAsJsonObject("commands");
|
||||
|
||||
if (commands == null && project.Keys.Contains("testRunner"))
|
||||
{
|
||||
var projectFolder = Path.GetDirectoryName(projectFile);
|
||||
var projectName = Path.GetFileName(projectFolder);
|
||||
|
|
@ -39,13 +42,9 @@ projectFile=''
|
|||
{
|
||||
if (framework.StartsWith("dnxcore"))
|
||||
{
|
||||
var publishFolder = Path.Combine(projectFolder, ".testPublish", framework);
|
||||
DotnetPublish(projectFile, publishFolder, framework);
|
||||
|
||||
var runnerExe = Path.Combine(publishFolder, "dotnet-test-xunit.exe");
|
||||
var targetTestDll = Path.Combine(publishFolder, projectName + ".dll");
|
||||
Exec(runnerExe, targetTestDll + " " + testArgs);
|
||||
Dotnet("test " + testArgs, projectFolder);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ default NUGET_FEED = 'https://api.nuget.org/v3/index.json'
|
|||
@{
|
||||
var projectFiles = Files.Include("test/**/project.json").Exclude("**/bin/*/app/project.json").ToList();
|
||||
projectFiles.ForEach(projectFile => XunitTest(projectFile, testParallel: false));
|
||||
//projectFiles.ForEach(projectFile => DotnetTest(projectFile, testParallel: false));
|
||||
projectFiles.ForEach(projectFile => DotnetTest(projectFile, testParallel: false));
|
||||
projectFiles.ForEach(projectFile => DnxTest(projectFile, testParallel: false));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue