build/tests: Create separate output dir for each external test
This commit is contained in:
@@ -384,6 +384,7 @@ fun main(args : Array<String>) {
|
|||||||
@Override
|
@Override
|
||||||
void executeTest() {
|
void executeTest() {
|
||||||
createOutputDirectory()
|
createOutputDirectory()
|
||||||
|
def outputRootDirectory = outputDirectory
|
||||||
|
|
||||||
// Form the test list.
|
// Form the test list.
|
||||||
List<File> ktFiles = project.file(groupDirectory).listFiles(new FileFilter() {
|
List<File> ktFiles = project.file(groupDirectory).listFiles(new FileFilter() {
|
||||||
@@ -406,6 +407,9 @@ fun main(args : Array<String>) {
|
|||||||
testSuite.start()
|
testSuite.start()
|
||||||
ktFiles.each {
|
ktFiles.each {
|
||||||
source = project.relativePath(it)
|
source = project.relativePath(it)
|
||||||
|
// Create separate output directory for each test in the group.
|
||||||
|
outputDirectory = outputRootDirectory + "/${it.name}"
|
||||||
|
project.file(outputDirectory).mkdirs()
|
||||||
println("TEST: $it.name ($statistics.total/${ktFiles.size()}, passed: $statistics.passed, skipped: $statistics.skipped)")
|
println("TEST: $it.name ($statistics.total/${ktFiles.size()}, passed: $statistics.passed, skipped: $statistics.skipped)")
|
||||||
def testCase = testSuite.createTestCase(it.name)
|
def testCase = testSuite.createTestCase(it.name)
|
||||||
testCase.start()
|
testCase.start()
|
||||||
@@ -430,7 +434,7 @@ fun main(args : Array<String>) {
|
|||||||
testSuite.finish()
|
testSuite.finish()
|
||||||
|
|
||||||
// Save the report.
|
// Save the report.
|
||||||
def reportFile = project.file("${outputDirectory}/results.json")
|
def reportFile = project.file("${outputRootDirectory}/results.json")
|
||||||
def json = JsonOutput.toJson(["statistics" : statistics, "tests" : results])
|
def json = JsonOutput.toJson(["statistics" : statistics, "tests" : results])
|
||||||
reportFile.write(JsonOutput.prettyPrint(json))
|
reportFile.write(JsonOutput.prettyPrint(json))
|
||||||
println("TOTAL PASSED: $statistics.passed/$statistics.total (SKIPPED: $statistics.skipped)")
|
println("TOTAL PASSED: $statistics.passed/$statistics.total (SKIPPED: $statistics.skipped)")
|
||||||
|
|||||||
Reference in New Issue
Block a user