Skip to content

Commit 1eee0e3

Browse files
committed
Merge branch 'cheeseng-spanScaleFactor'
2 parents 049d6db + fbae41c commit 1eee0e3

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/main/java/org/scalatest/tools/maven/AbstractScalaTestMojo.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,12 @@ abstract class AbstractScalaTestMojo extends AbstractMojo {
227227
*/
228228
boolean logForkedProcessCommand;
229229

230+
/**
231+
* Span scale factor.
232+
*
233+
* @parameter expression="${spanScaleFactor}"
234+
*/
235+
double spanScaleFactor = 1.0;
230236

231237
// runScalaTest is called by the concrete mojo subclasses TODO: make it protected and others too
232238
// Returns true if all tests pass
@@ -407,6 +413,7 @@ List<String> sharedConfiguration() {
407413
addAll(memoryFiles());
408414
addAll(testsFiles());
409415
addAll(junitClasses());
416+
addAll(spanScaleFactor());
410417
}};
411418
}
412419

@@ -532,6 +539,15 @@ private List<String> tests() {
532539
return list;
533540
}
534541

542+
private List<String> spanScaleFactor() {
543+
List<String> list = new ArrayList<String>();
544+
if (spanScaleFactor != 1.0) {
545+
list.add("-F");
546+
list.add(spanScaleFactor + "");
547+
}
548+
return list;
549+
}
550+
535551
private List<String> suffixes() {
536552
return compoundArg("-q", suffixes);
537553
}

src/test/scala/org/scalatest/tools/maven/PluginTest.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ final class PluginTest
183183
configure(_.testsFiles = comma("nonesuch", "pom.xml", "src")) should containSuiteArgs("-A", "pom.xml", "src")
184184
}
185185

186+
def testScaledTimeSpans {
187+
configure(_.spanScaleFactor = 2.5) should containSlice("-F", "2.5")
188+
}
189+
186190
def testMojoConcat {
187191
MojoUtils.concat(jlist("a", "b", "c"), jlist("1", "2", "3")) should be(Array("a", "b", "c", "1", "2", "3"))
188192
}

0 commit comments

Comments
 (0)