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>
28#include <locale_io.h>
29
31{
32 SetPgm( new MOCK_PGM_BASE() );
33
34 boost::unit_test::framework::master_test_suite().p_name.value = "IPC API tests";
35
36 wxApp::SetInstance( new wxAppConsole );
37
38 // Ensure the "C" locale is used
40
41 bool ok = wxInitialize( boost::unit_test::framework::master_test_suite().argc,
42 boost::unit_test::framework::master_test_suite().argv );
43
44 if( ok )
45 {
46 wxSetAssertHandler( &KI_TEST::wxAssertThrower );
47
48 Pgm().InitPgm( true, true, true );
50 }
51
52 return ok;
53}
54
55
56int main( int argc, char* argv[] )
57{
58 return boost::unit_test::unit_test_main( &init_unit_test, argc, argv );
59}
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition locale_io.h:41
bool InitPgm(bool aHeadless=false, bool aSkipPyInit=false, bool aIsUnitTest=false)
Initialize this program.
Definition pgm_base.cpp:308
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition pgm_base.h:128
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Load a project or sets up a new project with a specified path.
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:960
PGM_BASE & Pgm()
The global program "get" accessor.
Definition pgm_base.cpp:946
see class PGM_BASE
std::vector< FAB_LAYER_COLOR > dummy
bool init_unit_test()