Skip to content
Browse files

fix for GRAILS-4849

  • Loading branch information...
1 parent 17a02c7 commit f3dc48c93e47b7cef52434b8f744b71bd805c0e9 @graemerocher graemerocher committed Jul 20, 2009
Showing with 11 additions and 1 deletion.
  1. +11 −1 grails/scripts/_GrailsTest.groovy
View
12 grails/scripts/_GrailsTest.groovy
@@ -99,7 +99,17 @@ target(allTests: "Runs the project's tests.") {
event("TestPhasesStart", [phasesToRun])
// This runs the tests and generates the formatted result files.
- testRunner = new DefaultGrailsTestRunner(testReportsDir, reportFormats)
+ String testRunnerClassName = System.getProperty("grails.test.runner") ?: "org.codehaus.groovy.grails.test.DefaultGrailsTestRunner";
+ testRunner = null
+ if (testRunnerClassName) {
+ try {
+ testRunner = Class.forName(testRunnerClassName).getConstructor(File, List).newInstance(testReportsDir, reportFormats)
+ }
+ catch (Throwable e) {
+ println "Cannot load test runner class '${testRunnerClassName}'. Reason: ${e.message}"
+ testRunner = new DefaultGrailsTestRunner(testReportsDir, reportFormats)
+ }
+ }
// Process the tests in each phase that is configured to run.
phasesToRun.each { String phase ->

0 comments on commit f3dc48c

Please sign in to comment.
Something went wrong with that request. Please try again.