KiCad PCB EDA Suite
eeschema/test_module.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <wx/init.h>
#include <unit_test_utils/wx_assert.h>

Go to the source code of this file.

Functions

void wxAssertThrower (const wxString &aFile, int aLine, const wxString &aFunc, const wxString &aCond, const wxString &aMsg)
 Main file for the Eeschema tests to be compiled. More...
 
bool init_unit_test ()
 
int main (int argc, char *argv[])
 

Function Documentation

◆ init_unit_test()

bool init_unit_test ( )

Definition at line 47 of file eeschema/test_module.cpp.

48 {
49  boost::unit_test::framework::master_test_suite().p_name.value = "Common Eeschema module tests";
50 
51  bool ok = wxInitialize();
52 
53  wxSetAssertHandler( &wxAssertThrower );
54 
55  return ok;
56 }
void wxAssertThrower(const wxString &aFile, int aLine, const wxString &aFunc, const wxString &aCond, const wxString &aMsg)
Main file for the Eeschema tests to be compiled.

References wxAssertThrower().

Referenced by main().

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 59 of file eeschema/test_module.cpp.

60 {
61  int ret = boost::unit_test::unit_test_main( &init_unit_test, argc, argv );
62 
63  // This causes some glib warnings on GTK3 (http://trac.wxwidgets.org/ticket/18274)
64  // but without it, Valgrind notices a lot of leaks from WX
65  wxUninitialize();
66 
67  return ret;
68 }
bool init_unit_test()

References init_unit_test().

◆ wxAssertThrower()

void wxAssertThrower ( const wxString &  aFile,
int  aLine,
const wxString &  aFunc,
const wxString &  aCond,
const wxString &  aMsg 
)

Main file for the Eeschema tests to be compiled.

Definition at line 40 of file eeschema/test_module.cpp.

42 {
43  throw KI_TEST::WX_ASSERT_ERROR( aFile, aLine, aFunc, aCond, aMsg );
44 }
An exception class to represent a WX assertion.
Definition: wx_assert.h:46

Referenced by init_unit_test().