From ee1d6acd7441f34d773001692eab90ef42a3d3dc Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Mon, 17 Apr 2017 15:44:52 +0100 Subject: [PATCH] [tests][c] Provide our own test runner main and setup a dummy error handler. --- tests/common/Tests.C.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/common/Tests.C.cpp b/tests/common/Tests.C.cpp index be6533a..b97cd90 100644 --- a/tests/common/Tests.C.cpp +++ b/tests/common/Tests.C.cpp @@ -1,4 +1,4 @@ -#define CATCH_CONFIG_MAIN +#define CATCH_CONFIG_RUNNER #include #include "managed.h" @@ -181,3 +181,12 @@ TEST_CASE("Arrays.C", "[C][Arrays]") { REQUIRE(strcmp(g_array_index(_string.array, gchar*, 1), "2") == 0); REQUIRE(strcmp(g_array_index(_string.array, gchar*, 2), "3") == 0); } + +int main( int argc, char* argv[] ) +{ + // Setup a null error handler so we can test exceptions. + mono_embeddinator_install_error_report_hook(0); + + int result = Catch::Session().run(argc, argv); + return (result < 0xff ? result : 0xff); +} \ No newline at end of file