KiCad PCB EDA Suite
eeschema/test_module.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <kiplatform/app.h>
#include <pgm_base.h>
#include <wx/app.h>
#include <wx/init.h>
#include <qa_utils/wx_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 50 of file eeschema/test_module.cpp.

51{
53 boost::unit_test::framework::master_test_suite().p_name.value = "Common Eeschema module tests";
54
55 wxApp::SetInstance( new wxAppConsole );
56
57 bool ok = wxInitialize( boost::unit_test::framework::master_test_suite().argc,
58 boost::unit_test::framework::master_test_suite().argv );
59
60 wxSetAssertHandler( &wxAssertThrower );
61
62 Pgm().InitPgm( true, true );
63
64 return ok;
65}
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.
bool Init()
Perform application-specific initialization tasks.
Definition: gtk/app.cpp:40
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111

References KIPLATFORM::APP::Init(), Pgm(), and wxAssertThrower().

Referenced by main().

◆ main()

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

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

69{
70 int ret = boost::unit_test::unit_test_main( &init_unit_test, argc, argv );
71
72 Pgm().Destroy();
73
74 // This causes some glib warnings on GTK3 (http://trac.wxwidgets.org/ticket/18274)
75 // but without it, Valgrind notices a lot of leaks from WX
76 wxUninitialize();
77
78 return ret;
79}
bool init_unit_test()

References init_unit_test(), and Pgm().

◆ 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 43 of file eeschema/test_module.cpp.

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

Referenced by init_unit_test().