summaryrefslogtreecommitdiff
path: root/uunit.h
diff options
context:
space:
mode:
Diffstat (limited to 'uunit.h')
-rw-r--r--uunit.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/uunit.h b/uunit.h
index 92feb8d..9ee6e5d 100644
--- a/uunit.h
+++ b/uunit.h
@@ -53,6 +53,11 @@ public:
std::size_t id;
};
+ struct exit_called
+ {
+ int exit_value;
+ };
+
//! Run test
//! \param test_suite the name of a test suite or null for all.
//! \param test_name the name of a test name inside a test suite. Only valid
@@ -323,4 +328,13 @@ void report_result(const char* name, const char* file, bool success)
std::function<void(const char*, const char*, bool)> uUnit::status_cb{report_result};
+extern "C"
+{
+void exit(int i)
+{
+ throw uUnit::exit_called{i};
+ while(1){}
+}
+}
+
#endif