Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Default value for test methods command line option #925

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Usage: eu.stamp_project.Main [-hvV] [--allow-path-in-assertions] [--clean] [--ex
--automatic-builder=<automaticBuilder>
Specify the automatic builder to be used. Valid values: Maven, Gradle Default value: Maven
-c, --cases, --test-cases, --test-methods=<testCases>[,<testCases>...]
Specify the test cases to amplify.
Specify the test cases to amplify.By default, DSpot selects all the tests methods.
--cache-size=<cacheSize>
Specify the size of the memory cache in terms of the number of store entries Default
value: 10000
Expand Down Expand Up @@ -305,7 +305,7 @@ Usage: eu.stamp_project.Main [-hvV] [--allow-path-in-assertions] [--clean] [--ex
-t, --test=<testClasses>[,<testClasses>...]
Fully qualified names of test classes to be amplified. If the value is all, DSpot will
amplify the whole test suite. You can also use regex to describe a set of test classes.
By default, DSpot selects all the tests.
By default, DSpot selects all the tests classes.
--target-module=<targetModule>
Specify the module to be amplified. This value must be a relative path from value
specified by --absolute-path-to-project-root command-line option. If your project is
Expand All @@ -322,7 +322,7 @@ Usage: eu.stamp_project.Main [-hvV] [--allow-path-in-assertions] [--clean] [--ex
value: false
-v, --verbose Enable verbose mode of DSpot. Default value: false
-V, --version Print version information and exit.
--with-comment Enable comment on amplified test: details steps of the Amplification. Default value: false
--with-comment Enable comment on amplified test: details steps of the Amplification. Default value: falseg
```

For options that take list, the used separator is a comma `,`, whatever the platform you use.
Expand Down
4 changes: 4 additions & 0 deletions dspot/src/main/java/eu/stamp_project/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ public static void run(InputConfiguration inputConfiguration) {
);
final List<CtType<?>> testClassesToBeAmplified = testFinder.findTestClasses(inputConfiguration.getTestClasses());
final List<String> testMethodsToBeAmplifiedNames = inputConfiguration.getTestCases();
if (testMethodsToBeAmplifiedNames.size() == 1 &&
testMethodsToBeAmplifiedNames.get(0).isEmpty()) {
testMethodsToBeAmplifiedNames.clear();
}
final TestSelector testSelector =
inputConfiguration.getSelector().buildSelector(automaticBuilder, inputConfiguration);
final List<Amplifier> amplifiers = inputConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public class InputConfiguration {
description = "Fully qualified names of test classes to be amplified. " +
"If the value is all, DSpot will amplify the whole test suite. " +
"You can also use regex to describe a set of test classes. " +
"By default, DSpot selects all the tests."
"By default, DSpot selects all the tests classes."
)
private List<String> testClasses;

Expand All @@ -134,7 +134,9 @@ public class InputConfiguration {
@CommandLine.Option(
names = {"-c", "--cases", "--test-methods", "--test-cases"},
split = ",",
description = "Specify the test cases to amplify."
defaultValue = "",
description = "Specify the test cases to amplify." +
"By default, DSpot selects all the tests methods."
)
private List<String> testCases = new ArrayList<>();

Expand Down