From d5248cced2471325aa79dc4db3e007044a447969 Mon Sep 17 00:00:00 2001 From: John Beard Date: Fri, 23 Nov 2018 10:26:19 +0000 Subject: [PATCH] QA: Initialise WX for the libcommon tests If this is not done, things like logging and trace don't work, as they need WX to be set up first. --- qa/common/test_module.cpp | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/qa/common/test_module.cpp b/qa/common/test_module.cpp index 38f18fd035..36183b2db7 100644 --- a/qa/common/test_module.cpp +++ b/qa/common/test_module.cpp @@ -22,11 +22,27 @@ */ /** - * Main file for the geometry tests to be compiled + * Main file for the libcommon tests to be compiled */ - -#define BOOST_TEST_MAIN -#define BOOST_TEST_MODULE "Common library module tests" - - #include + +#include + + +bool init_unit_test() +{ + boost::unit_test::framework::master_test_suite().p_name.value = "Common library module tests"; + return wxInitialize(); +} + + +int main( int argc, char* argv[] ) +{ + int ret = boost::unit_test::unit_test_main( &init_unit_test, argc, argv ); + + // This causes some glib warnings on GTK3 (http://trac.wxwidgets.org/ticket/18274) + // but without it, Valgrind notices a lot of leaks from WX + wxUninitialize(); + + return ret; +} \ No newline at end of file