|
KiCad PCB EDA Suite
|
#include <qa_utils/wx_utils/unit_test_utils.h>#include <boost/test/data/test_case.hpp>#include <qa_utils/file_utils.h>#include <board.h>#include <kiid.h>#include <footprint.h>#include <board_design_settings.h>#include <pcb_field.h>#include <pcb_text.h>#include <pcbnew_utils/board_file_utils.h>#include <pcbnew_utils/board_test_utils.h>#include <settings/settings_manager.h>#include <filesystem>Go to the source code of this file.
Functions | |
| BOOST_DATA_TEST_CASE (FootprintLoadSave, boost::unit_test::data::make(FootprintLoadSave_testCases), testCase) | |
| Simple tests cases that load a board file and check expected properties of the footprints. | |
| BOOST_AUTO_TEST_CASE (FootprintFieldLockRoundTrip) | |
| Fields are written without a header of their own, inside the footprint's (property ...), so their lock takes a different path through the writer than a plain footprint text's does. | |
| BOOST_AUTO_TEST_CASE (FootprintUserFieldKeepsAutoThickness) | |
| A field with no thickness token is using auto thickness. | |
| BOOST_AUTO_TEST_CASE (LegacyFootprintPropertyTakesBoardDefaults) | |
| The other side of the same call: a legacy property carries no effects at all, so the board defaults are the only style it can get. | |
| BOOST_AUTO_TEST_CASE | ( | FootprintFieldLockRoundTrip | ) |
Fields are written without a header of their own, inside the footprint's (property ...), so their lock takes a different path through the writer than a plain footprint text's does.
Definition at line 112 of file test_footprint_load_save.cpp.
References BOARD::Add(), FOOTPRINT::Add(), BOOST_CHECK(), BOOST_REQUIRE(), BOOST_REQUIRE_EQUAL(), KI_TEST::DumpBoardToFile(), F_SilkS, FOOTPRINT, FOOTPRINT::GetField(), FOOTPRINT::GraphicalItems(), BOARD_ITEM::IsLocked(), KI_TEST::SCOPED_TEMP_DIR::Path(), path, PCB_TEXT_T, pcbIUScale, KI_TEST::ReadBoardFromFileOrStream(), REFERENCE, BOARD_ITEM::SetLayer(), BOARD_ITEM::SetLocked(), FOOTPRINT::SetPosition(), FOOTPRINT::SetReference(), EDA_TEXT::SetText(), and USER.
| BOOST_AUTO_TEST_CASE | ( | FootprintUserFieldKeepsAutoThickness | ) |
A field with no thickness token is using auto thickness.
Loading one builds the field before its effects are parsed, so nothing stamped on it then may survive the parse.
Definition at line 162 of file test_footprint_load_save.cpp.
References BOARD::Add(), FOOTPRINT::Add(), BOOST_CHECK(), BOOST_REQUIRE(), BOOST_REQUIRE_EQUAL(), KI_TEST::DumpBoardToFile(), F_SilkS, FOOTPRINT, EDA_TEXT::GetAutoThickness(), BOARD::GetDesignSettings(), LAYER_CLASS_SILK, BOARD_DESIGN_SETTINGS::m_TextThickness, KI_TEST::SCOPED_TEMP_DIR::Path(), path, pcbIUScale, KI_TEST::ReadBoardFromFileOrStream(), EDA_TEXT::SetAutoThickness(), BOARD_ITEM::SetLayer(), FOOTPRINT::SetPosition(), FOOTPRINT::SetReference(), EDA_TEXT::SetText(), and USER.
| BOOST_AUTO_TEST_CASE | ( | LegacyFootprintPropertyTakesBoardDefaults | ) |
The other side of the same call: a legacy property carries no effects at all, so the board defaults are the only style it can get.
Definition at line 201 of file test_footprint_load_save.cpp.
References BOOST_CHECK(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), EDA_TEXT::GetAutoThickness(), BOARD_ITEM::GetLayer(), PCB_TEXT::GetTextThickness(), and KI_TEST::LoadAndTestBoardFile().
| BOOST_DATA_TEST_CASE | ( | FootprintLoadSave | , |
| boost::unit_test::data::make(FootprintLoadSave_testCases) | , | ||
| testCase | ) |
Simple tests cases that load a board file and check expected properties of the footprints.
This is not the same as FpLibLoadSave as it loads board files, and not footprint files from a library.
Definition at line 85 of file test_footprint_load_save.cpp.
References KIID::AsString(), BOOST_CHECK_EQUAL(), BOOST_TEST_MESSAGE(), KI_TEST::LoadAndTestBoardFile(), PCB_FOOTPRINT_T, and KI_TEST::RequireBoardItemWithTypeAndId().