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 (C) 2024 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>
23
24
25void wxAssertThrower( const wxString& aFile, int aLine, const wxString& aFunc,
26 const wxString& aCond, const wxString& aMsg )
27{
28 throw KI_TEST::WX_ASSERT_ERROR( aFile, aLine, aFunc, aCond, aMsg );
29}
30
31
33{
34 boost::unit_test::framework::master_test_suite().p_name.value = "IPC API tests";
35
36 wxApp::SetInstance( new wxAppConsole );
37
38 bool ok = wxInitialize( boost::unit_test::framework::master_test_suite().argc,
39 boost::unit_test::framework::master_test_suite().argv );
40
41 wxSetAssertHandler( &wxAssertThrower );
42
43 return ok;
44}
45
46
47int main( int argc, char* argv[] )
48{
49 return boost::unit_test::unit_test_main( &init_unit_test, argc, argv );
50}
An exception class to represent a WX assertion.
Definition: wx_assert.h:47
main()
bool init_unit_test()
void wxAssertThrower(const wxString &aFile, int aLine, const wxString &aFunc, const wxString &aCond, const wxString &aMsg)