From 416a013faa238a3ad439d29ab44184eb558cca93 Mon Sep 17 00:00:00 2001 From: danglotb Date: Tue, 26 Nov 2019 14:55:15 +0100 Subject: [PATCH 1/2] fix: add a default value for test-methods command line options to avoid __no_default_value__ to be used by piccocli --- dspot/src/main/java/eu/stamp_project/Main.java | 4 ++++ .../eu/stamp_project/utils/program/InputConfiguration.java | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dspot/src/main/java/eu/stamp_project/Main.java b/dspot/src/main/java/eu/stamp_project/Main.java index 6b1aadb52..6a65d444e 100644 --- a/dspot/src/main/java/eu/stamp_project/Main.java +++ b/dspot/src/main/java/eu/stamp_project/Main.java @@ -131,6 +131,10 @@ public static void run(InputConfiguration inputConfiguration) { ); final List> testClassesToBeAmplified = testFinder.findTestClasses(inputConfiguration.getTestClasses()); final List testMethodsToBeAmplifiedNames = inputConfiguration.getTestCases(); + if (testMethodsToBeAmplifiedNames.size() == 1 && + testMethodsToBeAmplifiedNames.get(0).isEmpty()) { + testMethodsToBeAmplifiedNames.clear(); + } final TestSelector testSelector = inputConfiguration.getSelector().buildSelector(automaticBuilder, inputConfiguration); final List amplifiers = inputConfiguration diff --git a/dspot/src/main/java/eu/stamp_project/utils/program/InputConfiguration.java b/dspot/src/main/java/eu/stamp_project/utils/program/InputConfiguration.java index 6de8c9c84..5e5cf6278 100644 --- a/dspot/src/main/java/eu/stamp_project/utils/program/InputConfiguration.java +++ b/dspot/src/main/java/eu/stamp_project/utils/program/InputConfiguration.java @@ -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 testClasses; @@ -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 testCases = new ArrayList<>(); From fd6d7a080b9f3c64a46858f7a8c5be46dacbfc38 Mon Sep 17 00:00:00 2001 From: danglotb Date: Tue, 26 Nov 2019 14:56:59 +0100 Subject: [PATCH 2/2] doc: update doc with new default values and distinction between classes and cases --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 34d615589..7c40dc04b 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ Usage: eu.stamp_project.Main [-hvV] [--allow-path-in-assertions] [--clean] [--ex --automatic-builder= Specify the automatic builder to be used. Valid values: Maven, Gradle Default value: Maven -c, --cases, --test-cases, --test-methods=[,...] - Specify the test cases to amplify. + Specify the test cases to amplify.By default, DSpot selects all the tests methods. --cache-size= Specify the size of the memory cache in terms of the number of store entries Default value: 10000 @@ -305,7 +305,7 @@ Usage: eu.stamp_project.Main [-hvV] [--allow-path-in-assertions] [--clean] [--ex -t, --test=[,...] 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= 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 @@ -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.