47 wxString brd_name( wxT(
"solder_mask_bridge_test" ) );
51 std::vector<DRC_ITEM> violations;
62 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I& aPos,
int aLayer,
63 const std::function<
void(
PCB_MARKER* )>& aPathGenerator )
68 violations.push_back( *aItem );
75 const int expected_err_cnt = 4;
77 if( violations.size() == expected_err_cnt )
90 for(
const DRC_ITEM& item : violations )
93 BOOST_ERROR( wxString::Format(
"DRC solder mask bridge test failed board <%s>", brd_name ) );
108 std::vector<wxString> sig;
109 std::vector<std::pair<int, std::array<KIID, 3>>> emissionKeys;
112 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I& aPos,
int aLayer,
118 sig.push_back( wxString::Format(
"%d,%d,%d,%s,%s,%s", aLayer, aPos.
x, aPos.
y,
119 aItem->GetMainItemID().AsString(),
120 aItem->GetAuxItemID().AsString(),
121 aItem->GetAuxItem2ID().AsString() ) );
126 std::array<KIID, 3> ids = { aItem->GetMainItemID(), aItem->GetAuxItemID(),
127 aItem->GetAuxItem2ID() };
129 std::sort( ids.begin(), ids.end() - ( ids[2] ==
niluuid ? 1 : 0 ) );
131 emissionKeys.push_back( { aLayer, ids } );
135 [&]() -> std::vector<wxString>
139 emissionKeys.clear();
144 std::vector<wxString> ref = runDrc();
146 BOOST_TEST_MESSAGE( wxString::Format(
"solder_mask_bridge violations: %zu", ref.size() ) );
150 BOOST_REQUIRE_GT( ref.size(), 100u );
155 BOOST_CHECK_MESSAGE( std::is_sorted( emissionKeys.begin(), emissionKeys.end() ),
156 "solder_mask_bridge violations not reported in sorted order" );
158 for(
int run = 0; run < 8; ++run )
160 std::vector<wxString> cur = runDrc();
162 BOOST_CHECK_MESSAGE( cur == ref,
163 wxString::Format(
"solder_mask_bridge report differs on run %d "
164 "(%zu vs %zu violations)",
165 run, cur.size(), ref.size() ) );
BOOST_CHECK_EQUAL(result, "25.4")