20#include <boost/test/unit_test.hpp>
32#include <wx/filename.h>
33#include <wx/stdpaths.h>
52 wxString tempDir = wxStandardPaths::Get().GetTempDir();
53 wxString projectPath = tempDir + wxFileName::GetPathSeparator() + wxT(
"legacy_autosave.kicad_pro" );
56 m_schematic = std::make_unique<SCHEMATIC>(
nullptr );
65 wxFileName::Rmdir(
historyPath, wxPATH_RMDIR_RECURSIVE );
74 std::vector<SCH_SHEET*> sheets = m_schematic->GetTopLevelSheets();
83 std::vector<HISTORY_FILE_DATA> fileData;
84 m_schematic->SaveToHistory( m_settingsManager.Prj().GetProjectPath(), fileData );
90 wxFileName saved( fileData[0].relativePath );
92 BOOST_CHECK( saved.GetPath().Contains( wxS(
"legacy" ) ) );
93 BOOST_CHECK( !wxFileName( fileData[0].relativePath ).IsAbsolute() );
111 std::vector<SCH_SHEET*> sheets = m_schematic->GetTopLevelSheets();
117 sheet->
SetFileName( wxS(
"clean/clean.kicad_sch" ) );
121 std::vector<HISTORY_FILE_DATA> fileData;
122 m_schematic->SaveToHistory( m_settingsManager.Prj().GetProjectPath(), fileData );
void SetContentModified(bool aModified=true)
virtual COMMON_SETTINGS * GetCommonSettings() const
void SetFileName(const wxString &aFileName)
Set the file name for this screen to aFileName.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void SetFileName(const wxString &aFilename)
SCH_SCREEN * GetScreen() const
@ INCREMENTAL
Git-based local history (default)
static const std::string LegacySchematicFileExtension
static wxString historyPath(const wxString &aProjectPath)
PGM_BASE & Pgm()
The global program "get" accessor.
~HISTORY_AUTOSAVE_FIXTURE()
HISTORY_AUTOSAVE_FIXTURE()
SETTINGS_MANAGER m_settingsManager
std::unique_ptr< SCHEMATIC > m_schematic
SCOPED_SETTING_OVERRIDE(T &aRef, T aValue)
~SCOPED_SETTING_OVERRIDE()
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_CHECK(res.column_datatype(0)==SQL_NUMERIC||res.column_datatype(0)==SQL_DECIMAL)
BOOST_REQUIRE_EQUAL(rows.size(), 1)
BOOST_CHECK_EQUAL(std::any_cast< std::string >(rows[0].at("val")), "12345678901234567.89")
BOOST_REQUIRE(res.columns()==1)
BOOST_AUTO_TEST_SUITE_END()
BOOST_FIXTURE_TEST_CASE(SavesLegacySheetIntoHistoryPath, HISTORY_AUTOSAVE_FIXTURE)
Definition of file extensions used in Kicad.