KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_api_module.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include <boost/test/unit_test.hpp>
21#include <wx/app.h>
22
23#include <mock_pgm_base.h>
24#include <pgm_base.h>
26
27
29{
30 SetPgm( new MOCK_PGM_BASE() );
31
32 boost::unit_test::framework::master_test_suite().p_name.value = "IPC API tests";
33
34 wxApp::SetInstance( new wxAppConsole );
35
36 bool ok = wxInitialize( boost::unit_test::framework::master_test_suite().argc,
37 boost::unit_test::framework::master_test_suite().argv );
38
39 if( ok )
40 {
41 wxSetAssertHandler( &KI_TEST::wxAssertThrower );
42
43 Pgm().InitPgm( true, true, true );
44 }
45
46 return ok;
47}
48
49
50int main( int argc, char* argv[] )
51{
52 return boost::unit_test::unit_test_main( &init_unit_test, argc, argv );
53}
bool InitPgm(bool aHeadless=false, bool aSkipPyInit=false, bool aIsUnitTest=false)
Initialize this program.
Definition: pgm_base.cpp:457
main()
void wxAssertThrower(const wxString &aFile, int aLine, const wxString &aFunc, const wxString &aCond, const wxString &aMsg)
Definition: wx_assert.h:71
void SetPgm(PGM_BASE *pgm)
Definition: pgm_base.cpp:1087
PGM_BASE & Pgm()
The global program "get" accessor.
Definition: pgm_base.cpp:1073
see class PGM_BASE
bool init_unit_test()