8000 Add command-line param `--coverage-schemes` · pen-dev/utPLSQL-cli@bbbdbb5 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit bbbdbb5

Browse files
committed
Add command-line param --coverage-schemes
1 parent ba997a9 commit bbbdbb5

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

src/main/java/org/utplsql/cli/RunPicocliCommand.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ public class RunPicocliCommand implements IRunCommand {
2828
split = ",")
2929
private List<String> tags = new ArrayList<>();
3030

31+
@Option(names = {"--coverage-schemes"},
32+
description = "comma-separated list of schemas on which coverage should be gathered",
33+
split = ",")
34+
private List<String> coverageSchemes = new ArrayList<>();
35+
3136

3237
@Option(
3338
names = {"-c", "--color"},
@@ -238,7 +243,8 @@ public RunCommandConfig getRunCommandConfig() {
238243
enableDbmsOutput,
239244
randomTestOrder,
240245
randomTestOrderSeed,
241-
tags.toArray(new String[0]));
246+
tags.toArray(new String[0]),
247+
coverageSchemes.toArray(new String[0]));
242248
}
243249

244250
private RunAction getRunAction() {

src/main/java/org/utplsql/cli/config/RunCommandConfig.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ public class RunCommandConfig extends ConnectionConfig {
2222
private boolean randomTestOrder = false;
2323
private final Integer randomTestOrderSeed;
2424
private final String[] tags;
25+
private final String[] coverageSchemes;
2526

26-
@ConstructorProperties({"connectString", "suitePaths", "reporters", "outputAnsiColor", "failureExitCode", "skipCompatibilityCheck", "includePackages", "excludePackages", "sourceMapping", "testMapping", "logConfigLevel", "timeoutInMinutes", "dbmsOutput", "randomTestOrder", "randomTestOrderSeed", "tags"})
27-
public RunCommandConfig(String connectString, String[] suitePaths, ReporterConfig[] reporters, boolean outputAnsiColor, Integer failureExitCode, boolean skipCompatibilityCheck, String[] includePackages, String[] excludePackages, FileMapperConfig sourceMapping, FileMapperConfig testMapping, ConfigLevel logConfigLevel, Integer timeoutInMinutes, boolean dbmsOutput, boolean randomTestOrder, Integer randomTestOrderSeed, String[] tags) {
27+
@ConstructorProperties({"connectString", "suitePaths", "reporters", "outputAnsiColor", "failureExitCode", "skipCompatibilityCheck", "includePackages", "excludePackages", "sourceMapping", "testMapping", "logConfigLevel", "timeoutInMinutes", "dbmsOutput", "randomTestOrder", "randomTestOrderSeed", "tags", "coverageSchemes"})
28+
public RunCommandConfig(String connectString, String[] suitePaths, ReporterConfig[] reporters, boolean outputAnsiColor, Integer failureExitCode, boolean skipCompatibilityCheck, String[] includePackages, String[] excludePackages, FileMapperConfig sourceMapping, FileMapperConfig testMapping, ConfigLevel logConfigLevel, Integer timeoutInMinutes, boolean dbmsOutput, boolean randomTestOrder, Integer randomTestOrderSeed, String[] tags, String[] coverageSchemes) {
2829
super(connectString);
2930
this.suitePaths = suitePaths;
3031
this.reporters = reporters;
@@ -41,6 +42,7 @@ public RunCommandConfig(String connectString, String[] suitePaths, ReporterConfi
4142
this.randomTestOrder = randomTestOrder;
4243
this.randomTestOrderSeed = randomTestOrderSeed;
4344
this.tags = tags;
45+
this.coverageSchemes = coverageSchemes;
4446
}
4547

4648
public String[] getSuitePaths() {
@@ -102,4 +104,6 @@ public boolean isRandomTestOrder() {
102104
public Integer getRandomTestOrderSeed() {
103105
return randomTestOrderSeed;
104106
}
107+
108+
public String[] getCoverageSchemes() { return coverageSchemes; }
105109
}

src/test/java/org/utplsql/cli/PicocliRunCommandTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ void runCommandAllArguments() throws Exception {
4848
"-type_mapping=\"tsql=PACKAGE BODY\"",
4949
"-owner_subexpression=1",
5050
"-type_subexpression=2",
51-
"-name_subexpression=3");
51+
"-name_subexpression=3",
52+
"--coverage-schemes=schema1,other_schema");
5253

5354
assertNotNull(config.getConnectString());
5455
assertThat( config.getSuitePaths(), is(new String[]{"app.betwnstr", "app.basic"}));
@@ -65,6 +66,7 @@ void runCommandAllArguments() throws Exception {
6566
assertEquals( 123, config.getRandomTestOrderSeed() );
6667
assertNotNull( config.getReporters() );
6768
assertEquals( 1, config.getReporters().length );
69+
assertThat( config.getCoverageSchemes(), is(new String[]{"schema1", "other_schema"}) );
6870

6971
// Source FileMapping
7072
assertNotNull(config.getSourceMapping());

0 commit comments

Comments
 (0)
0