|
KiCad PCB EDA Suite
|
Unit tests for the PCB variant system including FOOTPRINT_VARIANT, BOARD variant registry, and variant-aware filtering. More...
#include <qa_utils/wx_utils/unit_test_utils.h>#include <boost/test/unit_test.hpp>#include <board.h>#include <footprint.h>#include <lib_id.h>#include <exporters/place_file_exporter.h>#include <netlist_reader/board_netlist_updater.h>#include <pcbnew/netlist_reader/kicad_netlist_parser.h>#include <pcbnew/netlist_reader/pcb_netlist.h>#include <pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.h>#include <pcbnew_utils/board_file_utils.h>#include <pcbnew_utils/board_test_utils.h>#include <richio.h>#include <settings/settings_manager.h>#include <template_fieldnames.h>#include <tool/tool_manager.h>Go to the source code of this file.
Functions | |
| BOOST_AUTO_TEST_CASE (FootprintVariantBasics) | |
| Test FOOTPRINT_VARIANT class basic operations. | |
| BOOST_AUTO_TEST_CASE (BoardVariantRegistry) | |
| Test BOARD variant registry operations. | |
| BOOST_AUTO_TEST_CASE (FootprintDNPForVariant) | |
| Test footprint DNP for variant. | |
| BOOST_AUTO_TEST_CASE (FootprintVariantTextVarResolution) | |
| Test footprint text variable resolution for variants. | |
| BOOST_AUTO_TEST_CASE (FootprintBOMExclusionForVariant) | |
| Test footprint BOM exclusion for variant. | |
| BOOST_AUTO_TEST_CASE (FootprintSimExclusionForVariant) | |
| Test footprint simulation exclusion for variant. | |
| BOOST_AUTO_TEST_CASE (FootprintPosFileExclusionForVariant) | |
| Test footprint position file exclusion for variant. | |
| BOOST_AUTO_TEST_CASE (VariantCaseInsensitivity) | |
| Test variant case insensitivity for all operations. | |
| BOOST_AUTO_TEST_CASE (EmptyVariantReturnsBase) | |
| Test that empty variant name returns base attributes. | |
| BOOST_AUTO_TEST_CASE (UnknownVariantReturnsBase) | |
| Test that unknown variant name returns base attributes. | |
| BOOST_AUTO_TEST_CASE (FootprintVariantCopyAssignment) | |
| BOOST_AUTO_TEST_CASE (FootprintFieldShownTextForVariant) | |
| BOOST_AUTO_TEST_CASE (BoardVariantTextVars) | |
| BOOST_AUTO_TEST_CASE (NetlistComponentVariantsParsing) | |
| BOOST_AUTO_TEST_CASE (MultipleVariantsIndependent) | |
| Test adding multiple variants and verifying they're independent. | |
| BOOST_AUTO_TEST_CASE (VariantFieldUnicodeAndSpecialChars) | |
| Test variant field values with unicode and special characters. | |
| BOOST_AUTO_TEST_CASE (VariantDeletionClearsRegistry) | |
| Test variant deletion clears board variant registry. | |
| BOOST_AUTO_TEST_CASE (RenameVariantPreservesData) | |
| Test renaming variant to existing name fails or merges appropriately. | |
| BOOST_AUTO_TEST_CASE (GetVariantNamesForUIFormat) | |
| Test GetVariantNamesForUI returns sorted list with default first. | |
| BOOST_AUTO_TEST_CASE (VariantMultipleFlagsCombinations) | |
| Test multiple flags can be set independently for each variant. | |
| BOOST_AUTO_TEST_CASE (ComponentVariantToFootprintTransfer) | |
| Test that COMPONENT_VARIANT data from netlist transfers correctly to FOOTPRINT_VARIANT. | |
| BOOST_AUTO_TEST_CASE (ComponentVariantPartialOverride) | |
| Test that variant m_has* flags are properly respected during transfer. | |
| BOOST_AUTO_TEST_CASE (VariantAttributeTransferWithReset) | |
| Test the complete variant attribute transfer flow simulating board_netlist_updater behavior. | |
| BOOST_AUTO_TEST_CASE (VariantTestR2FootprintAttributeVerification) | |
| Test that recreates the user's observed bug: | |
| BOOST_AUTO_TEST_CASE (VariantTestProjectLoad) | |
| Test loading and verifying variant data from the variant_test project files. | |
| BOOST_AUTO_TEST_CASE (PosExportVariantValue) | |
| Test that PLACE_FILE_EXPORTER uses variant-specific Value fields (issue #23547). | |
| BOOST_AUTO_TEST_CASE (ExcessVariantsCleanedWhenNetlistEmpty) | |
| Regression test for issue #23564: stale footprint variant data must be cleaned up when the netlist contains no variant overrides for a component. | |
| BOOST_AUTO_TEST_CASE (ExcessVariantsSelectiveCleanup) | |
| Verify that excess-variants cleanup is selective: only variants NOT in the netlist are removed, while variants present in the netlist are preserved. | |
| BOOST_AUTO_TEST_CASE (Issue23298_BaseFootprintHiddenInNonDefaultVariant) | |
| Regression test for issue #23298: the 3D viewer shows the default-variant footprint even when a different variant is active and that variant has a different footprint assignment. | |
Unit tests for the PCB variant system including FOOTPRINT_VARIANT, BOARD variant registry, and variant-aware filtering.
Definition in file test_variant.cpp.
| BOOST_AUTO_TEST_CASE | ( | BoardVariantRegistry | ) |
Test BOARD variant registry operations.
Definition at line 82 of file test_variant.cpp.
References BOARD::AddVariant(), BOOST_CHECK_EQUAL(), BOARD::DeleteVariant(), BOARD::GetCurrentVariant(), BOARD::GetVariantDescription(), BOARD::GetVariantNames(), BOARD::HasVariant(), BOARD::SetCurrentVariant(), and BOARD::SetVariantDescription().
| BOOST_AUTO_TEST_CASE | ( | BoardVariantTextVars | ) |
Definition at line 421 of file test_variant.cpp.
References BOARD::AddVariant(), BOOST_CHECK_EQUAL(), BOARD::ResolveTextVar(), BOARD::SetCurrentVariant(), and BOARD::SetVariantDescription().
| BOOST_AUTO_TEST_CASE | ( | ComponentVariantPartialOverride | ) |
Test that variant m_has* flags are properly respected during transfer.
When a flag is not set (m_hasDnp = false), the footprint variant value should be reset to the base footprint's value, not retained.
Definition at line 853 of file test_variant.cpp.
References BOARD::AddVariant(), COMPONENT::AddVariant(), BOOST_REQUIRE(), FOOTPRINT::GetDNPForVariant(), FOOTPRINT::GetExcludedFromBOMForVariant(), FOOTPRINT::GetExcludedFromPosFilesForVariant(), FOOTPRINT::GetExcludedFromSimForVariant(), FOOTPRINT::GetVariant(), COMPONENT::GetVariants(), FOOTPRINT::IsDNP(), FOOTPRINT::IsExcludedFromBOM(), FOOTPRINT::IsExcludedFromPosFiles(), FOOTPRINT::IsExcludedFromSim(), COMPONENT_VARIANT::m_dnp, COMPONENT_VARIANT::m_hasDnp, path, FOOTPRINT::SetDNP(), FOOTPRINT_VARIANT::SetDNP(), FOOTPRINT::SetExcludedFromBOM(), FOOTPRINT_VARIANT::SetExcludedFromBOM(), FOOTPRINT::SetExcludedFromPosFiles(), FOOTPRINT_VARIANT::SetExcludedFromPosFiles(), FOOTPRINT::SetExcludedFromSim(), FOOTPRINT_VARIANT::SetExcludedFromSim(), FOOTPRINT::SetReference(), and FOOTPRINT::SetVariant().
| BOOST_AUTO_TEST_CASE | ( | ComponentVariantToFootprintTransfer | ) |
Test that COMPONENT_VARIANT data from netlist transfers correctly to FOOTPRINT_VARIANT.
This simulates the variant property transfer that occurs during "Update PCB from Schematic".
Definition at line 746 of file test_variant.cpp.
References BOARD::AddVariant(), COMPONENT::AddVariant(), FOOTPRINT::AddVariant(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), FOOTPRINT_VARIANT::GetDNP(), FOOTPRINT::GetDNPForVariant(), FOOTPRINT_VARIANT::GetExcludedFromBOM(), FOOTPRINT::GetExcludedFromBOMForVariant(), FOOTPRINT_VARIANT::GetExcludedFromPosFiles(), FOOTPRINT::GetExcludedFromPosFilesForVariant(), FOOTPRINT_VARIANT::GetExcludedFromSim(), FOOTPRINT::GetExcludedFromSimForVariant(), FOOTPRINT_VARIANT::GetFieldValue(), FOOTPRINT::GetVariant(), COMPONENT::GetVariants(), FOOTPRINT_VARIANT::HasFieldValue(), COMPONENT_VARIANT::m_dnp, COMPONENT_VARIANT::m_excludedFromBOM, COMPONENT_VARIANT::m_excludedFromPosFiles, COMPONENT_VARIANT::m_excludedFromSim, COMPONENT_VARIANT::m_fields, COMPONENT_VARIANT::m_hasDnp, COMPONENT_VARIANT::m_hasExcludedFromBOM, COMPONENT_VARIANT::m_hasExcludedFromPosFiles, COMPONENT_VARIANT::m_hasExcludedFromSim, path, FOOTPRINT_VARIANT::SetDNP(), FOOTPRINT_VARIANT::SetExcludedFromBOM(), FOOTPRINT_VARIANT::SetExcludedFromPosFiles(), FOOTPRINT_VARIANT::SetExcludedFromSim(), FOOTPRINT_VARIANT::SetFieldValue(), FOOTPRINT::SetReference(), and FOOTPRINT::SetValue().
| BOOST_AUTO_TEST_CASE | ( | EmptyVariantReturnsBase | ) |
Test that empty variant name returns base attributes.
Definition at line 318 of file test_variant.cpp.
References BOARD::AddVariant(), FP_DNP, FOOTPRINT::GetDNPForVariant(), FOOTPRINT::SetAttributes(), FOOTPRINT_VARIANT::SetDNP(), and FOOTPRINT::SetVariant().
| BOOST_AUTO_TEST_CASE | ( | ExcessVariantsCleanedWhenNetlistEmpty | ) |
Regression test for issue #23564: stale footprint variant data must be cleaned up when the netlist contains no variant overrides for a component.
The netlist exporter uses delta encoding and omits variant properties that match the base symbol. When ALL of a variant's properties match the base, no variant data is emitted, making the component's variant list empty. The excess-variants cleanup in applyComponentVariants must still run in this case.
Definition at line 1248 of file test_variant.cpp.
References _, BOARD::AddVariant(), FOOTPRINT::AddVariant(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), FOOTPRINT::DeleteVariant(), FOOTPRINT::GetDNPForVariant(), FOOTPRINT::GetExcludedFromBOMForVariant(), FOOTPRINT::GetVariant(), FOOTPRINT::GetVariants(), FOOTPRINT::SetDNP(), FOOTPRINT_VARIANT::SetDNP(), FOOTPRINT::SetExcludedFromBOM(), FOOTPRINT_VARIANT::SetExcludedFromBOM(), FOOTPRINT::SetExcludedFromPosFiles(), FOOTPRINT::SetFPID(), and FOOTPRINT::SetReference().
| BOOST_AUTO_TEST_CASE | ( | ExcessVariantsSelectiveCleanup | ) |
Verify that excess-variants cleanup is selective: only variants NOT in the netlist are removed, while variants present in the netlist are preserved.
Definition at line 1299 of file test_variant.cpp.
References _, BOARD::AddVariant(), FOOTPRINT::AddVariant(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), FOOTPRINT::DeleteVariant(), FOOTPRINT::GetVariant(), FOOTPRINT::GetVariants(), FOOTPRINT::SetDNP(), FOOTPRINT_VARIANT::SetDNP(), FOOTPRINT_VARIANT::SetExcludedFromBOM(), FOOTPRINT::SetFPID(), and FOOTPRINT::SetReference().
| BOOST_AUTO_TEST_CASE | ( | FootprintBOMExclusionForVariant | ) |
Test footprint BOM exclusion for variant.
Definition at line 201 of file test_variant.cpp.
References BOARD::AddVariant(), FP_EXCLUDE_FROM_BOM, FOOTPRINT::GetExcludedFromBOMForVariant(), FOOTPRINT::SetAttributes(), FOOTPRINT_VARIANT::SetExcludedFromBOM(), and FOOTPRINT::SetVariant().
| BOOST_AUTO_TEST_CASE | ( | FootprintDNPForVariant | ) |
Test footprint DNP for variant.
Definition at line 123 of file test_variant.cpp.
References BOARD::AddVariant(), FP_DNP, FOOTPRINT::GetDNPForVariant(), FOOTPRINT::SetAttributes(), FOOTPRINT_VARIANT::SetDNP(), and FOOTPRINT::SetVariant().
| BOOST_AUTO_TEST_CASE | ( | FootprintFieldShownTextForVariant | ) |
Definition at line 400 of file test_variant.cpp.
References BOARD::AddVariant(), BOOST_CHECK_EQUAL(), PCB_FIELD::GetName(), PCB_FIELD::GetShownText(), INTERNAL, BOARD::SetCurrentVariant(), FOOTPRINT_VARIANT::SetFieldValue(), FOOTPRINT::SetValue(), FOOTPRINT::SetVariant(), and FOOTPRINT::Value().
| BOOST_AUTO_TEST_CASE | ( | FootprintPosFileExclusionForVariant | ) |
Test footprint position file exclusion for variant.
Definition at line 261 of file test_variant.cpp.
References BOARD::AddVariant(), FP_EXCLUDE_FROM_POS_FILES, FOOTPRINT::GetExcludedFromPosFilesForVariant(), FOOTPRINT::SetAttributes(), FOOTPRINT_VARIANT::SetExcludedFromPosFiles(), and FOOTPRINT::SetVariant().
| BOOST_AUTO_TEST_CASE | ( | FootprintSimExclusionForVariant | ) |
Test footprint simulation exclusion for variant.
Definition at line 231 of file test_variant.cpp.
References BOARD::AddVariant(), FP_EXCLUDE_FROM_SIM, FOOTPRINT::GetExcludedFromSimForVariant(), FOOTPRINT::SetAttributes(), FOOTPRINT_VARIANT::SetExcludedFromSim(), and FOOTPRINT::SetVariant().
| BOOST_AUTO_TEST_CASE | ( | FootprintVariantBasics | ) |
Test FOOTPRINT_VARIANT class basic operations.
Definition at line 51 of file test_variant.cpp.
References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), FOOTPRINT_VARIANT::GetDNP(), FOOTPRINT_VARIANT::GetExcludedFromBOM(), FOOTPRINT_VARIANT::GetExcludedFromPosFiles(), FOOTPRINT_VARIANT::GetExcludedFromSim(), FOOTPRINT_VARIANT::GetFields(), FOOTPRINT_VARIANT::GetFieldValue(), FOOTPRINT_VARIANT::GetName(), FOOTPRINT_VARIANT::HasFieldValue(), FOOTPRINT_VARIANT::SetDNP(), FOOTPRINT_VARIANT::SetExcludedFromBOM(), FOOTPRINT_VARIANT::SetExcludedFromPosFiles(), FOOTPRINT_VARIANT::SetExcludedFromSim(), and FOOTPRINT_VARIANT::SetFieldValue().
| BOOST_AUTO_TEST_CASE | ( | FootprintVariantCopyAssignment | ) |
Definition at line 365 of file test_variant.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), copy, FOOTPRINT_VARIANT::GetDNP(), FOOTPRINT_VARIANT::GetExcludedFromBOM(), FOOTPRINT_VARIANT::GetExcludedFromSim(), FOOTPRINT_VARIANT::GetFieldValue(), PCB_FIELD::GetName(), FOOTPRINT::GetVariant(), FOOTPRINT_VARIANT::SetDNP(), FOOTPRINT_VARIANT::SetExcludedFromBOM(), FOOTPRINT_VARIANT::SetExcludedFromSim(), FOOTPRINT_VARIANT::SetFieldValue(), FOOTPRINT::SetReference(), FOOTPRINT::SetValue(), FOOTPRINT::SetVariant(), and FOOTPRINT::Value().
| BOOST_AUTO_TEST_CASE | ( | FootprintVariantTextVarResolution | ) |
Test footprint text variable resolution for variants.
Definition at line 165 of file test_variant.cpp.
References BOARD::AddVariant(), BOOST_CHECK_EQUAL(), FOOTPRINT::ResolveTextVar(), FOOTPRINT::SetAttributes(), BOARD::SetCurrentVariant(), FOOTPRINT_VARIANT::SetDNP(), FOOTPRINT_VARIANT::SetExcludedFromSim(), and FOOTPRINT::SetVariant().
| BOOST_AUTO_TEST_CASE | ( | GetVariantNamesForUIFormat | ) |
Test GetVariantNamesForUI returns sorted list with default first.
Definition at line 640 of file test_variant.cpp.
References BOARD::AddVariant(), and BOARD::GetVariantNamesForUI().
| BOOST_AUTO_TEST_CASE | ( | Issue23298_BaseFootprintHiddenInNonDefaultVariant | ) |
Regression test for issue #23298: the 3D viewer shows the default-variant footprint even when a different variant is active and that variant has a different footprint assignment.
When multiple footprints share a RefDes (one per variant), applyComponentVariants() must give the base footprint DNP=true in its per-variant data for every variant where it is not the active choice. Without this, GetDNPForVariant() falls back to IsDNP() (the global flag), which is false for the base footprint, so it is incorrectly shown while a non-default variant is active.
The test drives the full BOARD_NETLIST_UPDATER path in a single pass so it exercises the fix (rather than merely reading a pre-populated board file) and guards against the ordering bug where the correct footprint stays hidden until a second update.
Definition at line 1358 of file test_variant.cpp.
References COMPONENT::AddVariant(), BOOST_REQUIRE(), COMPONENT, FOOTPRINT, LIB_ID::Format(), GetDefaultFieldName(), FOOTPRINT::GetDNPForVariant(), SETTINGS_MANAGER::LoadProject(), netlist, LIB_ID::Parse(), SETTINGS_MANAGER::Prj(), TOOL_MANAGER::RegisterTool(), BOARD_NETLIST_UPDATER::SetDeleteUnusedFootprints(), TOOL_MANAGER::SetEnvironment(), FOOTPRINT::SetFPID(), FOOTPRINT::SetReference(), BOARD_NETLIST_UPDATER::SetReplaceFootprints(), UNTRANSLATED, BOARD_NETLIST_UPDATER::UpdateNetlist(), and UTF8::wx_str().
| BOOST_AUTO_TEST_CASE | ( | MultipleVariantsIndependent | ) |
Test adding multiple variants and verifying they're independent.
Definition at line 500 of file test_variant.cpp.
References BOARD::AddVariant(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), FOOTPRINT::GetDNPForVariant(), PCB_FIELD::GetName(), FOOTPRINT::GetVariant(), BOARD::GetVariantDescription(), FOOTPRINT_VARIANT::SetDNP(), FOOTPRINT_VARIANT::SetFieldValue(), FOOTPRINT::SetReference(), FOOTPRINT::SetValue(), FOOTPRINT::SetVariant(), BOARD::SetVariantDescription(), v1, v2, and FOOTPRINT::Value().
| BOOST_AUTO_TEST_CASE | ( | NetlistComponentVariantsParsing | ) |
Definition at line 444 of file test_variant.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), NETLIST::GetComponent(), NETLIST::GetCount(), COMPONENT::GetVariant(), COMPONENT_VARIANT::m_dnp, COMPONENT_VARIANT::m_excludedFromBOM, COMPONENT_VARIANT::m_excludedFromSim, COMPONENT_VARIANT::m_fields, COMPONENT_VARIANT::m_hasDnp, COMPONENT_VARIANT::m_hasExcludedFromBOM, COMPONENT_VARIANT::m_hasExcludedFromSim, netlist, and KICAD_NETLIST_PARSER::Parse().
| BOOST_AUTO_TEST_CASE | ( | PosExportVariantValue | ) |
Test that PLACE_FILE_EXPORTER uses variant-specific Value fields (issue #23547).
When a variant overrides a component's Value, the pos file export must reflect the variant's value, not the default footprint value. Both ASCII and CSV formats must respect the variant.
Definition at line 1169 of file test_variant.cpp.
References BOARD::Add(), BOARD::AddVariant(), FOOTPRINT, PLACE_FILE_EXPORTER::GenPositionData(), PLACE_FILE_EXPORTER::GenReportData(), PCB_FIELD::GetName(), INSERT, FOOTPRINT_VARIANT::SetFieldValue(), FOOTPRINT::SetReference(), FOOTPRINT::SetValue(), FOOTPRINT::SetVariant(), PLACE_FILE_EXPORTER::SetVariant(), and FOOTPRINT::Value().
| BOOST_AUTO_TEST_CASE | ( | RenameVariantPreservesData | ) |
Test renaming variant to existing name fails or merges appropriately.
Definition at line 614 of file test_variant.cpp.
References BOARD::AddVariant(), BOOST_CHECK_EQUAL(), BOARD::GetCurrentVariant(), BOARD::GetVariantDescription(), BOARD::HasVariant(), BOARD::RenameVariant(), BOARD::SetCurrentVariant(), and BOARD::SetVariantDescription().
| BOOST_AUTO_TEST_CASE | ( | UnknownVariantReturnsBase | ) |
Test that unknown variant name returns base attributes.
Definition at line 345 of file test_variant.cpp.
References BOARD::AddVariant(), FP_DNP, FOOTPRINT::GetDNPForVariant(), FOOTPRINT::SetAttributes(), FOOTPRINT_VARIANT::SetDNP(), and FOOTPRINT::SetVariant().
| BOOST_AUTO_TEST_CASE | ( | VariantAttributeTransferWithReset | ) |
Test the complete variant attribute transfer flow simulating board_netlist_updater behavior.
This tests the fixed logic where attributes without explicit overrides are reset to base values.
Definition at line 932 of file test_variant.cpp.
References BOARD::AddVariant(), FOOTPRINT::AddVariant(), BOOST_REQUIRE(), FOOTPRINT::GetDNPForVariant(), FOOTPRINT::GetExcludedFromBOMForVariant(), FOOTPRINT::GetExcludedFromPosFilesForVariant(), FOOTPRINT::GetExcludedFromSimForVariant(), FOOTPRINT::IsDNP(), FOOTPRINT::IsExcludedFromBOM(), FOOTPRINT::IsExcludedFromPosFiles(), FOOTPRINT::IsExcludedFromSim(), COMPONENT_VARIANT::m_dnp, COMPONENT_VARIANT::m_excludedFromBOM, COMPONENT_VARIANT::m_excludedFromPosFiles, COMPONENT_VARIANT::m_excludedFromSim, COMPONENT_VARIANT::m_hasDnp, COMPONENT_VARIANT::m_hasExcludedFromBOM, COMPONENT_VARIANT::m_hasExcludedFromPosFiles, COMPONENT_VARIANT::m_hasExcludedFromSim, FOOTPRINT::SetDNP(), FOOTPRINT_VARIANT::SetDNP(), FOOTPRINT::SetExcludedFromBOM(), FOOTPRINT_VARIANT::SetExcludedFromBOM(), FOOTPRINT::SetExcludedFromPosFiles(), FOOTPRINT_VARIANT::SetExcludedFromPosFiles(), FOOTPRINT::SetExcludedFromSim(), FOOTPRINT_VARIANT::SetExcludedFromSim(), FOOTPRINT::SetFPID(), and FOOTPRINT::SetReference().
| BOOST_AUTO_TEST_CASE | ( | VariantCaseInsensitivity | ) |
Test variant case insensitivity for all operations.
Definition at line 291 of file test_variant.cpp.
References BOARD::AddVariant(), FOOTPRINT::GetDNPForVariant(), BOARD::HasVariant(), FOOTPRINT_VARIANT::SetDNP(), and FOOTPRINT::SetVariant().
| BOOST_AUTO_TEST_CASE | ( | VariantDeletionClearsRegistry | ) |
Test variant deletion clears board variant registry.
Definition at line 586 of file test_variant.cpp.
References BOARD::AddVariant(), BOOST_CHECK_EQUAL(), BOARD::DeleteVariant(), BOARD::GetCurrentVariant(), BOARD::GetVariantNames(), BOARD::HasVariant(), BOARD::SetCurrentVariant(), and BOARD::SetVariantDescription().
| BOOST_AUTO_TEST_CASE | ( | VariantFieldUnicodeAndSpecialChars | ) |
Test variant field values with unicode and special characters.
Definition at line 547 of file test_variant.cpp.
References BOARD::AddVariant(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), FOOTPRINT_VARIANT::GetFieldValue(), PCB_FIELD::GetName(), FOOTPRINT::GetVariant(), BOARD::GetVariantDescription(), FOOTPRINT_VARIANT::SetFieldValue(), FOOTPRINT::SetValue(), FOOTPRINT::SetVariant(), BOARD::SetVariantDescription(), and FOOTPRINT::Value().
| BOOST_AUTO_TEST_CASE | ( | VariantMultipleFlagsCombinations | ) |
Test multiple flags can be set independently for each variant.
Definition at line 680 of file test_variant.cpp.
References BOARD::AddVariant(), FOOTPRINT::GetDNPForVariant(), FOOTPRINT::GetExcludedFromBOMForVariant(), FOOTPRINT::GetExcludedFromPosFilesForVariant(), FOOTPRINT::GetExcludedFromSimForVariant(), FOOTPRINT_VARIANT::SetDNP(), FOOTPRINT_VARIANT::SetExcludedFromBOM(), FOOTPRINT_VARIANT::SetExcludedFromPosFiles(), FOOTPRINT_VARIANT::SetExcludedFromSim(), and FOOTPRINT::SetVariant().
| BOOST_AUTO_TEST_CASE | ( | VariantTestProjectLoad | ) |
Test loading and verifying variant data from the variant_test project files.
Definition at line 1092 of file test_variant.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), FOOTPRINT_VARIANT::GetDNP(), FOOTPRINT_VARIANT::GetFieldValue(), KI_TEST::GetPcbnewTestDataDir(), FOOTPRINT_VARIANT::HasFieldValue(), and PCB_IO::LoadBoard().
| BOOST_AUTO_TEST_CASE | ( | VariantTestR2FootprintAttributeVerification | ) |
Test that recreates the user's observed bug:
The reported bug: "R2:Variant A has no attributes set in schematic but has 3 attributes on board" This test verifies which footprint has which attributes and whether that's correct behavior.
Definition at line 1005 of file test_variant.cpp.
References BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), FOOTPRINT_VARIANT::GetDNP(), FOOTPRINT_VARIANT::GetExcludedFromBOM(), FOOTPRINT_VARIANT::GetExcludedFromPosFiles(), KI_TEST::GetPcbnewTestDataDir(), FOOTPRINT::GetVariant(), FOOTPRINT::IsDNP(), FOOTPRINT::IsExcludedFromBOM(), FOOTPRINT::IsExcludedFromPosFiles(), and PCB_IO::LoadBoard().