gant test runner: print JVM options before starting tests

This commit is contained in:
nik
2015-05-19 21:55:55 +03:00
parent fb0e9eb9e2
commit 5da485421c
+31 -24
View File
@@ -35,9 +35,9 @@ target(compile: "Compile project") {
}
}
private pass(String prop) {
private pass(List<String> args, String prop) {
if (isDefined(prop)) {
ant.jvmarg(value: "-D$prop=${p(prop)}")
args << "-D$prop=${p(prop)}"
}
}
@@ -49,29 +49,36 @@ target('run_tests': 'Run java tests') {
new File(classpathFile).text = testRuntimeClasspath.findAll({ new File((String)it).exists() }).join('\n')
testcases.each { testCase ->
List<String> jvmArgs = [
"-Dclasspath.file=${classpathFile}",
"-Didea.platform.prefix=Idea",
"-Dbootstrap.testcases=$testCase"
]
[
"idea.test.group",
"idea.test.patterns",
"idea.fast.only",
"idea.coverage.enabled.build",
"teamcity.build.tempDir",
"teamcity.tests.recentlyFailedTests.file"
].each { pass(jvmArgs, it) }
System.getProperties().entrySet().each {
if (it.key.startsWith("pass.")) {
def trimmed = it.key.substring("pass.".length());
jvmArgs << "-D${trimmed}=${it.value}"
};
}
jvmArgs.addAll(commonJvmArgsForTests())
if (isDefined("jvm_args")) {
jvmArgs.addAll(jvm_args)
}
projectBuilder.info("Starting JUnit $testCase, JVM options: $jvmArgs")
ant.junit(fork: "yes", showoutput: "true", logfailedtests: false) {
jvmarg(value: "-Dclasspath.file=${classpathFile}")
pass("idea.test.group")
pass("idea.test.patterns")
pass("idea.fast.only")
pass("idea.coverage.enabled.build")
pass("teamcity.build.tempDir")
pass("teamcity.tests.recentlyFailedTests.file")
jvmarg(value: "-Didea.platform.prefix=Idea")
System.getProperties().entrySet().each {
if (it.key.startsWith("pass.")) {
def trimmed = it.key.substring("pass.".length());
jvmarg(value: "-D${trimmed}=${it.value}");
};
}
commonJvmArgsForTests().each { jvmarg(value: it) }
jvmarg(value: "-Dbootstrap.testcases=$testCase")
if (isDefined("jvm_args")) {
jvm_args.each { jvmarg(value: it) }
jvmArgs.each {
jvmarg(value: it)
}
classpath {