Skip to content

Commit

Permalink
Make onlyMeasureWorkload configurable via CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
DaGeRe committed Apr 25, 2022
1 parent 69ed71e commit fd14c86
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ExecutionConfigMixin {
protected String commit;

@Option(names = { "-commitOld", "--commitOld" }, description = "Older commit for regression test selection / measurement" +
"If used, please always specify commit; only the difference of both will be analyzed, intermediary commits will be ignored. Do not use together with startcommit / endcommit. (Deprecated. Use oldCommit instead)")
"If used, please always specify commit; only the difference of both will be analyzed, intermediary commits will be ignored. Do not use together with startcommit / endcommit.")
protected String commitOld;

@Option(names = { "-startcommit", "--startcommit" }, description = "First commit that should be analysed - do not use together with commit and commitOld!")
Expand Down Expand Up @@ -80,6 +80,9 @@ public class ExecutionConfigMixin {
"--dontRedirectToNull" }, description = "Activates showing the standard output of the testcase (by default, it is redirected to null)")
protected boolean dontRedirectToNull = false;

@Option(names = { "-onlyMeasureWorkload", "--onlyMeasureWorkload" }, description = "Only measure workload (no @Before/@After)")
protected boolean onlyMeasureWorkload = false;

@Option(names = { "-properties", "--properties" }, description = "Sets the properties that should be passed to the test (e.g. \"-Dmy.var=5\")")
public String properties;

Expand Down Expand Up @@ -281,6 +284,14 @@ public void setDontRedirectToNull(final boolean dontRedirectToNull) {
this.dontRedirectToNull = dontRedirectToNull;
}

public boolean isOnlyMeasureWorkload() {
return onlyMeasureWorkload;
}

public void setOnlyMeasureWorkload(boolean onlyMeasureWorkload) {
this.onlyMeasureWorkload = onlyMeasureWorkload;
}

public String getProperties() {
return properties;
}
Expand Down Expand Up @@ -344,7 +355,8 @@ public ExecutionConfig getExecutionConfig() {

config.setExcludeLog4j(excludeLog4j);
config.setRedirectToNull(!dontRedirectToNull);

config.setOnlyMeasureWorkload(onlyMeasureWorkload);

if (config.isExecuteBeforeClassInMeasurement() && config.isOnlyMeasureWorkload()) {
throw new RuntimeException("executeBeforeClassInMeasurement may only be activated if onlyMeasureWorkload is deactivated!");
}
Expand Down

0 comments on commit fd14c86

Please sign in to comment.