Skip to content

Commit 258b798

Browse files
waywardmonkeysNikolajBjorner
authored andcommitted
test-z3: Improve help output. Provide help when no args.
1 parent f02170f commit 258b798

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/test/main.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
s += #MODULE; \
2323
void tst_##MODULE(); \
2424
if (do_display_usage) \
25-
std::cout << #MODULE << "\n"; \
25+
std::cout << " " << #MODULE << "\n"; \
2626
for (int i = 0; i < argc; i++) \
2727
if (test_all || strcmp(argv[i], #MODULE) == 0) { \
2828
enable_trace(#MODULE); \
@@ -38,7 +38,7 @@
3838
s += #MODULE; \
3939
void tst_##MODULE(char** argv, int argc, int& i); \
4040
if (do_display_usage) \
41-
std::cout << #MODULE << "\n"; \
41+
std::cout << " " << #MODULE << "(...)\n"; \
4242
for (int i = 0; i < argc; i++) \
4343
if (strcmp(argv[i], #MODULE) == 0) { \
4444
enable_trace(#MODULE); \
@@ -72,10 +72,15 @@ void display_usage() {
7272
#ifdef Z3DEBUG
7373
std::cout << " /dbg:tag enable assertions tagged with <tag>.\n";
7474
#endif
75+
std::cout << "\nModule names:\n";
7576
}
7677

7778
void parse_cmd_line_args(int argc, char ** argv, bool& do_display_usage, bool& test_all) {
7879
int i = 1;
80+
if (argc == 1) {
81+
display_usage();
82+
do_display_usage = true;
83+
}
7984
while (i < argc) {
8085
char * arg = argv[i];
8186
char * eq_pos = nullptr;

0 commit comments

Comments
 (0)