35struct GROUP_LOAD_TEST_FIXTURE
37 GROUP_LOAD_TEST_FIXTURE() {}
41struct GROUP_LOAD_TEST_CASE
46 bool m_expectedLocked;
47 wxString m_expectedName;
48 unsigned m_expectedMemberCount;
52struct GROUP_LOAD_BOARD_TEST_CASE
55 wxString m_boardFileRelativePath;
59 int m_expectedBoardVersion;
62 std::vector<GROUP_LOAD_TEST_CASE> m_groupCases;
79 const std::vector<GROUP_LOAD_BOARD_TEST_CASE> groupTestCases{
86 "a78cc65c-451e-451e-9147-4460cc669685",
96 "groups_load_save_v20231212",
101 "a78cc65c-451e-451e-9147-4460cc669685",
110 for(
const GROUP_LOAD_BOARD_TEST_CASE& testCase : groupTestCases )
112 BOOST_TEST_MESSAGE(
"Test case on file: " << testCase.m_boardFileRelativePath );
114 const auto doBoardTest = [&](
const BOARD& aBoard )
116 for(
const GROUP_LOAD_TEST_CASE& groupTestCase : testCase.m_groupCases )
118 BOOST_TEST_MESSAGE(
"Checking for group with UUID: "
119 << groupTestCase.m_searchUuid.AsString()
120 <<
" and name: " << groupTestCase.m_expectedName );
123 aBoard,
PCB_GROUP_T, groupTestCase.m_searchUuid ) );
125 BOOST_CHECK_EQUAL(
group.IsLocked(), groupTestCase.m_expectedLocked );
126 BOOST_CHECK_EQUAL(
group.GetName(), groupTestCase.m_expectedName );
127 BOOST_CHECK_EQUAL(
group.GetItems().size(), groupTestCase.m_expectedMemberCount );
132 testCase.m_expectedBoardVersion );
General utilities for PCB file IO for QA programs.
Information pertinent to a Pcbnew printed circuit board.
A set of BOARD_ITEMs (i.e., without duplicates).
void LoadAndTestBoardFile(const wxString aRelativePath, bool aRoundtrip, std::function< void(BOARD &)> aBoardTestFunction, std::optional< int > aExpectedBoardVersion)
Perform "some test" on a board file loaded from the path, then optionally save and reload and run the...
BOARD_ITEM & RequireBoardItemWithTypeAndId(const BOARD &aBoard, KICAD_T aItemType, const KIID &aID)
Get an item from the given board with a certain type and UUID.
Class to handle a set of BOARD_ITEMs.
BOOST_FIXTURE_TEST_CASE(GroupsLoadSave, GROUP_LOAD_TEST_FIXTURE)
This is similar to group_saveload.cpp's HealthyGroups, but runs the other way around: it loads a fixe...
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs