KiCad PCB EDA Suite
Loading...
Searching...
No Matches
mock_pgm_base.h
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) 2019-2022 KiCad Developers, see CHANGELOG.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, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#pragma once
26#include <pgm_base.h>
27#include <config.h>
28
29// Suppress a warning that the mock methods don't override the base class methods because
30// turtlemocks doesn't seem to provide a way to actually annotate the methods with override.
31#ifdef HAVE_WINCONSISTENT_MISSING_OVERRIDE
32 _Pragma( "GCC diagnostic push" ) \
33 _Pragma( "GCC diagnostic ignored \"-Winconsistent-missing-override\"" )
34#endif
35
36MOCK_BASE_CLASS( MOCK_PGM_BASE, PGM_BASE )
37{
38 MOCK_PGM_BASE() : PGM_BASE() {};
39 virtual ~MOCK_PGM_BASE() {};
40
41 MOCK_METHOD( MacOpenFile, 1, void( const wxString& ) );
42 MOCK_METHOD( GetCommonSettings, 0, COMMON_SETTINGS*() );
43 MOCK_METHOD( SetTextEditor, 1, void( const wxString& ) );
44 MOCK_METHOD( GetTextEditor, 1, wxString&( bool ) );
45 MOCK_METHOD( AskUserForPreferredEditor, 1, const wxString( const wxString& ) );
46 MOCK_CONST_METHOD( IsKicadEnvVariableDefined, 0, bool() );
47 MOCK_CONST_METHOD( GetKicadEnvVariable, 0, const wxString&() );
48 MOCK_CONST_METHOD( GetPdfBrowserName, 0, const wxString&() );
49 MOCK_METHOD( SetPdfBrowserName, 1, void( const wxString& ) );
50 MOCK_CONST_METHOD( UseSystemPdfBrowser, 0, bool() );
51 MOCK_METHOD( ForceSystemPdfBrowser, 1, void( bool ) );
52 MOCK_METHOD( SetLanguage, 2, bool( wxString&, bool ) );
53 MOCK_METHOD( SetLanguageIdentifier, 1, void( int ) );
54 MOCK_METHOD( ReadPdfBrowserInfos, 0, void() );
55 MOCK_METHOD( WritePdfBrowserInfos, 0, void() );
56 MOCK_METHOD( SetLocalEnvVariable, 2, bool( const wxString&, const wxString& ) );
57 MOCK_METHOD( SetLocalEnvVariables, 0, void() );
58 MOCK_CONST_METHOD( GetLocalEnvVariables, 0, ENV_VAR_MAP&() );
59
60 int GetSelectedLanguageIdentifier() const override
61 {
62 return 0;
63 }
64
65 // following functions will not be mocked in order to mimic old qa behavior
66// MOCK_METHOD( App, 0, wxApp&() );
67// MOCK_METHOD( GetLocale, 0, wxLocale*() );
68// MOCK_METHOD( GetSettingsManager, 0, SETTINGS_MANAGER&() );
69// MOCK_METHOD( SetLanguagePath, 0, void() );
70// MOCK_CONST_METHOD( GetExecutablePath, 0, const wxString&() );
71// MOCK_METHOD( GetSettingsManager, 0, SETTINGS_MANAGER&() );
72};
73
74#ifdef HAVE_WINCONSISTENT_MISSING_OVERRIDE
75 _Pragma( "GCC diagnostic pop" )
76#endif
Container for data for KiCad programs.
Definition: pgm_base.h:102
std::map< wxString, ENV_VAR_ITEM > ENV_VAR_MAP
MOCK_BASE_CLASS(MOCK_PGM_BASE, PGM_BASE)
Definition: mock_pgm_base.h:36
see class PGM_BASE