37const char* TWO_INSTANCE_NETLIST =
38 "(export (version \"E\")\n"
40 " (comp (ref \"Q1\")\n"
41 " (value \"BC817\")\n"
42 " (footprint \"TestLib:SOT-23\")\n"
43 " (sheetpath (names \"/Amp 1/\") (tstamps \"/aaaaaaaa-1111-4aaa-8aaa-aaaaaaaaaaaa/\"))\n"
44 " (tstamps \"55555555-5555-4555-8555-555555555555\"))\n"
45 " (comp (ref \"Q2\")\n"
46 " (value \"BC817\")\n"
47 " (footprint \"TestLib:SOT-23\")\n"
48 " (sheetpath (names \"/Amp 2/\") (tstamps \"/bbbbbbbb-2222-4bbb-8bbb-bbbbbbbbbbbb/\"))\n"
49 " (tstamps \"55555555-5555-4555-8555-555555555555\")))\n"
51 " (group (name \"Amp (Amp 1)\")\n"
52 " (uuid \"/aaaaaaaa-1111-4aaa-8aaa-aaaaaaaaaaaa/99999999-9999-4999-8999-999999999999\")\n"
53 " (lib_id \"MyBlocks:Amp\")\n"
55 " (member (uuid \"/aaaaaaaa-1111-4aaa-8aaa-aaaaaaaaaaaa/55555555-5555-4555-8555-555555555555\"))))\n"
56 " (group (name \"Amp (Amp 2)\")\n"
57 " (uuid \"/bbbbbbbb-2222-4bbb-8bbb-bbbbbbbbbbbb/99999999-9999-4999-8999-999999999999\")\n"
58 " (lib_id \"MyBlocks:Amp\")\n"
60 " (member (uuid \"/bbbbbbbb-2222-4bbb-8bbb-bbbbbbbbbbbb/55555555-5555-4555-8555-555555555555\"))))))\n";
63void loadNetlist(
NETLIST& aNetlist,
const char* aText )
69 netlistReader.LoadNetlist();
73 BOOST_FAIL(
"netlist parse failed: " + ioe.
What().ToStdString() );
86 loadNetlist(
netlist, TWO_INSTANCE_NETLIST );
88 BOOST_REQUIRE_EQUAL(
netlist.GetCount(), 2 );
94 BOOST_REQUIRE_MESSAGE( q1->
GetGroup(),
"Q1 was not assigned to a group" );
95 BOOST_REQUIRE_MESSAGE( q2->
GetGroup(),
"Q2 was not assigned to a group" );
109 loadNetlist( netlistA, TWO_INSTANCE_NETLIST );
110 loadNetlist( netlistB, TWO_INSTANCE_NETLIST );
127 fpid.
Parse( wxS(
"TestLib:SOT-23" ) );
131 new COMPONENT( fpid, wxS(
"Q1" ), wxS(
"BC817" ),
KIID_PATH(), std::vector<KIID>{ symbolUuid } ) );
134 member.push_back( symbolUuid );
139 netlist.ApplyGroupMembership();
144 BOOST_REQUIRE_MESSAGE( q1->
GetGroup(),
"bare uuid member was not resolved" );
Store all of the related component information found in a netlist.
NETLIST_GROUP * GetGroup() const
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
Read the new s-expression based KiCad netlist format.
A logical library item identifier and consists of various portions much like a URI.
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
COMPONENT * GetComponentByReference(const wxString &aReference)
Return a COMPONENT by aReference.
Is a LINE_READER that reads from a multiline 8 bit wide std::string.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(InstancePathMembersResolvePerInstance)
BOOST_CHECK_EQUAL(result, "25.4")