[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master b15bc70 2/7: Declare error_prefix where all u
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master b15bc70 2/7: Declare error_prefix where all unit-test code can see it |
Date: |
Thu, 9 Feb 2017 19:49:25 -0500 (EST) |
branch: master
commit b15bc7025389f00695261a17158db39a9ab4f871
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Declare error_prefix where all unit-test code can see it
---
exit_codes.hpp | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/exit_codes.hpp b/exit_codes.hpp
index b55ee9b..709bb83 100644
--- a/exit_codes.hpp
+++ b/exit_codes.hpp
@@ -54,6 +54,7 @@
#include "config.hpp"
#include <cstdlib>
+#include <string>
// GWC changed namespace 'boost' to prevent any conflict with code in
// a later version of boost.
@@ -74,11 +75,20 @@ namespace lmi_test
// their own error reporting. Values > 255 are sometimes reserved for
// system detected errors. 200/201 were suggested to minimize conflict.
- int const exit_success = EXIT_SUCCESS; // implementation-defined value
- int const exit_failure = EXIT_FAILURE; // implementation-defined value
+ int const exit_success = EXIT_SUCCESS; // implementation-defined value
+ int const exit_failure = EXIT_FAILURE; // implementation-defined value
int const exit_exception_failure = 200; // otherwise uncaught exception
- int const exit_test_failure = 201; // report_error or
+ int const exit_test_failure = 201; // report_error or
// report_critical_error called.
+
+ // Decoration of test results. This goes slightly beyond the goal of the
+ // original boost implementation, which was merely to propose non-macro
+ // exit codes for standardization, yet it's not illogical (because the
+ // purpose is to report success or failure at exit), and it's convenient
+ // (because this is the one header included by all unit-test files) to
+ // write such declarations here.
+
+ extern std::string error_prefix;
} // namespace lmi_test
#endif // exit_codes_hpp
- [lmi-commits] [lmi] master updated (39d1ed2 -> a306d67), Greg Chicares, 2017/02/09
- [lmi-commits] [lmi] master b15bc70 2/7: Declare error_prefix where all unit-test code can see it,
Greg Chicares <=
- [lmi-commits] [lmi] master 169b029 1/7: Move error_prefix to a different namespace, Greg Chicares, 2017/02/09
- [lmi-commits] [lmi] master d4e4860 3/7: Define a default error prefix, Greg Chicares, 2017/02/09
- [lmi-commits] [lmi] master cd8ae33 5/7: Robustify, Greg Chicares, 2017/02/09
- [lmi-commits] [lmi] master 1f9ca3c 6/7: Add success_prefix to complement error_prefix, Greg Chicares, 2017/02/09
- [lmi-commits] [lmi] master a306d67 7/7: Use a more distinctive marker for test failures, Greg Chicares, 2017/02/09
- [lmi-commits] [lmi] master 2fc9371 4/7: Use (default_)error_prefix in other appropriate cases, Greg Chicares, 2017/02/09