82 wxFileName tempDir = MakeTempDir( wxT(
"odb-netlist" ) );
103 pad->SetNumber( wxT(
"1" ) );
123 wxFileName odbRoot( tempDir.GetFullPath(), wxEmptyString );
124 odbRoot.AppendDir( wxT(
"odb_out" ) );
125 BOOST_REQUIRE( odbRoot.Mkdir( wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL ) );
128 std::map<std::string, UTF8> props;
129 props[
"units"] =
"mm";
130 props[
"sigfig"] =
"6";
131 BOOST_REQUIRE_NO_THROW( odbExporter.
SaveBoard( odbRoot.GetFullPath(), board, &props ) );
134 wxFileName netlistFile( odbRoot.GetFullPath(), wxEmptyString );
135 netlistFile.AppendDir( wxT(
"steps" ) );
136 netlistFile.AppendDir( wxT(
"pcb" ) );
137 netlistFile.AppendDir( wxT(
"netlists" ) );
138 netlistFile.AppendDir( wxT(
"cadnet" ) );
139 netlistFile.SetFullName( wxT(
"netlist" ) );
142 wxString netlistContent = ReadFile( netlistFile );
145 wxFileName compFile( odbRoot.GetFullPath(), wxEmptyString );
146 compFile.AppendDir( wxT(
"steps" ) );
147 compFile.AppendDir( wxT(
"pcb" ) );
148 compFile.AppendDir( wxT(
"layers" ) );
149 compFile.AppendDir( wxT(
"comp_+_top" ) );
150 compFile.SetFullName( wxT(
"components" ) );
153 wxString compContent = ReadFile( compFile );
161 BOOST_CHECK_MESSAGE( compContent.Contains( wxT(
"100" ) ),
162 "Component file should contain the pad X coordinate" );
168 BOOST_CHECK_MESSAGE( !netlistContent.Contains( wxT(
"50.0" ) ),
169 "Netlist should not contain aux-origin-shifted X coordinate 50.0" );
170 BOOST_CHECK_MESSAGE( netlistContent.Contains( wxT(
"100.0" ) ),
171 "Netlist should contain the raw pad X coordinate 100.0" );
174 wxFileName::Rmdir( odbRoot.GetFullPath(), wxPATH_RMDIR_RECURSIVE );
175 wxFileName::Rmdir( tempDir.GetFullPath(), wxPATH_RMDIR_RECURSIVE );
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
void SaveBoard(const wxString &aFileName, BOARD &aBoard, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Write aBoard to a storage file in a format that this PCB_IO implementation knows about or it can be u...