KiCad PCB EDA Suite
test_save_load.cpp File Reference
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <pcbnew_utils/board_test_utils.h>
#include <pcbnew_utils/board_file_utils.h>
#include <boost/filesystem.hpp>
#include <board.h>
#include <settings/settings_manager.h>

Go to the source code of this file.

Classes

struct  SAVE_LOAD_TEST_FIXTURE
 

Functions

 BOOST_FIXTURE_TEST_CASE (RegressionSaveLoadTests, SAVE_LOAD_TEST_FIXTURE)
 

Function Documentation

◆ BOOST_FIXTURE_TEST_CASE()

BOOST_FIXTURE_TEST_CASE ( RegressionSaveLoadTests  ,
SAVE_LOAD_TEST_FIXTURE   
)

Definition at line 43 of file test_save_load.cpp.

44{
45 std::vector<wxString> tests = { "issue18",
46 "issue832",
47 "issue2568",
48 "issue5313",
49 "issue5854",
50 "issue6260",
51 "issue6945",
52 "issue7267",
53 "issue8003" };
54
55 auto savePath = boost::filesystem::temp_directory_path() / "group_saveload_tst.kicad_pcb";
56
57 for( const wxString& relPath : tests )
58 {
59 KI_TEST::LoadBoard( m_settingsManager, relPath, m_board );
60 KI_TEST::DumpBoardToFile( *m_board.get(), savePath.string() );
61
62 std::unique_ptr<BOARD> board2 = KI_TEST::ReadBoardFromFileOrStream( savePath.string() );
63 }
64}
void LoadBoard(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< BOARD > &aBoard)
std::unique_ptr< BOARD > ReadBoardFromFileOrStream(const std::string &aFilename, std::istream &aFallback)
Read a board from a file, or another stream, as appropriate.
void DumpBoardToFile(BOARD &board, const std::string &aFilename)
Utility function to simply write a Board out to a file.

References KI_TEST::DumpBoardToFile(), KI_TEST::LoadBoard(), and KI_TEST::ReadBoardFromFileOrStream().