46 std::vector<wxString> cases = {
47 "Reverb_BTDR-1V.kicad_mod",
48 "Samtec_HLE-133-02-xx-DV-PE-LC_2x33_P2.54mm_Horizontal.kicad_mod",
49 "group_and_image.kicad_pcb"
52 std::unique_ptr<BOARD_ITEM_CONTAINER> original, prettified, golden;
57 for(
const wxString& testCase : cases )
59 std::string testCaseName = testCase.ToStdString();
63 const std::filesystem::path inPath =
66 std::ifstream inFp( inPath );
69 std::stringstream inBuf;
70 inBuf << inFp.rdbuf();
71 std::string inData = inBuf.str();
86 std::ofstream tempFp( tempPath );
103 const_cast<KIID&
>( prettified->m_Uuid ) = original->m_Uuid;
106 BOOST_REQUIRE_MESSAGE( *original == *prettified,
107 "Formatted version of original board item does not parse the same way!" );
110 std::string base = testCase.BeforeLast(
'.' ).ToStdString();
111 std::string ext = testCase.AfterLast(
'.' ).ToStdString();
114 /
"prettifier" / ( base +
"_formatted." + ext );
116 std::ifstream goldFp( goldenPath );
119 std::stringstream goldenBuf;
120 goldenBuf << goldFp.rdbuf();
122 BOOST_REQUIRE_MESSAGE( goldenBuf.str().compare( inData ) == 0,
123 "Formatting result doesn't match golden!" );