File tree Expand file tree Collapse file tree 6 files changed +12
-8
lines changed
Expand file tree Collapse file tree 6 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -356,7 +356,7 @@ namespace {
356356 }
357357}
358358
359- void Duplo::Run (const Options& options) {
359+ int Duplo::Run (const Options& options) {
360360 std::streambuf* buf;
361361 std::streambuf* logbuf;
362362 std::ofstream of;
@@ -507,4 +507,8 @@ void Duplo::Run(const Options& options) {
507507 << std::endl
508508 << std::endl;
509509 }
510+
511+ return processResultTotal.Blocks () > 0
512+ ? EXIT_FAILURE
513+ : EXIT_SUCCESS;
510514}
Original file line number Diff line number Diff line change @@ -42,8 +42,7 @@ namespace {
4242 ignoreSameFilename,
4343 listFilename,
4444 outputFilename);
45- Duplo::Run (options);
46- return EXIT_SUCCESS;
45+ return Duplo::Run (options);
4746 } else {
4847 std::cout << " \n NAME\n " ;
4948 std::cout << " Duplo " << VERSION << " - duplicate source code block finder\n\n " ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ const std::string VERSION = "";
1414#endif
1515
1616namespace Duplo {
17- void Run (const Options& options);
17+ int Run (const Options& options);
1818}
1919
2020#endif
Original file line number Diff line number Diff line change 22
33@test " LineNumbers.c" {
44 run ./build/duplo -xml tests/Simple/LineNumbers.lst out.xml
5- [ " $status " -eq 0 ]
5+ [ " $status " -eq 1 ]
66 [ " ${lines[0]} " = " Loading and hashing files ... 2 done." ]
77}
88
Original file line number Diff line number Diff line change 22
33@test " LineNumbers.c" {
44 run ./build/duplo tests/Simple/LineNumbers.lst out.txt
5- [ " $status " -eq 0 ]
5+ [ " $status " -eq 1 ]
66 [ " ${lines[0]} " = " Loading and hashing files ... 2 done." ]
77 [ " ${lines[1]} " = " tests/Simple/LineNumbers.c found: 1 block(s)" ]
88}
Original file line number Diff line number Diff line change 22
33@test " simple_log.adb" {
44 run ./build/duplo -ml 2 tests/Simple_Ada/simple_log.lst out.txt
5- [ " $status " -eq 0 ]
5+ [ " $status " -eq 1 ]
66 [ " ${lines[0]} " = " Loading and hashing files ... 2 done." ]
77 [ " ${lines[1]} " = " tests/Simple_Ada/simple_log.adb found: 6 block(s)" ]
88}
99
1010@test " simple_log.adb out.txt" {
11- ./build/duplo -ml 2 tests/Simple_Ada/simple_log.lst -
11+ run ./build/duplo -ml 2 tests/Simple_Ada/simple_log.lst -
12+ [ " $status " -eq 1 ]
1213 run diff <( cat tests/Simple_Ada/expected.log) <( ./build/duplo -ml 2 tests/Simple_Ada/simple_log.lst -)
1314 [ " $status " -eq 0 ]
1415 printf ' Lines:\n'
You can’t perform that action at this time.
0 commit comments