7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2024-11-24 20:05:03 +00:00
kicad/qa/tests/pcbnew/test_save_load.cpp
Jon Evans 56e0811516 Phase 2 of padstack support
CHANGED: PCB file format now supports saving/loading complex padstacks

CHANGED: PTH pads are now rendered per copper layer in the copper color;
         the PTH pad color is no longer used.

ADDED: support for importing complex pad stacks from Altium PCBs

Enforce padstack-aware access to pad properties across KiCad

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8182
2024-10-01 19:55:03 -04:00

72 lines
2.6 KiB
C++

/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <filesystem>
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <pcbnew_utils/board_test_utils.h>
#include <pcbnew_utils/board_file_utils.h>
#include <board.h>
#include <settings/settings_manager.h>
struct SAVE_LOAD_TEST_FIXTURE
{
SAVE_LOAD_TEST_FIXTURE() :
m_settingsManager( true /* headless */ )
{ }
SETTINGS_MANAGER m_settingsManager;
std::unique_ptr<BOARD> m_board;
};
BOOST_FIXTURE_TEST_CASE( RegressionSaveLoadTests, SAVE_LOAD_TEST_FIXTURE )
{
std::vector<wxString> tests = { "issue18",
"issue832",
"issue2568",
"issue5313",
"issue5854",
"issue6260",
"issue6945",
"issue7267",
"padstacks",
"padstacks_normal",
"padstacks_complex"
/* "issue8003" */ }; // issue8003 is flaky on some platforms
auto savePath = std::filesystem::temp_directory_path() / "group_saveload_tst.kicad_pcb";
for( const wxString& relPath : tests )
{
BOOST_TEST_CONTEXT( relPath )
KI_TEST::LoadBoard( m_settingsManager, relPath, m_board );
KI_TEST::DumpBoardToFile( *m_board.get(), savePath.string() );
std::unique_ptr<BOARD> board2 = KI_TEST::ReadBoardFromFileOrStream( savePath.string() );
}
}