Skip to content

Commit cefd3ce

Browse files
Extract constants for --cover help message and options
These were previously duplicated between 3 different executables.
1 parent 3fec6e1 commit cefd3ce

File tree

7 files changed

+18
-7
lines changed

7 files changed

+18
-7
lines changed

jbmc/src/jdiff/jdiff_parse_options.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ void jdiff_parse_optionst::help()
367367
"\n"
368368
"Program instrumentation options:\n"
369369
HELP_GOTO_CHECK
370-
" --cover CC create test-suite with coverage criterion CC\n" // NOLINT(*)
370+
HELP_COVER
371371
"Java Bytecode frontend options:\n"
372372
JAVA_BYTECODE_LANGUAGE_OPTIONS_HELP
373373
"Other options:\n"

jbmc/src/jdiff/jdiff_parse_options.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Author: Peter Schrammel
2323
#include <goto-programs/show_goto_functions.h>
2424
#include <goto-programs/show_properties.h>
2525

26+
#include <goto-instrument/cover.h>
27+
2628
class goto_modelt;
2729

2830
// clang-format off
@@ -31,7 +33,7 @@ class goto_modelt;
3133
OPT_SHOW_GOTO_FUNCTIONS \
3234
OPT_SHOW_PROPERTIES \
3335
OPT_GOTO_CHECK \
34-
"(cover):" \
36+
OPT_COVER \
3537
"(verbosity):(version)" \
3638
"(no-lazy-methods)" /* should go away */ \
3739
"(no-refine-strings)" /* should go away */ \

src/cbmc/cbmc_parse_options.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ void cbmc_parse_optionst::help()
11181118
" --no-assertions ignore user assertions\n"
11191119
" --no-assumptions ignore user assumptions\n"
11201120
" --error-label label check that label is unreachable\n"
1121-
" --cover CC create test-suite with coverage criterion CC\n" // NOLINT(*)
1121+
HELP_COVER
11221122
" --mm MM memory consistency model for concurrent programs\n" // NOLINT(*)
11231123
// NOLINTNEXTLINE(whitespace/line_length)
11241124
" --malloc-fail-assert set malloc failure mode to assert-then-assume\n"

src/cbmc/cbmc_parse_options.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Author: Daniel Kroening, [email protected]
3434
#include <json/json_interface.h>
3535
#include <xmllang/xml_interface.h>
3636

37+
#include <goto-instrument/cover.h>
38+
3739
class goto_functionst;
3840
class optionst;
3941

@@ -73,8 +75,9 @@ class optionst;
7375
"(property):(stop-on-fail)(trace)" \
7476
"(error-label):(verbosity):(no-library)" \
7577
"(nondet-static)" \
76-
"(version)" \
77-
"(cover):(symex-coverage-report):" \
78+
"(version)" \
79+
OPT_COVER \
80+
"(symex-coverage-report):" \
7881
"(mm):" \
7982
OPT_TIMESTAMP \
8083
"(i386-linux)(i386-macos)(i386-win32)(win32)(winx64)(gcc)" \

src/goto-diff/goto_diff_parse_options.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ void goto_diff_parse_optionst::help()
411411
"\n"
412412
"Program instrumentation options:\n"
413413
HELP_GOTO_CHECK
414-
" --cover CC create test-suite with coverage criterion CC\n" // NOLINT(*)
414+
HELP_COVER
415415
"Other options:\n"
416416
" --version show version and exit\n"
417417
" --json-ui use JSON-formatted output\n"

src/goto-diff/goto_diff_parse_options.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Author: Peter Schrammel
2222
#include <goto-programs/show_goto_functions.h>
2323
#include <goto-programs/show_properties.h>
2424

25+
#include <goto-instrument/cover.h>
26+
2527
class goto_modelt;
2628
class optionst;
2729

@@ -31,7 +33,7 @@ class optionst;
3133
OPT_SHOW_GOTO_FUNCTIONS \
3234
OPT_SHOW_PROPERTIES \
3335
OPT_GOTO_CHECK \
34-
"(cover):" \
36+
OPT_COVER \
3537
"(verbosity):(version)" \
3638
OPT_FLUSH \
3739
OPT_TIMESTAMP \

src/goto-instrument/cover.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ class message_handlert;
2222
class cmdlinet;
2323
class optionst;
2424

25+
#define OPT_COVER "(cover):"
26+
#define HELP_COVER \
27+
" --cover CC create test-suite with coverage criterion CC\n"
28+
2529
enum class coverage_criteriont
2630
{
2731
LOCATION,

0 commit comments

Comments
 (0)