KiCad PCB EDA Suite
Loading...
Searching...
No Matches
fuzz_init.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
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#include <wx/init.h>
21#include <wx/app.h>
22#include <kiplatform/app.h>
23#include <mock_pgm_base.h>
25#include <pcbnew_settings.h>
26
27
28int fuzz_init( int* argc, char*** argv )
29{
31 SetPgm( new MOCK_PGM_BASE() );
33
34 wxApp::SetInstance( new wxAppConsole );
35
36 if( !wxInitialize( *argc, *argv ) )
37 {
38 return 1;
39 }
40
41 wxSetAssertHandler( &KI_TEST::wxAssertThrower );
42
43 Pgm().InitPgm( true, true );
44
46
49
50 return 0;
51}
bool InitPgm(bool aHeadless=false, bool aIsUnitTest=false)
Initialize this program.
Definition pgm_base.cpp:320
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition pgm_base.h:124
T * RegisterSettings(T *aSettings, bool aLoadNow=true)
Take ownership of the pointer passed in.
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Load a project or sets up a new project with a specified path.
int fuzz_init(int *argc, char ***argv)
Initialize wxWidgets and KiCad PGM_BASE for fuzzing.
Definition fuzz_init.cpp:28
bool Init()
Perform application-specific initialization tasks.
Definition unix/app.cpp:40
void wxAssertThrower(const wxString &aFile, int aLine, const wxString &aFunc, const wxString &aCond, const wxString &aMsg)
Definition wx_assert.h:67
void SetMockConfigDir()
void SetPgm(PGM_BASE *pgm)
PGM_BASE & Pgm()
The global program "get" accessor.