Skip to content

Commit 413a6b9

Browse files
committed
Added support of spanScaleFactor.
1 parent b0f12c1 commit 413a6b9

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
@@ -213,6 +213,12 @@ abstract class AbstractScalaTestMojo extends AbstractMojo {
213213
*/
214214
boolean logForkedProcessCommand;
215215

216+
/**
217+
* Span scale factor.
218+
*
219+
* @parameter expression="${spanScaleFactor}"
220+
*/
221+
double spanScaleFactor = 1.0;
216222

217223
// runScalaTest is called by the concrete mojo subclasses TODO: make it protected and others too
218224
// Returns true if all tests pass
@@ -391,6 +397,7 @@ List<String> sharedConfiguration() {
391397
addAll(wildcardSuites());
392398
addAll(testNGConfigFiles());
393399
addAll(junitClasses());
400+
addAll(spanScaleFactor());
394401
}};
395402
}
396403

@@ -516,6 +523,15 @@ private List<String> tests() {
516523
return list;
517524
}
518525

526+
private List<String> spanScaleFactor() {
527+
List<String> list = new ArrayList<String>();
528+
if (spanScaleFactor != 1.0) {
529+
list.add("-F");
530+
list.add(spanScaleFactor + "");
531+
}
532+
return list;
533+
}
534+
519535
private List<String> suffixes() {
520536
return compoundArg("-q", suffixes);
521537
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ class PluginTest extends JUnit3Suite with ShouldMatchers with PluginMatchers wit
171171
configure(_.jUnitClasses = comma("a", "b", "c")) should containSuiteArgs("-j", "a", "b", "c")
172172
}
173173

174+
def testScaledTimeSpans {
175+
configure(_.spanScaleFactor = 2.5) should containSlice("-F", "2.5")
176+
}
177+
174178
def testMojoConcat {
175179
MojoUtils.concat(jlist("a", "b", "c"), jlist("1", "2", "3")) should be(Array("a", "b", "c", "1", "2", "3"))
176180
}

0 commit comments

Comments
 (0)