|
KiCad PCB EDA Suite
|
#include <qa_utils/wx_utils/unit_test_utils.h>#include <pcbnew_utils/board_construction_utils.h>#include <boost/test/data/test_case.hpp>#include <wx/wx.h>#include <layer_ids.h>#include <gal/color4d.h>#include <geometry/eda_angle.h>#include <pcbnew/pcbexpr_evaluator.h>#include <drc/drc_rule.h>#include <drc/drc_rule_parser.h>#include <ki_exception.h>#include <reporter.h>#include <pcbnew/board.h>#include <board_design_settings.h>#include <pcbnew/pcb_shape.h>#include <pcbnew/pcb_table.h>#include <pcbnew/pcb_track.h>#include <pcbnew/footprint.h>#include <pcbnew/pcb_text.h>#include <pcbnew/zone.h>#include <project/net_settings.h>#include <properties/property.h>#include <properties/property_mgr.h>Go to the source code of this file.
Classes | |
| struct | EXPR_TO_TEST |
Typedefs | |
| using | VAL = LIBEVAL::VALUE |
Functions | |
| static bool | testEvalExpr (const wxString &expr, const LIBEVAL::VALUE &expectedResult, bool expectError=false, BOARD_ITEM *itemA=nullptr, BOARD_ITEM *itemB=nullptr) |
| static void | expectCompileError (const wxString &aExpr) |
| static void | expectCompileSuccess (const wxString &aExpr) |
| BOOST_AUTO_TEST_CASE (IntrospectedProperties) | |
| BOOST_AUTO_TEST_CASE (IntrospectedExtendedNumericProperties) | |
| BOOST_AUTO_TEST_CASE (RenamedProperties) | |
| BOOST_AUTO_TEST_CASE (IntrospectedColorProperties) | |
| BOOST_AUTO_TEST_CASE (ExpressionPropertyTypesAreSupported) | |
| BOOST_AUTO_TEST_CASE (IntrospectedPropertyAvailability) | |
| BOOST_AUTO_TEST_CASE (InNetChainClassWildcard) | |
| BOOST_AUTO_TEST_CASE (StackedMicroviaExpression) | |
| BOOST_AUTO_TEST_CASE (ParentNavigation) | |
| BOOST_AUTO_TEST_CASE (ReceiverValidation) | |
| BOOST_AUTO_TEST_CASE (LayerReceiverLayerField) | |
| BOOST_AUTO_TEST_CASE (DynamicCourtyardArgument) | |
| BOOST_AUTO_TEST_CASE (FunctionArgumentValidation) | |
| BOOST_AUTO_TEST_CASE (SingleItemRulePreflight) | |
| BOOST_AUTO_TEST_CASE (PairConditionsInSingleItemRules) | |
| BOOST_AUTO_TEST_CASE (PairItemDependency) | |
Variables | |
| static const std::vector< EXPR_TO_TEST > | simpleExpressions |
| static const std::vector< EXPR_TO_TEST > | introspectionExpressions |
| using VAL = LIBEVAL::VALUE |
Definition at line 61 of file test_libeval_compiler.cpp.
| BOOST_AUTO_TEST_CASE | ( | DynamicCourtyardArgument | ) |
Definition at line 558 of file test_libeval_compiler.cpp.
References BOARD::Add(), LIBEVAL::VALUE::AsDouble(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_CONTEXT(), LIBEVAL::COMPILER::Compile(), KI_TEST::DrawRect(), F_CrtYd, F_Fab, FOOTPRINT, LIBEVAL::COMPILER::GetError(), PROPERTY_MANAGER::Instance(), LIBEVAL::COMPILER::IsErrorPending(), LIBEVAL::ERROR_STATUS::message, NULL_CONSTRAINT, pcbIUScale, PROPERTY_MANAGER::Rebuild(), PCBEXPR_UCODE::RequiresPairItems(), LIBEVAL::UCODE::Run(), SEGMENT, PCB_SHAPE::SetEnd(), PCBEXPR_CONTEXT::SetItems(), PCB_SHAPE::SetLayer(), FOOTPRINT::SetReference(), PCB_SHAPE::SetStart(), and PCB_SHAPE::SetWidth().
| BOOST_AUTO_TEST_CASE | ( | ExpressionPropertyTypesAreSupported | ) |
Definition at line 312 of file test_libeval_compiler.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), PCBEXPR_VAR_REF::ClassifyProperty(), expectCompileError(), PCBEXPR_VAR_REF::ExpressionType(), PROPERTY_MANAGER::GetAllClasses(), PROPERTY_MANAGER::Instance(), PROPERTY_MANAGER::IsOfType(), PROPERTY_BASE::Name(), PROPERTY_MANAGER::Rebuild(), TYPE_HASH, PROPERTY_BASE::TypeHash(), and UNSUPPORTED.
| BOOST_AUTO_TEST_CASE | ( | FunctionArgumentValidation | ) |
Definition at line 611 of file test_libeval_compiler.cpp.
References expectCompileError().
| BOOST_AUTO_TEST_CASE | ( | InNetChainClassWildcard | ) |
Definition at line 378 of file test_libeval_compiler.cpp.
References BOARD::GetDesignSettings(), PROPERTY_MANAGER::Instance(), BOARD_DESIGN_SETTINGS::m_NetSettings, PROPERTY_MANAGER::Rebuild(), BOARD_CONNECTED_ITEM::SetNet(), NETINFO_ITEM::SetNetChain(), and testEvalExpr().
| BOOST_AUTO_TEST_CASE | ( | IntrospectedColorProperties | ) |
Definition at line 287 of file test_libeval_compiler.cpp.
References BOOST_CHECK_EQUAL(), PROPERTY_MANAGER::Instance(), PROPERTY_MANAGER::Rebuild(), table, testEvalExpr(), and KIGFX::COLOR4D::ToCSSString().
| BOOST_AUTO_TEST_CASE | ( | IntrospectedExtendedNumericProperties | ) |
Definition at line 230 of file test_libeval_compiler.cpp.
References DEGREES_T, ELLIPSE, F_Cu, PROPERTY_MANAGER::Instance(), PROPERTY_MANAGER::Rebuild(), ZONE::SetAssignedPriority(), PCB_SHAPE::SetEllipseRotation(), ZONE::SetHatchOrientation(), ZONE::SetLayer(), FOOTPRINT::SetLocalSolderPasteMarginRatio(), ZONE::SetMinIslandArea(), and testEvalExpr().
| BOOST_AUTO_TEST_CASE | ( | IntrospectedProperties | ) |
Definition at line 194 of file test_libeval_compiler.cpp.
References F_Cu, BOARD::GetNetInfo(), PROPERTY_MANAGER::Instance(), introspectionExpressions, pcbIUScale, PROPERTY_MANAGER::Rebuild(), BOARD_CONNECTED_ITEM::SetLayer(), BOARD_CONNECTED_ITEM::SetNet(), NETINFO_ITEM::SetNetClass(), PCB_TRACK::SetWidth(), and testEvalExpr().
| BOOST_AUTO_TEST_CASE | ( | IntrospectedPropertyAvailability | ) |
Definition at line 358 of file test_libeval_compiler.cpp.
References F_Cu, PROPERTY_MANAGER::Instance(), PROPERTY_MANAGER::Rebuild(), ZONE::SetAssignedPriority(), ZONE::SetIsRuleArea(), ZONE::SetLayer(), and testEvalExpr().
| BOOST_AUTO_TEST_CASE | ( | LayerReceiverLayerField | ) |
Definition at line 536 of file test_libeval_compiler.cpp.
References LIBEVAL::VALUE::AsDouble(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), LIBEVAL::COMPILER::Compile(), F_Cu, F_Paste, LIBEVAL::COMPILER::IsErrorPending(), NULL_CONSTRAINT, paste, LIBEVAL::UCODE::Run(), PCBEXPR_CONTEXT::SetItems(), and UNDEFINED_LAYER.
| BOOST_AUTO_TEST_CASE | ( | PairConditionsInSingleItemRules | ) |
Definition at line 677 of file test_libeval_compiler.cpp.
References BOOST_TEST_CONTEXT(), PROPERTY_MANAGER::Instance(), DRC_RULES_PARSER::Parse(), PROPERTY_MANAGER::Rebuild(), and reporter.
| BOOST_AUTO_TEST_CASE | ( | PairItemDependency | ) |
Definition at line 731 of file test_libeval_compiler.cpp.
References BOOST_REQUIRE(), LIBEVAL::COMPILER::Compile(), NULL_CONSTRAINT, PCBEXPR_UCODE::RequiresPairItems(), and UNDEFINED_LAYER.
| BOOST_AUTO_TEST_CASE | ( | ParentNavigation | ) |
Definition at line 477 of file test_libeval_compiler.cpp.
References FOOTPRINT::Add(), expectCompileError(), PROPERTY_MANAGER::Instance(), PROPERTY_MANAGER::Rebuild(), FOOTPRINT::SetReference(), testEvalExpr(), and text.
| BOOST_AUTO_TEST_CASE | ( | ReceiverValidation | ) |
Definition at line 523 of file test_libeval_compiler.cpp.
References expectCompileError(), and expectCompileSuccess().
| BOOST_AUTO_TEST_CASE | ( | RenamedProperties | ) |
Definition at line 263 of file test_libeval_compiler.cpp.
References expectCompileSuccess(), PROPERTY_MANAGER::Instance(), pcbIUScale, PROPERTY_MANAGER::Rebuild(), PCB_TRACK::SetEnd(), PCB_TRACK::SetStart(), and testEvalExpr().
| BOOST_AUTO_TEST_CASE | ( | SingleItemRulePreflight | ) |
Definition at line 622 of file test_libeval_compiler.cpp.
References BOOST_TEST_CONTEXT(), PROPERTY_MANAGER::Instance(), DRC_RULES_PARSER::Parse(), PROPERTY_MANAGER::Rebuild(), and reporter.
| BOOST_AUTO_TEST_CASE | ( | StackedMicroviaExpression | ) |
Definition at line 418 of file test_libeval_compiler.cpp.
References BOARD::Add(), PADSTACK::ALL_LAYERS, B_Cu, F_Cu, In1_Cu, In2_Cu, BOARD::IncrementTimeStamp(), PROPERTY_MANAGER::Instance(), MICROVIA, pcbIUScale, PROPERTY_MANAGER::Rebuild(), BOARD::SetCopperLayerCount(), PCB_VIA::SetDrill(), PCB_VIA::SetLayerPair(), PCB_VIA::SetPosition(), PCB_VIA::SetViaType(), PCB_VIA::SetWidth(), testEvalExpr(), THROUGH, and via.
|
static |
Definition at line 164 of file test_libeval_compiler.cpp.
References LIBEVAL::COMPILER::Compile(), LIBEVAL::COMPILER::IsErrorPending(), NULL_CONSTRAINT, and UNDEFINED_LAYER.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 176 of file test_libeval_compiler.cpp.
References LIBEVAL::COMPILER::Compile(), LIBEVAL::COMPILER::IsErrorPending(), NULL_CONSTRAINT, and UNDEFINED_LAYER.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 114 of file test_libeval_compiler.cpp.
References LIBEVAL::VALUE::AsDouble(), LIBEVAL::VALUE::AsString(), BOOST_CHECK_EQUAL(), BOOST_TEST_MESSAGE(), LIBEVAL::COMPILER::Compile(), LIBEVAL::COMPILER::GetError(), LIBEVAL::VALUE::GetType(), LIBEVAL::ERROR_STATUS::message, NULL_CONSTRAINT, result, LIBEVAL::UCODE::Run(), PCBEXPR_CONTEXT::SetItems(), LIBEVAL::ERROR_STATUS::srcPos, UNDEFINED_LAYER, and LIBEVAL::VT_NUMERIC.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 97 of file test_libeval_compiler.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 63 of file test_libeval_compiler.cpp.