diff options
Diffstat (limited to 'indra/test')
-rw-r--r-- | indra/test/test.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/indra/test/test.cpp b/indra/test/test.cpp index ba81c6e49e..2f50d872ee 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -136,12 +136,9 @@ public: run_completed_(*mStream); } run_completed_(std::cout); - - if (mFailedTests > 0) - { - exit(1); - } } + + int getFailedTests() const { return mFailedTests; } private: void run_completed_(std::ostream &stream) @@ -340,9 +337,11 @@ int main(int argc, char **argv) tut::runner.get().run_tests(test_group); } + bool success = (callback.getFailedTests() == 0); + if (wait_at_exit) { - std::cerr << "Waiting for input before exiting..." << std::endl; + std::cerr << "Press return to exit..." << std::endl; std::cin.get(); } @@ -352,7 +351,7 @@ int main(int argc, char **argv) delete output; } - if (touch) + if (touch && success) { std::ofstream s; s.open(touch); @@ -361,5 +360,7 @@ int main(int argc, char **argv) } apr_terminate(); - return 0; + + int retval = (success ? 0 : 1); + return retval; } |