Change prettifier QA to not depend on file format changes

Instead of writing out and reading back in using the plugin,
just test the formatter itself.

Also add support for testing full boards.
This commit is contained in:
Jon Evans 2024-01-01 13:38:16 -05:00
parent b8aef58561
commit 104aa1abe4
4 changed files with 310 additions and 384 deletions

View File

@ -1,14 +1,13 @@
(footprint "Reverb_BTDR-1V"
(version 20231231)
(generator "pcbnew")
(generator_version "7.99")
(version 20231007)
(generator pcbnew)
(layer "F.Cu")
(descr "Digital Reverberation Unit, http://www.belton.co.kr/inc/downfile.php?seq=17&file=pdf (footprint from http://www.uk-electronic.de/PDF/BTDR-1.pdf)")
(tags "audio belton reverb")
(property "Reference" "REF**"
(at -11.5 0 180)
(layer "F.SilkS")
(uuid "23fd8612-0682-410f-bf8d-c4874ad45f3d")
(tstamp 23fd8612-0682-410f-bf8d-c4874ad45f3d)
(effects
(font
(size 1 1)
@ -19,7 +18,7 @@
(property "Value" "Reverb_BTDR-1V"
(at 27.62 -2.75 180)
(layer "F.Fab")
(uuid "84aa1724-7810-4bd1-982b-bc3da110a2d1")
(tstamp 84aa1724-7810-4bd1-982b-bc3da110a2d1)
(effects
(font
(size 1 1)
@ -28,11 +27,9 @@
)
)
(property "Footprint" ""
(at 0 0 0)
(unlocked yes)
(layer "F.Fab")
(hide yes)
(uuid "8ed64581-2b83-4ebe-8edd-cfd9b8d4cf5e")
(at 0 0 0 unlocked)
(layer "F.Fab") hide
(tstamp 8ed64581-2b83-4ebe-8edd-cfd9b8d4cf5e)
(effects
(font
(size 1.27 1.27)
@ -40,11 +37,9 @@
)
)
(property "Datasheet" ""
(at 0 0 0)
(unlocked yes)
(layer "F.Fab")
(hide yes)
(uuid "b2b0cf58-a054-47f5-a1a7-d365c87f1a14")
(at 0 0 0 unlocked)
(layer "F.Fab") hide
(tstamp b2b0cf58-a054-47f5-a1a7-d365c87f1a14)
(effects
(font
(size 1.27 1.27)
@ -52,11 +47,9 @@
)
)
(property "Description" ""
(at 0 0 0)
(unlocked yes)
(layer "F.Fab")
(hide yes)
(uuid "a92072d5-74bf-49b6-8a42-08692319d2f4")
(at 0 0 0 unlocked)
(layer "F.Fab") hide
(tstamp a92072d5-74bf-49b6-8a42-08692319d2f4)
(effects
(font
(size 1.27 1.27)
@ -72,7 +65,7 @@
(type solid)
)
(layer "F.SilkS")
(uuid "81a7dfa1-c278-425c-a935-a8b9a29946a6")
(tstamp 81a7dfa1-c278-425c-a935-a8b9a29946a6)
)
(fp_line
(start -13.88 4.3)
@ -82,7 +75,7 @@
(type solid)
)
(layer "F.SilkS")
(uuid "bda1223a-e7ea-4c51-9249-a21d389f3710")
(tstamp bda1223a-e7ea-4c51-9249-a21d389f3710)
)
(fp_line
(start -6.38 4.3)
@ -92,7 +85,7 @@
(type solid)
)
(layer "F.SilkS")
(uuid "690bfa6b-b0f9-4317-ad57-06b3802ac7b0")
(tstamp 690bfa6b-b0f9-4317-ad57-06b3802ac7b0)
)
(fp_line
(start -6.38 11.1)
@ -102,7 +95,7 @@
(type solid)
)
(layer "F.SilkS")
(uuid "97cadbec-a55e-41ed-92d5-eb3214b34afd")
(tstamp 97cadbec-a55e-41ed-92d5-eb3214b34afd)
)
(fp_line
(start 61.62 4.3)
@ -112,7 +105,7 @@
(type solid)
)
(layer "F.SilkS")
(uuid "c5e6a983-b7b3-4b12-9d4a-dd295e782cfe")
(tstamp c5e6a983-b7b3-4b12-9d4a-dd295e782cfe)
)
(fp_line
(start 61.62 11.1)
@ -122,7 +115,7 @@
(type solid)
)
(layer "F.SilkS")
(uuid "2d8f87c0-9dd2-41d3-b1cd-9d71e4644960")
(tstamp 2d8f87c0-9dd2-41d3-b1cd-9d71e4644960)
)
(fp_line
(start 69.12 1.3)
@ -132,7 +125,7 @@
(type solid)
)
(layer "F.SilkS")
(uuid "be83e42e-9ffb-493c-ad07-45c77841473d")
(tstamp be83e42e-9ffb-493c-ad07-45c77841473d)
)
(fp_line
(start 69.12 4.3)
@ -142,7 +135,7 @@
(type solid)
)
(layer "F.SilkS")
(uuid "f4ce1fd3-d6c1-4abb-b989-ae90ad642a07")
(tstamp f4ce1fd3-d6c1-4abb-b989-ae90ad642a07)
)
(fp_line
(start -14.13 -1.25)
@ -152,7 +145,7 @@
(type solid)
)
(layer "F.CrtYd")
(uuid "712967cb-b7b3-4f31-95b5-a3ae7821d1b9")
(tstamp 712967cb-b7b3-4f31-95b5-a3ae7821d1b9)
)
(fp_line
(start -14.13 11.35)
@ -162,7 +155,7 @@
(type solid)
)
(layer "F.CrtYd")
(uuid "0662dc2c-544d-47e4-b9a9-078d346b7b8b")
(tstamp 0662dc2c-544d-47e4-b9a9-078d346b7b8b)
)
(fp_line
(start -6.63 11.35)
@ -172,7 +165,7 @@
(type solid)
)
(layer "F.CrtYd")
(uuid "6b2036dd-604c-4667-9cd8-889990119aba")
(tstamp 6b2036dd-604c-4667-9cd8-889990119aba)
)
(fp_line
(start 61.62 11.35)
@ -182,7 +175,7 @@
(type solid)
)
(layer "F.CrtYd")
(uuid "48f58059-e5ec-4db5-97c0-741c62b975e6")
(tstamp 48f58059-e5ec-4db5-97c0-741c62b975e6)
)
(fp_line
(start 69.37 -1.25)
@ -192,7 +185,7 @@
(type solid)
)
(layer "F.CrtYd")
(uuid "12d7a82e-b0c6-40b8-a78c-2d112ffab686")
(tstamp 12d7a82e-b0c6-40b8-a78c-2d112ffab686)
)
(fp_line
(start 69.37 11.35)
@ -202,7 +195,7 @@
(type solid)
)
(layer "F.CrtYd")
(uuid "665f55d3-1930-4c50-8ac6-a50812f0ebb7")
(tstamp 665f55d3-1930-4c50-8ac6-a50812f0ebb7)
)
(fp_line
(start -13.88 1.3)
@ -212,7 +205,7 @@
(type solid)
)
(layer "F.Fab")
(uuid "40e6edcf-2dca-4414-8c68-54b5cb516af0")
(tstamp 40e6edcf-2dca-4414-8c68-54b5cb516af0)
)
(fp_line
(start -13.88 4.3)
@ -222,7 +215,7 @@
(type solid)
)
(layer "F.Fab")
(uuid "69e81b15-c24f-4180-a1e2-ddeb5ca6447d")
(tstamp 69e81b15-c24f-4180-a1e2-ddeb5ca6447d)
)
(fp_line
(start -6.38 4.3)
@ -232,7 +225,7 @@
(type solid)
)
(layer "F.Fab")
(uuid "f4d1a664-c87b-4415-947e-80bf18cfb575")
(tstamp f4d1a664-c87b-4415-947e-80bf18cfb575)
)
(fp_line
(start -6.38 11.1)
@ -242,7 +235,7 @@
(type solid)
)
(layer "F.Fab")
(uuid "e0811244-7b68-4fcc-9992-3c461271d12c")
(tstamp e0811244-7b68-4fcc-9992-3c461271d12c)
)
(fp_line
(start 61.62 4.3)
@ -252,7 +245,7 @@
(type solid)
)
(layer "F.Fab")
(uuid "1c90e511-a13d-4a19-bb0c-341a540211ff")
(tstamp 1c90e511-a13d-4a19-bb0c-341a540211ff)
)
(fp_line
(start 61.62 11.1)
@ -262,7 +255,7 @@
(type solid)
)
(layer "F.Fab")
(uuid "b8985526-ec53-47c3-9430-ddff43dd0717")
(tstamp b8985526-ec53-47c3-9430-ddff43dd0717)
)
(fp_line
(start 69.12 1.3)
@ -272,7 +265,7 @@
(type solid)
)
(layer "F.Fab")
(uuid "422ec1ee-934d-458a-a428-dae9f64f0e7c")
(tstamp 422ec1ee-934d-458a-a428-dae9f64f0e7c)
)
(fp_line
(start 69.12 4.3)
@ -282,12 +275,12 @@
(type solid)
)
(layer "F.Fab")
(uuid "c32cd034-9d5f-4f99-a118-06e174e115a6")
(tstamp c32cd034-9d5f-4f99-a118-06e174e115a6)
)
(fp_text user "${REFERENCE}"
(at 27.62 6.2 180)
(layer "F.Fab")
(uuid "2c2c1e88-d6ac-4cc4-8e09-80f372bca783")
(tstamp 2c2c1e88-d6ac-4cc4-8e09-80f372bca783)
(effects
(font
(size 1 1)
@ -300,56 +293,49 @@
(size 2 2)
(drill 1)
(layers "*.Cu" "*.Mask")
(remove_unused_layers no)
(uuid "6b54a4cf-1c47-48bd-9076-9d2c1ed1dc0b")
(tstamp 6b54a4cf-1c47-48bd-9076-9d2c1ed1dc0b)
)
(pad "2" thru_hole circle
(at 2.54 0)
(size 2 2)
(drill 1)
(layers "*.Cu" "*.Mask")
(remove_unused_layers no)
(uuid "1b5d7c94-aaa1-488b-9352-7b5770314a42")
(tstamp 1b5d7c94-aaa1-488b-9352-7b5770314a42)
)
(pad "3" thru_hole circle
(at 5.08 0)
(size 2 2)
(drill 1)
(layers "*.Cu" "*.Mask")
(remove_unused_layers no)
(uuid "254b0c32-5f01-4308-b5dd-0a4bc380a715")
(tstamp 254b0c32-5f01-4308-b5dd-0a4bc380a715)
)
(pad "4" thru_hole circle
(at 7.62 0)
(size 2 2)
(drill 1)
(layers "*.Cu" "*.Mask")
(remove_unused_layers no)
(uuid "bc6a6a8f-3b8f-413f-88e7-4957bd99351b")
(tstamp bc6a6a8f-3b8f-413f-88e7-4957bd99351b)
)
(pad "5" thru_hole circle
(at 50.62 0)
(size 2 2)
(drill 1)
(layers "*.Cu" "*.Mask")
(remove_unused_layers no)
(uuid "35698302-6de0-4184-aefe-e2cbdd76c272")
(tstamp 35698302-6de0-4184-aefe-e2cbdd76c272)
)
(pad "6" thru_hole circle
(at 53.16 0)
(size 2 2)
(drill 1)
(layers "*.Cu" "*.Mask")
(remove_unused_layers no)
(uuid "c86ea0ec-de68-4d29-839c-dfca7c7d64b3")
(tstamp c86ea0ec-de68-4d29-839c-dfca7c7d64b3)
)
(pad "7" thru_hole circle
(at 55.7 0)
(size 2 2)
(drill 1)
(layers "*.Cu" "*.Mask")
(remove_unused_layers no)
(uuid "5fc56d94-ca72-44e4-babd-0986bd43161c")
(tstamp 5fc56d94-ca72-44e4-babd-0986bd43161c)
)
(model "${KICAD6_3DMODEL_DIR}/Audio_Module.3dshapes/Reverb_BTDR-1V.wrl"
(offset

View File

@ -1,9 +1,8 @@
(kicad_pcb
(version 20231014)
(version 20231007)
(generator pcbnew)
(general
(thickness 1.6)
(legacy_teardrops no)
)
(paper "A4")
(layers
@ -39,40 +38,39 @@
)
(setup
(pad_to_mask_clearance 0)
(allow_soldermask_bridges_in_footprints no)
(pcbplotparams
(layerselection 0x00010fc_ffffffff)
(plot_on_all_layers_selection 0x0000000_00000000)
(disableapertmacros no)
(usegerberextensions no)
(usegerberattributes yes)
(usegerberadvancedattributes yes)
(creategerberjobfile yes)
(disableapertmacros false)
(usegerberextensions false)
(usegerberattributes true)
(usegerberadvancedattributes true)
(creategerberjobfile true)
(dashed_line_dash_ratio 12.000000)
(dashed_line_gap_ratio 3.000000)
(svgprecision 4)
(plotframeref no)
(viasonmask no)
(plotframeref false)
(viasonmask false)
(mode 1)
(useauxorigin no)
(useauxorigin false)
(hpglpennumber 1)
(hpglpenspeed 20)
(hpglpendiameter 15.000000)
(pdf_front_fp_property_popups yes)
(pdf_back_fp_property_popups yes)
(dxfpolygonmode yes)
(dxfimperialunits yes)
(dxfusepcbnewfont yes)
(psnegative no)
(psa4output no)
(plotreference yes)
(plotvalue yes)
(plotfptext yes)
(plotinvisibletext no)
(sketchpadsonfab no)
(subtractmaskfromsilk no)
(pdf_front_fp_property_popups true)
(pdf_back_fp_property_popups true)
(dxfpolygonmode true)
(dxfimperialunits true)
(dxfusepcbnewfont true)
(psnegative false)
(psa4output false)
(plotreference true)
(plotvalue true)
(plotfptext true)
(plotinvisibletext false)
(sketchpadsonfab false)
(subtractmaskfromsilk false)
(outputformat 1)
(mirror no)
(mirror false)
(drillshape 1)
(scaleselection 1)
(outputdirectory "")
@ -88,7 +86,7 @@
)
(fill none)
(layer "Edge.Cuts")
(uuid "16baef1d-04a3-4f4a-8880-8a0675489673")
(tstamp 16baef1d-04a3-4f4a-8880-8a0675489673)
)
(gr_rect
(start 140.97 87.63)
@ -99,7 +97,7 @@
)
(fill none)
(layer "Edge.Cuts")
(uuid "4cacc7e6-4a75-4a10-b7af-5b754b440395")
(tstamp 4cacc7e6-4a75-4a10-b7af-5b754b440395)
)
(gr_rect
(start 142.24 96.52)
@ -110,7 +108,7 @@
)
(fill none)
(layer "Edge.Cuts")
(uuid "6de1afbb-ac41-4ea5-8cc4-b054a5e5fb0d")
(tstamp 6de1afbb-ac41-4ea5-8cc4-b054a5e5fb0d)
)
(gr_rect
(start 142.24 91.44)
@ -121,7 +119,7 @@
)
(fill none)
(layer "Edge.Cuts")
(uuid "7ee0cdbc-c1c4-4512-a0d5-989b2eabf959")
(tstamp 7ee0cdbc-c1c4-4512-a0d5-989b2eabf959)
)
(gr_rect
(start 153.67 93.98)
@ -132,7 +130,7 @@
)
(fill none)
(layer "Edge.Cuts")
(uuid "85402e04-a27f-4b2f-8d1c-bb7286ec8e18")
(tstamp 85402e04-a27f-4b2f-8d1c-bb7286ec8e18)
)
(gr_rect
(start 153.67 96.52)
@ -143,7 +141,7 @@
)
(fill none)
(layer "Edge.Cuts")
(uuid "c8bfbb9e-f4f5-4989-a83e-83f54ffaac3d")
(tstamp c8bfbb9e-f4f5-4989-a83e-83f54ffaac3d)
)
(gr_rect
(start 153.67 91.44)
@ -154,7 +152,7 @@
)
(fill none)
(layer "Edge.Cuts")
(uuid "d26b4361-04bf-4822-9118-fae9bb6dcbe6")
(tstamp d26b4361-04bf-4822-9118-fae9bb6dcbe6)
)
(gr_rect
(start 153.67 88.9)
@ -165,7 +163,7 @@
)
(fill none)
(layer "Edge.Cuts")
(uuid "e2573c52-72ff-4e6d-b78d-9c4aeb0876a0")
(tstamp e2573c52-72ff-4e6d-b78d-9c4aeb0876a0)
)
(gr_rect
(start 142.24 93.98)
@ -176,7 +174,7 @@
)
(fill none)
(layer "Edge.Cuts")
(uuid "f8376e5d-27d2-43e8-ba5c-b3a8e26409b2")
(tstamp f8376e5d-27d2-43e8-ba5c-b3a8e26409b2)
)
(image
(at 148.59 93.345)
@ -225,19 +223,19 @@
)
)
(group ""
(id "341a7559-d258-493a-87dc-f6c4b095509d")
(members "85402e04-a27f-4b2f-8d1c-bb7286ec8e18" "c8bfbb9e-f4f5-4989-a83e-83f54ffaac3d"
"d26b4361-04bf-4822-9118-fae9bb6dcbe6" "e2573c52-72ff-4e6d-b78d-9c4aeb0876a0"
(id 341a7559-d258-493a-87dc-f6c4b095509d)
(members 85402e04-a27f-4b2f-8d1c-bb7286ec8e18 c8bfbb9e-f4f5-4989-a83e-83f54ffaac3d
d26b4361-04bf-4822-9118-fae9bb6dcbe6 e2573c52-72ff-4e6d-b78d-9c4aeb0876a0
)
)
(group ""
(id "b2069c54-f5f7-4dc5-9f12-98f292c334e3")
(members "341a7559-d258-493a-87dc-f6c4b095509d" "bcad4640-c8e1-4ef4-96ca-ca8cc3e1742d")
(id b2069c54-f5f7-4dc5-9f12-98f292c334e3)
(members 341a7559-d258-493a-87dc-f6c4b095509d bcad4640-c8e1-4ef4-96ca-ca8cc3e1742d)
)
(group ""
(id "bcad4640-c8e1-4ef4-96ca-ca8cc3e1742d")
(members "16baef1d-04a3-4f4a-8880-8a0675489673" "6de1afbb-ac41-4ea5-8cc4-b054a5e5fb0d"
"7ee0cdbc-c1c4-4512-a0d5-989b2eabf959" "f8376e5d-27d2-43e8-ba5c-b3a8e26409b2"
(id bcad4640-c8e1-4ef4-96ca-ca8cc3e1742d)
(members 16baef1d-04a3-4f4a-8880-8a0675489673 6de1afbb-ac41-4ea5-8cc4-b054a5e5fb0d
7ee0cdbc-c1c4-4512-a0d5-989b2eabf959 f8376e5d-27d2-43e8-ba5c-b3a8e26409b2
)
)
)

View File

@ -31,6 +31,8 @@
#include <pcbnew_utils/board_test_utils.h>
#include <pcbnew_utils/board_file_utils.h>
#include <pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.h>
#include <pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.h>
#include <io/kicad/kicad_io_utils.h>
#include <board.h>
#include <footprint.h>
#include <settings/settings_manager.h>
@ -45,15 +47,16 @@ struct PRETTIFIER_TEST_FIXTURE
SETTINGS_MANAGER m_settingsManager;
};
#include <wx/log.h>
BOOST_FIXTURE_TEST_CASE( FootprintPrettifier, PRETTIFIER_TEST_FIXTURE )
BOOST_FIXTURE_TEST_CASE( BoardAndFootprintPrettifier, PRETTIFIER_TEST_FIXTURE )
{
std::vector<wxString> footprints = {
"Reverb_BTDR-1V",
"Samtec_HLE-133-02-xx-DV-PE-LC_2x33_P2.54mm_Horizontal"
std::vector<wxString> cases = {
"Reverb_BTDR-1V.kicad_mod",
"Samtec_HLE-133-02-xx-DV-PE-LC_2x33_P2.54mm_Horizontal.kicad_mod",
"group_and_image.kicad_pcb"
};
std::unique_ptr<FOOTPRINT> original, converted, golden;
std::unique_ptr<BOARD_ITEM_CONTAINER> original, prettified, golden;
PCB_IO_KICAD_SEXPR plugin;
std::string tempLibPath = fmt::format( "{}/prettifier.pretty",
@ -61,67 +64,79 @@ BOOST_FIXTURE_TEST_CASE( FootprintPrettifier, PRETTIFIER_TEST_FIXTURE )
std::filesystem::remove_all( tempLibPath );
std::filesystem::create_directory( tempLibPath );
for( const wxString& footprint : footprints )
for( const wxString& testCase : cases )
{
BOOST_TEST_CONTEXT( footprint.ToStdString() )
{
std::string inPath = fmt::format( "{}prettifier/{}.kicad_mod",
KI_TEST::GetPcbnewTestDataDir(),
footprint.ToStdString() );
std::string testCaseName = testCase.ToStdString();
BOOST_CHECK_NO_THROW( original = KI_TEST::ReadFootprintFromFileOrStream( inPath ) );
BOOST_TEST_CONTEXT( testCaseName )
{
std::string inPath = fmt::format( "{}prettifier/{}", KI_TEST::GetPcbnewTestDataDir(),
testCaseName );
std::ifstream inFp;
inFp.open( inPath );
BOOST_REQUIRE( inFp.is_open() );
std::stringstream inBuf;
inBuf << inFp.rdbuf();
std::string inData = inBuf.str();
{
STRING_LINE_READER reader( inData, "input file" );
PCB_IO_KICAD_SEXPR_PARSER parser( &reader, nullptr, nullptr );
BOOST_CHECK_NO_THROW(
original.reset( dynamic_cast<BOARD_ITEM_CONTAINER*>( parser.Parse() ) ) );
BOOST_REQUIRE( original.get() );
}
BOOST_CHECK_NO_THROW( plugin.FootprintSave( tempLibPath, original.get() ) );
KICAD_FORMAT::Prettify( inData );
std::string newPath = fmt::format( "{}/{}.kicad_mod", tempLibPath,
original->GetFPIDAsString().ToStdString() );
// For diagnosis of test failures
std::string tempPath = fmt::format( "{}/{}", tempLibPath, testCaseName );
std::ofstream tempFp;
tempFp.open( tempPath );
BOOST_REQUIRE( tempFp.is_open() );
tempFp << inData;
tempFp.close();
BOOST_CHECK_NO_THROW( converted = KI_TEST::ReadFootprintFromFileOrStream( newPath ) );
BOOST_REQUIRE( converted.get() );
{
STRING_LINE_READER reader( inData, "prettified file" );
PCB_IO_KICAD_SEXPR_PARSER parser( &reader, nullptr, nullptr );
BOOST_CHECK_NO_THROW(
prettified.reset( dynamic_cast<BOARD_ITEM_CONTAINER*>( parser.Parse() ) ) );
BOOST_REQUIRE( prettified.get() );
}
// Hack around the fact that PAD::operator== compares footprint UUIDs, even though
// these UUIDs cannot be preserved through a round-trip
const_cast<KIID&>( converted->m_Uuid ) = original->m_Uuid;
const_cast<KIID&>( prettified->m_Uuid ) = original->m_Uuid;
// File should parse the same way
BOOST_REQUIRE( *original == *converted );
BOOST_REQUIRE_MESSAGE( *original == *prettified,
"Formatted version of original board item does not parse the same way!" );
// And the formatting should match
std::string goldenPath = fmt::format( "{}prettifier/{}_formatted.kicad_mod",
KI_TEST::GetPcbnewTestDataDir(),
footprint.ToStdString() );
// And the formatting should match the golden
std::string base = testCase.BeforeLast( '.' ).ToStdString();
std::string ext = testCase.AfterLast( '.' ).ToStdString();
// Note also m_fileFormatVersionAtLoad (of gloden file) could create an issue
// during comprarison, so warn the user if happens
BOOST_CHECK_NO_THROW( golden = KI_TEST::ReadFootprintFromFileOrStream( goldenPath ) );
BOOST_REQUIRE( golden.get() );
std::string goldenPath = fmt::format( "{}prettifier/{}_formatted.{}",
KI_TEST::GetPcbnewTestDataDir(), base, ext );
if( converted->GetFileFormatVersionAtLoad() != golden->GetFileFormatVersionAtLoad() )
{
wxLogWarning( "Golden file %s has a old version id %d and need update (now %d)",
goldenPath.c_str(),
golden->GetFileFormatVersionAtLoad(),converted->GetFileFormatVersionAtLoad() );
}
std::ifstream goldFp;
goldFp.open( goldenPath );
BOOST_REQUIRE( goldFp.is_open() );
{
std::ifstream test( newPath );
std::ifstream golden( goldenPath );
std::stringstream goldenBuf;
goldenBuf << goldFp.rdbuf();
BOOST_REQUIRE( !test.fail() && !golden.fail() );
BOOST_REQUIRE_MESSAGE( test.tellg() == golden.tellg(), "File sizes didn't match!" );
BOOST_REQUIRE_MESSAGE( goldenBuf.str().compare( inData ) == 0,
"Formatting result doesn't match golden!" );
test.seekg( 0, std::ifstream::beg );
golden.seekg( 0, std::ifstream::beg );
BOOST_REQUIRE_MESSAGE( std::equal( std::istreambuf_iterator<char>( test.rdbuf() ),
std::istreambuf_iterator<char>(),
std::istreambuf_iterator<char>( golden.rdbuf() ) ),
"Formatted footprints do not match!" );
}
std::filesystem::remove( newPath );
std::filesystem::remove( tempPath );
}
}
std::filesystem::remove_all( tempLibPath );
}