69 const std::map<std::string, UTF8>& aProps )
91 BOOST_CHECK( m_plugin.CanReadSchematicFile( goodPath ) );
98 BOOST_CHECK( !m_plugin.CanReadSchematicFile( txtPath ) );
105 BOOST_CHECK( !m_plugin.CanReadSchematicFile( legacyPath ) );
108 BOOST_CHECK( !m_plugin.CanReadSchematicFile( randomPath ) );
118 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/minimal_test.sch" );
139 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/minimal_test.sch" );
145 bool foundR1 =
false;
146 bool foundC1 =
false;
156 if( ref == wxT(
"R1" ) )
162 if( ref == wxT(
"C1" ) )
169 BOOST_CHECK_MESSAGE( foundR1,
"R1 symbol not found" );
170 BOOST_CHECK_MESSAGE( foundC1,
"C1 symbol not found" );
176 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/minimal_test.sch" );
201 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/minimal_test.sch" );
208 bool foundInput =
false;
209 bool foundMid =
false;
210 bool foundGnd =
false;
219 if( label->
GetText() == wxT(
"INPUT" ) )
221 else if( label->
GetText() == wxT(
"MID" ) )
223 else if( label->
GetText() == wxT(
"GND" ) )
229 BOOST_CHECK_MESSAGE( foundInput,
"INPUT label not found" );
230 BOOST_CHECK_MESSAGE( foundMid,
"MID label not found" );
231 BOOST_CHECK_MESSAGE( foundGnd,
"GND label not found" );
237 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/minimal_test.sch" );
243 int junctionCount = 0;
263 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
291 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
297 std::map<wxString, wxString> expectedValues = {
298 { wxT(
"U1" ), wxT(
"METROMINI" ) },
299 { wxT(
"U4" ), wxT(
"" ) },
300 { wxT(
"U2" ), wxT(
"" ) },
301 { wxT(
"R1" ), wxT(
"5k" ) },
302 { wxT(
"R2" ), wxT(
"62" ) },
303 { wxT(
"R3" ), wxT(
"320" ) },
304 { wxT(
"C1" ), wxT(
"1 uF" ) },
305 { wxT(
"C2" ), wxT(
"0.1 uF" ) },
306 { wxT(
"C3" ), wxT(
"22 uF 16V" ) },
307 { wxT(
"D1" ), wxT(
"" ) },
308 { wxT(
"L1" ), wxT(
"AT-1224-TWT-5V-2-R" ) },
309 { wxT(
"Q1" ), wxT(
"" ) },
310 { wxT(
"S1" ), wxT(
"" ) },
311 { wxT(
"RN1" ), wxT(
"1k" ) },
312 { wxT(
"J1" ), wxT(
"" ) },
315 std::set<wxString> foundRefs;
325 if( expectedValues.count( ref ) )
327 foundRefs.insert( ref );
328 wxString expectedVal = expectedValues[ref];
330 if( !expectedVal.IsEmpty() )
334 ref +
" value mismatch: expected '" + expectedVal +
"' got '"
340 for(
const auto& [ref, val] : expectedValues )
342 BOOST_CHECK_MESSAGE( foundRefs.count( ref ), ref +
" symbol not found" );
349 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
355 std::map<wxString, wxString> expectedFootprints = {
356 { wxT(
"U1" ), wxT(
"MetroMini" ) },
357 { wxT(
"R1" ), wxT(
"0805_reflow_solder_2" ) },
358 { wxT(
"C2" ), wxT(
"0603_reflow_solder" ) },
359 { wxT(
"D1" ), wxT(
"DO214AA_HSMB" ) },
360 { wxT(
"S1" ), wxT(
"TYCO_FSMJSM" ) },
361 { wxT(
"L1" ), wxT(
"buzzer.fp" ) },
362 { wxT(
"Q1" ), wxT(
"SOT23_3" ) },
363 { wxT(
"RN1" ), wxT(
"ResArray_1206x4_YC164" ) },
374 auto it = expectedFootprints.find( ref );
376 if( it != expectedFootprints.end() )
380 ref +
" footprint mismatch: expected '" + it->second +
"' got '"
389 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
397 std::map<wxString, int> expectedPinCounts = {
414 auto it = expectedPinCounts.find( ref );
416 if( it != expectedPinCounts.end() )
418 int pinCount =
static_cast<int>( sym->
GetLibPins().size() );
421 pinCount == it->second,
422 ref +
" pin count mismatch: expected " + std::to_string( it->second )
423 +
" got " + std::to_string( pinCount )
424 +
" (symbol may not have loaded from gschem-symbols/)" );
432 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
439 std::map<wxString, int> expectedPinCounts = {
453 auto it = expectedPinCounts.find( ref );
455 if( it != expectedPinCounts.end() )
457 int pinCount =
static_cast<int>( sym->
GetLibPins().size() );
460 pinCount == it->second,
461 ref +
" pin count mismatch: expected " + std::to_string( it->second )
462 +
" got " + std::to_string( pinCount )
463 +
" (stdlib stub may not have been found via gafrc)" );
474 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/priority_test/priority_test.sch" );
487 int pinCount =
static_cast<int>( sym->
GetLibPins().size() );
489 BOOST_CHECK_MESSAGE( pinCount == 3,
490 "Expected 3-pin local override, got " + std::to_string( pinCount )
491 +
" pins (project symbol should override system)" );
495 BOOST_FAIL(
"Symbol not found" );
501 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
510 std::set<wxString> expectedNets = {
511 wxT(
"5V" ), wxT(
"GND" ), wxT(
"SDA" ), wxT(
"SCL" ),
512 wxT(
"RST" ), wxT(
"BUZZ" ), wxT(
"D5" ), wxT(
"D6" ), wxT(
"AREF" ),
513 wxT(
"ENCA" ), wxT(
"ENCB" ), wxT(
"ENCC" ), wxT(
"EOLR" ), wxT(
"EOLL" ),
516 std::set<wxString> foundNets;
523 foundNets.insert( label->
GetText() );
527 for(
const wxString& net : expectedNets )
529 BOOST_CHECK_MESSAGE( foundNets.count( net ),
530 "Global label for net '" + net +
"' not found" );
537 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
543 std::map<wxString, int> labelCounts;
550 labelCounts[label->
GetText()]++;
567 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
575 std::map<wxString, int> powerCounts;
586 if( !libSym || !libSym->
IsPower() )
591 powerCounts[valText]++;
594 BOOST_CHECK_MESSAGE( refText.StartsWith( wxT(
"#PWR" ) ),
595 "Power symbol ref should start with #PWR, got: " + refText );
610 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
616 int junctionCount = 0;
626 BOOST_CHECK_GT( junctionCount, 0 );
632 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
638 std::map<wxString, int> refCounts;
653 for(
const auto& [ref, count] : refCounts )
655 BOOST_CHECK_MESSAGE( count == 1,
656 "Refdes '" + ref +
"' appears " + std::to_string( count )
657 +
" times (expected 1)" );
664 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
684 BOOST_CHECK_MESSAGE( start.
x >= 0 && start.
y >= 0,
685 "Wire start in negative space: ("
686 + std::to_string( start.
x ) +
", "
687 + std::to_string( start.
y ) +
")" );
688 BOOST_CHECK_MESSAGE(
end.x >= 0 &&
end.y >= 0,
689 "Wire end in negative space: ("
690 + std::to_string(
end.x ) +
", "
691 + std::to_string(
end.y ) +
")" );
698 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
712 BOOST_CHECK_MESSAGE( pos.
x >= 0 && pos.
y >= 0,
713 "Symbol at negative position: ("
714 + std::to_string( pos.
x ) +
", "
715 + std::to_string( pos.
y ) +
")" );
722 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
728 int rotatedCount = 0;
729 int mirroredCount = 0;
748 BOOST_CHECK_MESSAGE( rotatedCount > 0,
749 "Expected rotated components but found none" );
750 BOOST_CHECK_MESSAGE( mirroredCount > 0,
751 "Expected mirrored components but found none" );
757 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
764 bool foundTitle =
false;
765 bool foundAuthor =
false;
775 if(
text->GetText().Contains( wxT(
"AYAB Interface" ) ) )
778 if(
text->GetText().Contains( wxT(
"Windell" ) ) )
784 BOOST_CHECK_MESSAGE( foundTitle,
"Title text 'AYAB Interface' not found" );
785 BOOST_CHECK_MESSAGE( foundAuthor,
"Author text containing 'Windell' not found" );
791 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
799 std::map<std::pair<int, int>,
int> endpointCounts;
813 endpointCounts[{start.
x, start.
y}]++;
814 endpointCounts[{
end.x,
end.y}]++;
817 int sharedPoints = 0;
819 for(
const auto& [pos, count] : endpointCounts )
827 BOOST_CHECK_MESSAGE( sharedPoints > 50,
828 "Expected at least 50 shared wire endpoints for connectivity, got "
829 + std::to_string( sharedPoints ) );
835 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
849 BOOST_CHECK_MESSAGE( pos.
x >= 0 && pos.
y >= 0,
850 "Global label '" + label->
GetText()
851 +
"' at negative position: ("
852 + std::to_string( pos.
x ) +
", "
853 + std::to_string( pos.
y ) +
")" );
860 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
882 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/powermeter.sch" );
901 BOOST_CHECK( symbolCount > 5 );
902 BOOST_CHECK( wireCount > 10 );
912 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/comments_test.sch" );
938 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/old_format_test.sch" );
945 int noteLineCount = 0;
975 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/old_bus_pin_test.sch" );
1006 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/old_text_test.sch" );
1014 bool foundHello =
false;
1023 if(
text->GetText() == wxT(
"Hello World" ) )
1029 BOOST_CHECK_MESSAGE( foundHello,
"Text 'Hello World' not found in old-format file" );
1035 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/very_old_text_test.sch" );
1043 bool foundOldText =
false;
1052 if(
text->GetText() == wxT(
"Old Text" ) )
1053 foundOldText =
true;
1058 BOOST_CHECK_MESSAGE( foundOldText,
"Text 'Old Text' not found in very-old-format file" );
1064 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/bus_test.sch" );
1098 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/graphical_test.sch" );
1105 int symbolCount = 0;
1124 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
1146 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/graphical_test.sch" );
1165 BOOST_CHECK_MESSAGE( pos.
x != 0 && pos.
y != 0,
1166 "NC position should be non-zero after coordinate transform" );
1173 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/documentation_test.sch" );
1180 bool foundDatasheet =
false;
1190 if( dsField && dsField->
GetText() == wxT(
"http://www.example.com/datasheet.pdf" ) )
1191 foundDatasheet =
true;
1194 BOOST_CHECK_MESSAGE( foundDatasheet,
1195 "DATASHEET field with documentation URL not found" );
1201 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
1217 if( ref != wxT(
"D3" ) )
1222 BOOST_CHECK( descField->
GetText() == wxT(
"9V Power" ) );
1227 BOOST_FAIL(
"D3 symbol not found" );
1233 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
1240 int notesLineCount = 0;
1265 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/overbar_test.sch" );
1272 std::vector<wxString> textContents;
1279 textContents.push_back(
text->GetText() );
1284 BOOST_REQUIRE_GE( textContents.size(), 6u );
1286 bool foundFullOverbar =
false;
1287 bool foundTrailingOverbar =
false;
1288 bool foundPartialOverbar =
false;
1289 bool foundBackslash =
false;
1290 bool foundNoOverbar =
false;
1291 bool foundMultiOverbar =
false;
1293 for(
const wxString& txt : textContents )
1295 if( txt == wxT(
"~{ACTIVE}" ) )
1296 foundFullOverbar =
true;
1298 if( txt == wxT(
"DATA~{LOW}" ) )
1299 foundTrailingOverbar =
true;
1301 if( txt == wxT(
"ACTIVE ~{HIGH}" ) )
1302 foundPartialOverbar =
true;
1304 if( txt == wxT(
"\\backslash" ) )
1305 foundBackslash =
true;
1307 if( txt == wxT(
"No overbar here" ) )
1308 foundNoOverbar =
true;
1310 if( txt == wxT(
"~{CS} and ~{WR}" ) )
1311 foundMultiOverbar =
true;
1314 BOOST_CHECK_MESSAGE( foundFullOverbar,
1315 "Full overbar \\_ACTIVE\\_ -> ~{ACTIVE} not found" );
1316 BOOST_CHECK_MESSAGE( foundTrailingOverbar,
1317 "Trailing overbar DATA\\_LOW\\_ -> DATA~{LOW} not found" );
1318 BOOST_CHECK_MESSAGE( foundPartialOverbar,
1319 "Partial overbar ACTIVE \\_HIGH\\_ -> ACTIVE ~{HIGH} not found" );
1320 BOOST_CHECK_MESSAGE( foundBackslash,
1321 "Escaped backslash \\\\\\\\ -> \\ not found" );
1322 BOOST_CHECK_MESSAGE( foundNoOverbar,
1323 "Plain text 'No overbar here' not found" );
1324 BOOST_CHECK_MESSAGE( foundMultiOverbar,
1325 "Multiple overbars \\_CS\\_ and \\_WR\\_ -> ~{CS} and ~{WR} not found" );
1335 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/bezier_test.sch" );
1342 int bezierCount = 0;
1373 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/picture_test.sch" );
1380 int bitmapCount = 0;
1401 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/text_size_test.sch" );
1408 std::vector<SCH_TEXT*> texts;
1413 texts.push_back(
static_cast<SCH_TEXT*
>( item ) );
1416 BOOST_REQUIRE_GE( texts.size(), 2u );
1418 bool foundSize10 =
false;
1419 bool foundSize20 =
false;
1423 int h = t->GetTextSize().y;
1425 if( h == 10 * 10 * 254 )
1427 else if( h == 20 * 10 * 254 )
1431 BOOST_CHECK_MESSAGE( foundSize10,
"Expected text with size=10 (25400 IU)" );
1432 BOOST_CHECK_MESSAGE( foundSize20,
"Expected text with size=20 (50800 IU)" );
1439 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/text_angle_test.sch" );
1446 std::set<int> angles;
1459 BOOST_CHECK( angles.count( 900 ) > 0 );
1460 BOOST_CHECK( angles.count( 0 ) > 0 );
1461 BOOST_CHECK( angles.count( 1800 ) > 0 );
1469 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/relative_path_test.sch" );
1504 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/embedded_prefix_test.sch" );
1511 int symbolCount = 0;
1521 BOOST_CHECK_MESSAGE( !
name.StartsWith( wxT(
"EMBEDDED" ) ),
1522 "Symbol name should not have EMBEDDED prefix: " +
name );
1541 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/lepton_conf_test.sch" );
1548 bool foundR1 =
false;
1558 if( ref == wxT(
"R1" ) )
1561 int pinCount =
static_cast<int>( sym->
GetLibPins().size() );
1563 BOOST_CHECK_MESSAGE( pinCount == 2,
1564 "R1 pin count mismatch: expected 2 got "
1565 + std::to_string( pinCount )
1566 +
" (lepton.conf library discovery may have failed)" );
1571 BOOST_CHECK_MESSAGE( foundR1,
"R1 symbol not found" );
1581 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/gschemrc_test.sch" );
1596 if( ref == wxT(
"R1" ) )
1598 int pinCount =
static_cast<int>( sym->
GetLibPins().size() );
1600 BOOST_CHECK_MESSAGE( pinCount == 2,
1601 "R1 pin count mismatch: expected 2 got "
1602 + std::to_string( pinCount )
1603 +
" (gschemrc library discovery may have failed)" );
1608 BOOST_FAIL(
"R1 symbol not found" );
1621 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/bus_ripper_test.sch" );
1628 int busEntryCount = 0;
1642 BOOST_CHECK_MESSAGE( size.
x < 0,
1643 "Bus entry x-size should be negative (wire goes left)" );
1674 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/symversion_test.sch" );
1679 wxString messages =
reporter.GetMessages();
1681 BOOST_CHECK_MESSAGE( messages.Contains( wxT(
"version mismatch" ) ),
1682 "Expected symversion mismatch warning in reporter output, got: "
1684 BOOST_CHECK_MESSAGE( messages.Contains( wxT(
"R1" ) ),
1685 "Expected R1 reference in warning message, got: " + messages );
1694 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/fuzzy_match_test.sch" );
1698 wxString messages =
reporter.GetMessages();
1700 BOOST_CHECK_MESSAGE( messages.Contains( wxT(
"Did you mean" ) ),
1701 "Expected fuzzy match suggestion in reporter output, got: "
1703 BOOST_CHECK_MESSAGE( messages.Contains( wxT(
"resistor-1.sym" ) ),
1704 "Expected 'resistor-1.sym' as suggestion, got: " + messages );
1716 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/hierarchy_test.sch" );
1725 bool foundS1 =
false;
1735 if(
name == wxT(
"S1" ) )
1745 BOOST_REQUIRE_MESSAGE( subScreen,
"Sub-sheet screen should not be null" );
1747 int subWireCount = 0;
1760 BOOST_CHECK_MESSAGE( subWireCount > 0,
1761 "Sub-schematic should contain wires" );
1775 BOOST_CHECK_MESSAGE( foundS1,
"Sheet S1 not found" );
1784 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/hierarchy_test.sch" );
1801 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/multislot_test.sch" );
1808 std::vector<SCH_SYMBOL*> symbols;
1813 symbols.push_back(
static_cast<SCH_SYMBOL*
>( item ) );
1816 BOOST_REQUIRE_EQUAL( symbols.size(), 2u );
1819 std::sort( symbols.begin(), symbols.end(),
1822 return a->GetPosition().x < b->GetPosition().x;
1826 std::set<wxString> slot1Pins;
1828 for(
SCH_PIN*
pin : symbols[0]->GetLibPins() )
1829 slot1Pins.insert(
pin->GetNumber() );
1831 BOOST_CHECK_MESSAGE( slot1Pins.count( wxT(
"1" ) ),
"Slot 1 missing pin 1" );
1832 BOOST_CHECK_MESSAGE( slot1Pins.count( wxT(
"2" ) ),
"Slot 1 missing pin 2" );
1833 BOOST_CHECK_MESSAGE( slot1Pins.count( wxT(
"3" ) ),
"Slot 1 missing pin 3" );
1834 BOOST_CHECK_MESSAGE( !slot1Pins.count( wxT(
"4" ) ),
"Slot 1 should not have pin 4" );
1837 std::set<wxString> slot2Pins;
1839 for(
SCH_PIN*
pin : symbols[1]->GetLibPins() )
1840 slot2Pins.insert(
pin->GetNumber() );
1842 BOOST_CHECK_MESSAGE( slot2Pins.count( wxT(
"4" ) ),
"Slot 2 missing pin 4" );
1843 BOOST_CHECK_MESSAGE( slot2Pins.count( wxT(
"5" ) ),
"Slot 2 missing pin 5" );
1844 BOOST_CHECK_MESSAGE( slot2Pins.count( wxT(
"6" ) ),
"Slot 2 missing pin 6" );
1845 BOOST_CHECK_MESSAGE( !slot2Pins.count( wxT(
"1" ) ),
"Slot 2 should not have pin 1" );
1857 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/graphical_attr_test.sch" );
1864 bool foundR1 =
false;
1865 bool foundR2 =
false;
1875 if( ref == wxT(
"R1" ) )
1883 if( ref == wxT(
"R2" ) )
1892 BOOST_CHECK_MESSAGE( foundR1,
"R1 symbol not found" );
1893 BOOST_CHECK_MESSAGE( foundR2,
"R2 symbol not found" );
1907 std::map<std::string, UTF8> props;
1908 props[
"additional_schematics"] = page2Path;
1910 SCH_SHEET* sheet = LoadGedaSchematicWithProperties(
"/io/geda/multipage_page1.sch", props );
1933 subSheet =
static_cast<SCH_SHEET*
>( item );
1946 wxT(
"multipage_page2.sch" ) );
1950 BOOST_REQUIRE_MESSAGE( subScreen,
"Sub-sheet screen should not be null" );
1952 int subWireCount = 0;
1965 BOOST_CHECK_MESSAGE( subWireCount > 0,
"Sub-sheet should contain wires from page 2" );
1971 std::vector<wxString> builtinNames = {
1972 wxT(
"resistor-1.sym" ), wxT(
"resistor-2.sym" ),
1973 wxT(
"capacitor-1.sym" ), wxT(
"capacitor-2.sym" ),
1974 wxT(
"gnd-1.sym" ), wxT(
"gnd-2.sym" ),
1975 wxT(
"generic-power.sym" ),
1976 wxT(
"input-1.sym" ), wxT(
"output-1.sym" ),
1977 wxT(
"nc-right-1.sym" ), wxT(
"nc-left-1.sym" ),
1978 wxT(
"terminal-1.sym" ),
1979 wxT(
"vcc-1.sym" ), wxT(
"vcc-2.sym" ),
1980 wxT(
"vdd-1.sym" ), wxT(
"vss-1.sym" ),
1982 wxT(
"5V-plus-1.sym" ), wxT(
"3.3V-plus-1.sym" ),
1983 wxT(
"12V-plus-1.sym" ),
1984 wxT(
"diode-1.sym" ), wxT(
"zener-1.sym" ),
1985 wxT(
"schottky-1.sym" ), wxT(
"led-1.sym" ),
1986 wxT(
"npn-1.sym" ), wxT(
"pnp-1.sym" ),
1987 wxT(
"nmos-1.sym" ), wxT(
"pmos-1.sym" ),
1988 wxT(
"opamp-1.sym" ), wxT(
"inductor-1.sym" ),
1989 wxT(
"7400-1.sym" ), wxT(
"7402-1.sym" ),
1990 wxT(
"7404-1.sym" ), wxT(
"7408-1.sym" ),
1991 wxT(
"7432-1.sym" ), wxT(
"7486-1.sym" ),
1992 wxT(
"busripper-1.sym" ), wxT(
"busripper-2.sym" ),
1993 wxT(
"title-B.sym" ),
1998 for(
const wxString&
name : builtinNames )
2000 BOOST_CHECK_MESSAGE( symbols.find(
name ) != symbols.end(),
2001 "Builtin symbol should exist: " +
name );
2003 if( symbols.find(
name ) != symbols.end() )
2005 const wxString& content = symbols.at(
name );
2006 BOOST_CHECK_MESSAGE( content.StartsWith( wxT(
"v " ) ),
2007 "Builtin symbol should start with version line: " +
name );
2011 BOOST_CHECK_GE( symbols.size(), builtinNames.size() );
2017 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/tjunction_test.sch" );
2023 int junctionCount = 0;
2048 auto it = builtins.find( wxT(
"7400-1.sym" ) );
2055 wxString tempPath = wxFileName::CreateTempFileName( wxT(
"geda_pin_test_" ) );
2059 wxFile temp( tempPath, wxFile::write );
2061 temp.Write( it->second );
2065 std::unique_ptr<LIB_SYMBOL> sym;
2073 wxRemoveFile( tempPath );
2076 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/minimal_test.sch" );
2100 std::vector<SCH_PIN*> pins = libSym->
GetPins();
2102 BOOST_REQUIRE_GE( pins.size(), 2u );
2105 bool hasRight =
false;
2106 bool hasLeft =
false;
2117 BOOST_CHECK_MESSAGE( hasRight && hasLeft,
2118 "Resistor should have both PIN_RIGHT and PIN_LEFT pins" );
2126 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/ayab/ayab_rs.sch" );
2135 int pageWidthMils =
schIUScale.IUToMils( pageSizeIU.
x );
2136 int pageHeightMils =
schIUScale.IUToMils( pageSizeIU.
y );
2140 BOOST_CHECK_LT( pageWidthMils, 40000 );
2141 BOOST_CHECK_LT( pageHeightMils, 30000 );
2142 BOOST_CHECK_GT( pageWidthMils, 20000 );
2143 BOOST_CHECK_GT( pageHeightMils, 15000 );
2149 bbox.
Merge( item->GetBoundingBox() );
2157 BOOST_CHECK_GE( bbox.
GetOrigin().
x, -margin );
2158 BOOST_CHECK_GE( bbox.
GetOrigin().
y, -margin );
2159 BOOST_CHECK_LE( bbox.
GetEnd().
x, pageSizeIU.
x + margin );
2160 BOOST_CHECK_LE( bbox.
GetEnd().
y, pageSizeIU.
y + margin );
2173 SCH_SHEET* sheet = LoadGedaSchematic(
"/io/geda/power_override_test/power_override_test.sch" );
2178 bool foundPower =
false;
2199 BOOST_CHECK_MESSAGE( foundPower,
2200 "gnd-1.sym without net= attribute should still be detected as power "
2201 "symbol when builtin has net=GND:1" );
2209 std::map<std::string, UTF8> props;
2210 props[
"sym_search_paths"] = extraDir;
2212 SCH_SHEET* sheet = LoadGedaSchematicWithProperties(
"/io/geda/props_test.sch", props );
2225 int pinCount =
static_cast<int>( sym->
GetLibPins().size() );
2227 BOOST_CHECK_MESSAGE( pinCount == 2,
2228 "Expected 2-pin symbol from extra-syms, got "
2229 + std::to_string( pinCount ) );
2233 BOOST_FAIL(
"Symbol not found" );
constexpr EDA_IU_SCALE schIUScale
constexpr const Vec GetEnd() const
constexpr size_type GetWidth() const
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
constexpr size_type GetHeight() const
constexpr const Vec & GetOrigin() const
int AsTenthsOfADegree() const
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual bool IsVisible() const
virtual EDA_ANGLE GetTextAngle() const
const UTF8 & GetLibItemName() const
Define a library symbol object.
bool IsPower() const override
std::vector< SCH_PIN * > GetPins() const override
bool IsGlobalPower() const override
Describe the page size and margins of a paper page on which to eventually print or plot.
const VECTOR2D GetSizeIU(double aIUScale) const
Gets the page size in internal units.
Holds all the data relating to one schematic.
Class for a wire to bus entry.
virtual const wxString & GetText() const override
Return the string associated with the text object.
A SCH_IO derivation for loading gEDA/gschem schematic files (.sch).
static const std::map< wxString, wxString > & getBuiltinSymbols()
Return the map of built-in gEDA symbol definitions (symbol name -> .sym content).
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Segment description base class to describe items which have 2 end points (track, wire,...
VECTOR2I GetEndPoint() const
VECTOR2I GetStartPoint() const
VECTOR2I GetPosition() const override
const PAGE_INFO & GetPageSettings() const
EE_RTREE & Items()
Get the full RTree, usually for iterating.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this sheet.
SCH_SCREEN * GetScreen() const
bool GetExcludedFromSim(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
bool GetExcludedFromBOM(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
VECTOR2I GetPosition() const override
const LIB_ID & GetLibId() const override
std::vector< SCH_PIN * > GetLibPins() const
Populate a vector with all the pins from the library object that match the current unit and bodyStyle...
bool GetExcludedFromBoard(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
int GetOrientation() const override
Get the display symbol orientation.
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
VECTOR2I GetPosition() const override
A wrapper for reporting to a wxString object.
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
@ PIN_RIGHT
The pin extends rightwards from the connection point.
@ PIN_LEFT
The pin extends leftwards from the connection point: Probably on the right side of the symbol.
SCH_SHEET * LoadGedaSchematicWithProperties(const std::string &aRelPath, const std::map< std::string, UTF8 > &aProps)
SETTINGS_MANAGER m_manager
~GEDA_SCH_IMPORT_FIXTURE()
GEDA_SCH_IMPORT_FIXTURE()
std::unique_ptr< SCHEMATIC > m_schematic
SCH_SHEET * LoadGedaSchematic(const std::string &aRelPath)
@ DESCRIPTION
Field Description of part, i.e. "1/4W 1% Metal Film Resistor".
@ FOOTPRINT
Field Name Module PCB, i.e. "16DIP300".
@ DATASHEET
name of datasheet
@ REFERENCE
Field Reference of part, i.e. "IC21".
@ VALUE
Field Value of part, i.e. "3.3K".
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_CASE(CanReadSchematicFile)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
IbisParser parser & reporter
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I