|
KiCad PCB EDA Suite
|
Classes | |
| class | ALLEGRO_CACHED_LOADER |
| Singleton class to load Allegro boards and cache them in memory, to avoid repeatedly loading and parsing the same board files for multiple tests. More... | |
| struct | BLOCK_TEST_INFO |
| A complete description of a block test. More... | |
| class | BOARD_DUMPER |
| A helper that contains logic to assist in dumping boards to disk depending on some environment variables. More... | |
| class | BOARD_EXPECTATION |
| A single expectation about a board, which can be run as a test against a parsed BOARD. More... | |
| class | BOARD_EXPECTATION_TEST |
| struct | BOARD_LOAD_TEST_CASE |
| struct | BOARD_TEST_DEF |
| class | CACHED_BOARD_LOADER |
| Manager for caching loaded boards in memory, to avoid repeatedly loading and parsing the same board. More... | |
| class | CAPTURING_REPORTER |
| Custom REPORTER that captures all messages for later analysis in the unit test framework. More... | |
| class | COMBINED_UTILITY |
| Class that handles delegation of command lines to one of a number of "sub-utilities". More... | |
| struct | CommonTestData |
| Common data for some of the SHAPE_POLY_SET tests: More... | |
| class | CONSOLE_LOG |
| class | CONSOLE_MSG_REPORTER |
| class | COUNTING_WXLOG |
| Counts error-level records so a failed save can be checked for reports beyond the one it throws. More... | |
| class | DUMMY_TOOL |
| struct | HEADER_TEST_INFO |
| A header block, along with the expected result of parsing it. More... | |
| struct | kitest_cmp_drawings |
| struct | NAMED_CASE |
| A named data-driven test case. More... | |
| class | QUIET_LOG |
| A stderr log target that drops informational messages. More... | |
| class | SCHEMATIC_TEST_FIXTURE |
| A generic fixture for loading schematics and associated settings for qa tests. More... | |
| class | SCOPED_COUNTING_WXLOG |
| A scoped application of a wxLog target that counts error-level messages. More... | |
| class | SCOPED_PROCESS_TEMP_DIR |
| Install a temporary directory for the process to use for temporary files, which is (usually) removed on destruction. More... | |
| class | SCOPED_TEMP_DIR |
| class | SCOPED_TEMP_PROJECT |
| class | STALE_DRU_SIDECAR_FIXTURE |
| Several PCB importers (DipTrace, Eagle, PADS) write a .kicad_dru sidecar next to the board file they load. More... | |
| struct | SVG_VIEWBOX |
| struct | UTILITY_PROGRAM |
| Description of a "utility program", which is a program that takes some command line and does "something". More... | |
| class | WX_ASSERT_ERROR |
| An exception class to represent a WX assertion. More... | |
Typedefs | |
| template<typename EXP_CONT> | |
| using | EXP_OBJ = typename EXP_CONT::value_type |
| template<typename FOUND_CONT> | |
| using | FOUND_OBJ = typename FOUND_CONT::value_type |
| template<typename EXP_OBJ, typename FOUND_OBJ> | |
| using | MATCH_PRED = std::function<bool( const EXP_OBJ&, const FOUND_OBJ& )> |
| A match predicate: check that a "found" object is equivalent to or represents an "expected" object, perhaps of a different type. | |
Enumerations | |
| enum | RET_CODES { OK = 0 , BAD_CMDLINE = 1 , UNKNOWN_TOOL = 2 , TOOL_SPECIFIC = 10 } |
| Return codes for tools. More... | |
Functions | |
| void | DrawSegment (FOOTPRINT &aFootprint, const SEG &aSeg, int aWidth, PCB_LAYER_ID aLayer) |
| Draw a segment in the given footprint. | |
| void | DrawPolyline (FOOTPRINT &aFootprint, const std::vector< VECTOR2I > &aPts, int aWidth, PCB_LAYER_ID aLayer) |
| Draw a polyline - a set of linked segments. | |
| void | DrawArc (FOOTPRINT &aFootprint, const VECTOR2I &aCentre, const VECTOR2I &aStart, const EDA_ANGLE &aAngle, int aWidth, PCB_LAYER_ID aLayer) |
| Draw an arc on a footprint. | |
| void | DrawRect (FOOTPRINT &aFootprint, const VECTOR2I &aPos, const VECTOR2I &aSize, int aRadius, int aWidth, PCB_LAYER_ID aLayer) |
| Draw a rectangle on a footprint. | |
| std::string | GetPcbnewTestDataDir () |
| Utility which returns a path to the data directory where the test board files are stored. | |
| void | DumpBoardToFile (BOARD &aBoard, const std::filesystem::path &aFilename) |
| Utility function to simply write a Board out to a file. | |
| std::unique_ptr< BOARD_ITEM > | ReadBoardItemFromStream (std::istream &aStream) |
| Utility function to read a BOARD_ITEM (probably a FOOTPRINT or a BOARD) from a file. | |
| std::unique_ptr< BOARD > | ReadBoardFromFileOrStream (const std::string &aFilename, std::istream &aFallback=std::cin) |
| Read a board from a file, or another stream, as appropriate. | |
| std::unique_ptr< FOOTPRINT > | ReadFootprintFromFileOrStream (const std::string &aFilename, std::istream &aFallback) |
| void | DumpFootprintToFile (const FOOTPRINT &aFootprint, const std::filesystem::path &aLibraryPath) |
| Same as DumpBoardToFile, but for footprints. | |
| void | LoadBoard (SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< BOARD > &aBoard) |
| BOARD_ITEM & | RequireBoardItemWithTypeAndId (const BOARD &aBoard, KICAD_T aItemType, const KIID &aID) |
| Get an item from the given board with a certain type and UUID. | |
| void | LoadAndTestBoardFile (const wxString aRelativePath, bool aRoundtrip, std::function< void(BOARD &)> aBoardTestFunction, std::optional< int > aExpectedBoardVersion=std::nullopt) |
| Perform "some test" on a board file loaded from the path, then optionally save and reload and run the test again. | |
| void | LoadAndTestFootprintFile (const wxString &aLibRelativePath, const wxString &aFpName, bool aRoundtrip, std::function< void(FOOTPRINT &)> aFootprintTestFunction, std::optional< int > aExpectedFootprintVersion) |
| Same as LoadAndTestBoardFile, but for footprints. | |
| void | FillZones (BOARD *m_board) |
| void | CheckFootprint (const FOOTPRINT *expected, const FOOTPRINT *fp) |
| Helper method to check if two footprints are semantically the same. | |
| void | CheckFpPad (const PAD *expected, const PAD *pad) |
| void | CheckFpText (const PCB_TEXT *expected, const PCB_TEXT *text) |
| void | CheckFpShape (const PCB_SHAPE *expected, const PCB_SHAPE *shape) |
| void | CheckFpZone (const ZONE *expected, const ZONE *zone) |
| void | CheckShapePolySet (const SHAPE_POLY_SET *expected, const SHAPE_POLY_SET *polyset) |
| void | PrintBoardStats (const BOARD *aBoard, const std::string &aBoardName) |
| Print detailed board statistics for debugging using test-framework logging. | |
| std::unique_ptr< BOARD > | LoadBoardWithCapture (PCB_IO &aIoPlugin, const std::string &aFilePath, REPORTER *aReporter) |
| Attempt to load an board with a given IO plugin, capturing all reporter messages. | |
| template<typename ITEM> | |
| std::unique_ptr< ITEM > | ReadItemFromStream (std::istream &aStream) |
| Read a specific kind of BOARD_ITEM from a stream. | |
| SHAPE_LINE_CHAIN | BuildRectChain (const VECTOR2I &aSize, const VECTOR2I &aCentre={ 0, 0 }) |
| Builds a rectangular SHAPE_LINE_CHAIN of a certain size at a certain centre. | |
| SHAPE_LINE_CHAIN | BuildSquareChain (int aSize, const VECTOR2I &aCentre={ 0, 0 }) |
| Builds a square SHAPE_LINE_CHAIN of a certain size at a certain centre. | |
| SHAPE_POLY_SET | BuildPolyset (const std::vector< SHAPE_LINE_CHAIN > &aOutlines) |
| Construct a SHAPE_POLY_SET from a list of points for each of outlines (no holes) | |
| SHAPE_POLY_SET | BuildHollowSquare (int aOuterSize, int aInnerSize, const VECTOR2I &aCentre={ 0, 0 }) |
| Build a SHAPE_POLY_SET in the shape of a square outline, with a square hole, both centred at the given point. | |
| SEG | BuildHSeg (const VECTOR2I &aStart, int aLength) |
| Build a horizontal segment from a point with a length. | |
| SEG | BuildVSeg (const VECTOR2I &aStart, int aLength) |
| Build a vertical segment from a point with a length. | |
| template<typename VEC> | |
| bool | IsVecWithinTol (const VEC &aVec, const VEC &aExp, typename VEC::coord_type aTol) |
| Check that both x and y of a vector are within expected error. | |
| template<typename BOX> | |
| bool | IsBoxWithinTol (const BOX &aBox, const BOX &aExp, typename BOX::coord_type aTol) |
| Check that a box is close enough to another box. | |
| bool | ChainsAreCyclicallyEqual (const SHAPE_LINE_CHAIN &aChainA, const SHAPE_LINE_CHAIN &aChainB, int aTol) |
| Check that two chains are cyclically equal. | |
| template<typename T> | |
| bool | IsWithinWrapped (T aValue, T aNominal, T aWrap, T aError) |
| Check if a value is within a tolerance of a nominal value, wrapping to a given val. | |
| template<typename T> | |
| bool | IsWithin (T aValue, T aNominal, T aError) |
| Check if a value is within a tolerance of a nominal value. | |
| template<typename T> | |
| bool | IsWithinBounds (T aValue, T aNominal, T aErrorAbove, T aErrorBelow) |
| Check if a value is within a tolerance of a nominal value, with different allowances for errors above and below. | |
| template<typename T> | |
| bool | IsWithinAndBelow (T aValue, T aNominal, T aErrorBelow) |
| value is in range [aNominal - aErrorBelow, aNominal] | |
| template<typename T> | |
| bool | IsWithinAndAbove (T aValue, T aNominal, T aErrorAbove) |
| value is in range [aNominal, aNominal + aErrorAbove] | |
| tl::expected< wxXmlDocument, wxString > | LoadSvg (const wxString &aSvg) |
| tl::expected< SVG_VIEWBOX, wxString > | ParseViewBox (const wxXmlNode &aRoot) |
| Parse the four numbers of the SVG viewBox attribute (min-x, min-y, width, height). | |
| const wxXmlNode * | FindFirstRect (const wxXmlNode &aNode) |
| Find the first <rect> element in the given XML node's descendants. | |
| bool | IsUUID (const std::string &aStr) |
| Check if the string between the iterators looks like a UUID. | |
| bool | IsUUIDPathWithLevels (const std::string &aStr, unsigned aLevels) |
| Predicate to check a string is a UUID path format. | |
| template<typename EXP_CONT, typename FOUND_CONT, typename MATCH_PRED> | |
| void | CheckUnorderedMatches (const EXP_CONT &aExpected, const FOUND_CONT &aFound, MATCH_PRED aMatchPredicate) |
| Check that a container of "found" objects matches a container of "expected" objects. | |
| template<typename T> | |
| bool | CollectionHasNoDuplicates (const T &aCollection) |
| Predicate to check a collection has no duplicate elements. | |
| std::string | GetEeschemaTestDataDir () |
| Get the configured location of Eeschema test data. | |
| std::string | GetTestDataRootDir () |
| std::vector< uint8_t > | LoadBinaryData (const std::string &aFilePath, std::optional< size_t > aLoadBytes=std::nullopt) |
| Load the contents of a file into a vector of bytes. | |
| std::string | LoadStringData (const wxString &aPath) |
| Load the contents of a file into a string. | |
| void | SetMockConfigDir () |
| bool | CanDoDisplayTests () |
| Some tests on some platforms require a display connection to run. | |
| void | ReportAssertOffMainThread (const wxString &aFile, int aLine, const wxString &aFunc, const wxString &aCond, const wxString &aMsg) |
| Print a wx assertion that fired outside the main thread, then exit the process. | |
| void | wxAssertThrower (const wxString &aFile, int aLine, const wxString &aFunc, const wxString &aCond, const wxString &aMsg) |
| void | DumpSchematicToFile (SCHEMATIC &aSchematic, SCH_SHEET &aSheet, const std::string &aFilename) |
| std::unique_ptr< SCHEMATIC > | LoadHierarchyFromRoot (const std::string &rootFilename, PROJECT *project) |
| std::unique_ptr< SCHEMATIC > | ReadSchematicFromStream (std::istream &aStream, PROJECT *aProject) |
| void | LoadSchematic (SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic) |
| std::unique_ptr< SCHEMATIC > | ReadSchematicFromFile (const std::string &aFilename, PROJECT *aProject) |
| bool | IsColorNear (const KIGFX::COLOR4D &aCol, const KIGFX::COLOR4D aOther, double aTol) |
| Checks if a COLOR4D is close enough to another. | |
| bool | IsColorNearHex (const KIGFX::COLOR4D &aCol, unsigned char r, unsigned char g, unsigned char b, unsigned char a) |
| Checks if a COLOR4D is close enough to a given RGB char value. | |
| bool | IsImagePixelOfColor (const wxImage &aImage, int aX, int aY, const KIGFX::COLOR4D &aColor) |
| Predicate to check an image pixel matches color and alpha. | |
| bool | ImagesHaveSamePixels (const wxImage &aImgA, const wxImage &aImgB) |
| Check if an image is identical to another image, pixel by pixel. | |
| bool | FieldNameIdMatches (const SCH_FIELD &aField, const std::string &aExpectedName, int aExpectedId) |
| Predicate to check a field name is as expected. | |
| bool | AreDefaultFieldsCorrect (const std::vector< SCH_FIELD > &aFields) |
| Predicate to check that the mandatory fields look sensible. | |
| SEXPR::SEXPR_TYPE | getType (const SEXPR::SEXPR &aSexpr) |
| Get the type of the s-expression. | |
| std::string | getDebugType (SEXPR::SEXPR_TYPE aType) |
| Get a debug-friendly string for a given s-expr type. | |
| std::string | GetSexprDebugType (const SEXPR::SEXPR &aSexpr) |
| bool | IsSexprOfType (const SEXPR::SEXPR &aSexpr, SEXPR::SEXPR_TYPE aType) |
| template<typename VAL_T> | |
| bool | IsSexprValueEqual (const VAL_T &aGot, const VAL_T &aExpected) |
| Predicate to check two s-expr values (of the same type) are equal. | |
| bool | SexprIsSymbol (const SEXPR::SEXPR &aSexpr) |
| Test predicate: is the s-expression a symbol? | |
| bool | SexprIsSymbolWithValue (const SEXPR::SEXPR &aSexpr, const std::string &aVal) |
| Test predicate: is the s-expression a symbol with the given value? | |
| bool | SexprIsString (const SEXPR::SEXPR &aSexpr) |
| Test predicate: is the s-expression a string? | |
| bool | SexprIsStringWithValue (const SEXPR::SEXPR &aSexpr, const std::string &aVal) |
| Test predicate: is the s-expression a string with the given value? | |
| bool | SexprIsInteger (const SEXPR::SEXPR &aSexpr) |
| Test predicate: is the s-expression an integer? | |
| bool | SexprIsIntegerWithValue (const SEXPR::SEXPR &aSexpr, std::int64_t aVal) |
| Test predicate: is the s-expression an integer with the given value? | |
| bool | SexprIsDouble (const SEXPR::SEXPR &aSexpr) |
| Test predicate: is the s-expression a double? | |
| bool | SexprIsDoubleWithValue (const SEXPR::SEXPR &aSexpr, double aVal) |
| Test predicate: is the s-expression a double with the given value? | |
| bool | SexprIsList (const SEXPR::SEXPR &aSexpr) |
| Test predicate: is the s-expression a double? | |
| bool | SexprIsListOfLength (const SEXPR::SEXPR &aSexpr, size_t aExpectedLength) |
| Test predicate: is the s-expression a list with the given length? | |
| bool | SexprConvertsToString (const SEXPR::SEXPR &aSexpr, const std::string &aExpStr) |
| Predicate to check an SEXPR object converts to the expected string. | |
| PCB_SHAPE * | addSegment (BOARD &aBoard, const VECTOR2I &aStart, const VECTOR2I &aEnd) |
| PCB_SHAPE * | addBezier (BOARD &aBoard, const VECTOR2I &aStart, const VECTOR2I &aCtrl1, const VECTOR2I &aCtrl2, const VECTOR2I &aEnd) |
| PCB_SHAPE * | addRect (BOARD &aBoard, const VECTOR2I &aStart, const VECTOR2I &aEnd) |
| PCB_SHAPE * | addPoly (BOARD &aBoard, const std::vector< VECTOR2I > &aPoints) |
| PCB_SHAPE * | addCircle (BOARD &aBoard, const VECTOR2I &aCenter, int aRadius) |
| PCB_SHAPE * | addArc (BOARD &aBoard, const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd) |
| PCB_SHAPE * | addEllipse (BOARD &aBoard, const VECTOR2I &aCenter, int aMajor, int aMinor, const EDA_ANGLE &aRotation) |
| PCB_SHAPE * | addEllipseArc (BOARD &aBoard, const VECTOR2I &aCenter, int aMajor, int aMinor, const EDA_ANGLE &aRotation, const EDA_ANGLE &aStart, const EDA_ANGLE &aEnd) |
| double | ellipseEquationAt (const PCB_SHAPE *aEllipse, const VECTOR2I &aPos) |
| Squared-normalized ellipse equation value at aPos: 1.0 exactly on the outline. | |
| PCB_CONSTRAINT * | addConstraint (BOARD &aBoard, PCB_CONSTRAINT_TYPE aType, const std::vector< CONSTRAINT_MEMBER > &aMembers, std::optional< double > aValue=std::nullopt) |
| void | solveAndApply (BOARD &aBoard, const std::vector< PCB_SHAPE * > &aShapes) |
Build the cluster of aShapes against every constraint on aBoard, solve it, and write the result back – the common adapter-test happy path, which REQUIREs the build and solve to succeed. | |
| bool | IsDrcMarkerOfType (const PCB_MARKER &aMarker, int aErrorCode) |
| Predicate for testing the type of a DRC marker. | |
| void | RunAdditionalBlockTest (const std::string &aBoardName, size_t aBlockOffset, const ALLEGRO::BLOCK_BASE &aBlock) |
| Look up and run any additional ad-hoc tests for a block. | |
| std::string | AllegroBoardDataDir (const std::string &aBoardName) |
| std::string | AllegroBoardFile (const std::string &aFileName) |
Variables | |
| constexpr int | MM = 1000000 |
| using KI_TEST::EXP_OBJ = typename EXP_CONT::value_type |
Definition at line 200 of file unit_test_utils.h.
| using KI_TEST::FOUND_OBJ = typename FOUND_CONT::value_type |
Definition at line 201 of file unit_test_utils.h.
| using KI_TEST::MATCH_PRED = std::function<bool( const EXP_OBJ&, const FOUND_OBJ& )> |
A match predicate: check that a "found" object is equivalent to or represents an "expected" object, perhaps of a different type.
Exactly what "equivalent to" means depends heavily on the context and what is care about. For example, if you only care about a FOOTPRINT's refdes, std::string is sufficient to indicate a "match".
This can be used, for example, for checking a set of results without having to instantiate a full result object for checking by equality.
Definition at line 220 of file unit_test_utils.h.
| enum KI_TEST::RET_CODES |
Return codes for tools.
Definition at line 34 of file utility_program.h.
|
inline |
Definition at line 93 of file constraint_test_utils.h.
References BOARD::Add(), ARC, and PCB_SHAPE::SetArcGeometry().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 50 of file constraint_test_utils.h.
References BOARD::Add(), BEZIER, EDA_SHAPE::RebuildBezierToSegmentsPointsList(), PCB_SHAPE::SetBezierC1(), PCB_SHAPE::SetBezierC2(), PCB_SHAPE::SetEnd(), and PCB_SHAPE::SetStart().
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
Definition at line 83 of file constraint_test_utils.h.
References BOARD::Add(), CIRCLE, and circle().
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(), 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(), 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(), 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().
|
inline |
Definition at line 145 of file constraint_test_utils.h.
References BOARD::Add(), PCB_CONSTRAINT::AddMember(), and PCB_CONSTRAINT::SetValue().
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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 103 of file constraint_test_utils.h.
References BOARD::Add(), ELLIPSE, PCB_SHAPE::SetEllipseCenter(), PCB_SHAPE::SetEllipseMajorRadius(), PCB_SHAPE::SetEllipseMinorRadius(), and PCB_SHAPE::SetEllipseRotation().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 116 of file constraint_test_utils.h.
References BOARD::Add(), ELLIPSE_ARC, PCB_SHAPE::SetEllipseCenter(), PCB_SHAPE::SetEllipseEndAngle(), PCB_SHAPE::SetEllipseMajorRadius(), PCB_SHAPE::SetEllipseMinorRadius(), PCB_SHAPE::SetEllipseRotation(), and PCB_SHAPE::SetEllipseStartAngle().
Referenced by BOOST_AUTO_TEST_CASE().
Definition at line 74 of file constraint_test_utils.h.
References BOARD::Add(), POLY, and EDA_SHAPE::SetPolyPoints().
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(), 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().
|
inline |
Definition at line 64 of file constraint_test_utils.h.
References BOARD::Add(), RECTANGLE, PCB_SHAPE::SetEnd(), and PCB_SHAPE::SetStart().
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(), 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(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 40 of file constraint_test_utils.h.
References BOARD::Add(), SEGMENT, PCB_SHAPE::SetEnd(), and PCB_SHAPE::SetStart().
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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
| std::string KI_TEST::AllegroBoardDataDir | ( | const std::string & | aBoardName | ) |
Definition at line 41 of file allegro_test_utils.cpp.
References getBoardsDataDir().
Referenced by buildAllegroBoardSuites(), buildTestRegistry(), ALLEGRO_COMPREHENSIVE_FIXTURE::GetAllBoardFiles(), getBoardsWithAlg(), ALLEGRO_BLOCK_TEST_FIXTURE::RunBlockTest(), RunBoardLoad(), and ALLEGRO_BLOCK_TEST_FIXTURE::RunHeaderTest().
| std::string KI_TEST::AllegroBoardFile | ( | const std::string & | aFileName | ) |
Definition at line 52 of file allegro_test_utils.cpp.
References getBoardsDataDir().
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(), 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 ALLEGRO_IMPORT_FIXTURE::LoadAllegroBoard().
| bool KI_TEST::AreDefaultFieldsCorrect | ( | const std::vector< SCH_FIELD > & | aFields | ) |
Predicate to check that the mandatory fields look sensible.
Definition at line 82 of file lib_field_test_utils.h.
References BOOST_TEST_INFO(), DATASHEET, FieldNameIdMatches(), FOOTPRINT, REFERENCE, and VALUE.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
| SHAPE_POLY_SET KI_TEST::BuildHollowSquare | ( | int | aOuterSize, |
| int | aInnerSize, | ||
| const VECTOR2I & | aCentre = { 0, 0 } ) |
Build a SHAPE_POLY_SET in the shape of a square outline, with a square hole, both centred at the given point.
| aOuterSize | the size (x and y) of the outer square |
| aInnerSize | the size (x and y) of the hole |
| aCentre | the centre point of both squares (default: origin) |
Definition at line 40 of file poly_set_construction.cpp.
References SHAPE_POLY_SET::AddHole(), SHAPE_POLY_SET::AddOutline(), and BuildRectChain().
Build a horizontal segment from a point with a length.
| aStart | the starting point |
| aLength | the segment length |
Definition at line 25 of file seg_construction.cpp.
References VECTOR2< T >::x, and VECTOR2< T >::y.
| SHAPE_POLY_SET KI_TEST::BuildPolyset | ( | const std::vector< SHAPE_LINE_CHAIN > & | aOutlines | ) |
Construct a SHAPE_POLY_SET from a list of points for each of outlines (no holes)
Definition at line 27 of file poly_set_construction.cpp.
References SHAPE_POLY_SET::AddOutline().
| SHAPE_LINE_CHAIN KI_TEST::BuildRectChain | ( | const VECTOR2I & | aSize, |
| const VECTOR2I & | aCentre = { 0, 0 } ) |
Builds a rectangular SHAPE_LINE_CHAIN of a certain size at a certain centre.
| aSize | the rectangle size |
| aCentre | centre of the rectangle |
Definition at line 25 of file line_chain_construction.cpp.
References chain, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BuildHollowSquare(), and BuildSquareChain().
| SHAPE_LINE_CHAIN KI_TEST::BuildSquareChain | ( | int | aSize, |
| const VECTOR2I & | aCentre = { 0, 0 } ) |
Builds a square SHAPE_LINE_CHAIN of a certain size at a certain centre.
| aSize | the square size (x == y) |
| aCentre | centre of the square |
Definition at line 40 of file line_chain_construction.cpp.
References BuildRectChain().
Referenced by TestSquareFillet().
Build a vertical segment from a point with a length.
| aStart | the starting point |
| aLength | the segment length |
Definition at line 30 of file seg_construction.cpp.
References VECTOR2< T >::x, and VECTOR2< T >::y.
| bool KI_TEST::CanDoDisplayTests | ( | ) |
Some tests on some platforms require a display connection to run.
This function checks if a display is available on those platforms (GTK).
On platforms where this doesn't matter, this always returns true.
Definition at line 145 of file unit_test_utils.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
| bool KI_TEST::ChainsAreCyclicallyEqual | ( | const SHAPE_LINE_CHAIN & | aChainA, |
| const SHAPE_LINE_CHAIN & | aChainB, | ||
| int | aTol ) |
Check that two chains are cyclically equal.
I.e. [A, B, C] and [B, C, A] are the same.
Definition at line 40 of file geometry.cpp.
References SHAPE_LINE_CHAIN::CompareGeometry().
Referenced by BOOST_AUTO_TEST_CASE(), and CourtyardEqualPredicate().
Helper method to check if two footprints are semantically the same.
Definition at line 368 of file board_test_utils.cpp.
References BOOST_CHECK_EQUAL(), CHECK_ENUM_CLASS_EQUAL, CheckFpPad(), CheckFpShape(), CheckFpText(), CheckFpZone(), BOARD_ITEM::DRC, expected, FOOTPRINT::GetAttributes(), FOOTPRINT::GetFields(), FOOTPRINT::GetFlag(), FOOTPRINT::GetKeywords(), FOOTPRINT::GetLibDescription(), FOOTPRINT::GetOrientation(), FOOTPRINT::GetPosition(), FOOTPRINT::GetReference(), FOOTPRINT::GetTypeName(), FOOTPRINT::GetValue(), FOOTPRINT::GraphicalItems(), FOOTPRINT::Groups(), FOOTPRINT::Models(), FOOTPRINT::Pads(), PCB_BARCODE_T, PCB_DIM_ALIGNED_T, PCB_DIM_CENTER_T, PCB_DIM_LEADER_T, PCB_DIM_ORTHOGONAL_T, PCB_DIM_RADIAL_T, PCB_POINT_T, PCB_SHAPE_T, PCB_TEXT_T, reporter, text, EDA_ITEM::Type(), and FOOTPRINT::Zones().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_DATA_TEST_CASE().
Definition at line 477 of file board_test_utils.cpp.
References BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), CHECK_ENUM_CLASS_EQUAL, CheckFpShape(), expected, pad, and PADSTACK::TEMP_ALL_LAYERS.
Referenced by CheckFootprint().
Definition at line 585 of file board_test_utils.cpp.
References ARC, BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), CHECK_ENUM_CLASS_EQUAL, CheckShapePolySet(), expected, EDA_SHAPE::GetArcMid(), EDA_SHAPE::GetBezierC1(), EDA_SHAPE::GetBezierC2(), PCB_SHAPE::GetCenter(), EDA_SHAPE::GetEnd(), EDA_SHAPE::GetFillMode(), PCB_SHAPE::GetLayerSet(), STROKE_PARAMS::GetLineStyle(), EDA_SHAPE::GetPolyShape(), PCB_SHAPE::GetPosition(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetStart(), PCB_SHAPE::GetStroke(), STROKE_PARAMS::GetWidth(), BOARD_ITEM::IsLocked(), POLY, and EDA_ITEM::Type().
Referenced by CheckFootprint(), and CheckFpPad().
Definition at line 554 of file board_test_utils.cpp.
References BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), CHECK_ENUM_CLASS_EQUAL, expected, and text.
Referenced by CheckFootprint().
Definition at line 630 of file board_test_utils.cpp.
References BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), CHECK_ENUM_CLASS_EQUAL, CheckShapePolySet(), expected, ZONE::GetAssignedPriority(), ZONE::GetCornerRadius(), ZONE::GetCornerSmoothingType(), ZONE::GetDoNotAllowFootprints(), ZONE::GetDoNotAllowPads(), ZONE::GetDoNotAllowTracks(), ZONE::GetDoNotAllowVias(), ZONE::GetDoNotAllowZoneFills(), ZONE::GetFillMode(), ZONE::GetHatchBorderAlgorithm(), ZONE::GetHatchGap(), ZONE::GetHatchHoleMinArea(), ZONE::GetHatchOrientation(), ZONE::GetHatchSmoothingLevel(), ZONE::GetHatchSmoothingValue(), ZONE::GetHatchThickness(), ZONE::GetIslandRemovalMode(), ZONE::GetIsRuleArea(), ZONE::GetLayerSet(), ZONE::GetLocalClearance(), ZONE::GetMinIslandArea(), ZONE::GetMinThickness(), BOARD_CONNECTED_ITEM::GetNetCode(), ZONE::GetPadConnection(), ZONE::GetTeardropAreaType(), ZONE::GetThermalReliefGap(), ZONE::GetThermalReliefSpokeWidth(), ZONE::GetZoneName(), ZONE::IsFilled(), BOARD_ITEM::IsLocked(), ZONE::Outline(), and EDA_ITEM::Type().
Referenced by CheckFootprint().
| void KI_TEST::CheckShapePolySet | ( | const SHAPE_POLY_SET * | expected, |
| const SHAPE_POLY_SET * | polyset ) |
Definition at line 681 of file board_test_utils.cpp.
References SHAPE_LINE_CHAIN::ArcCount(), BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), expected, SHAPE_LINE_CHAIN::GetPoint(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), SHAPE_LINE_CHAIN::PointCount(), and SHAPE_POLY_SET::TotalVertices().
Referenced by CheckFpShape(), and CheckFpZone().
| void KI_TEST::CheckUnorderedMatches | ( | const EXP_CONT & | aExpected, |
| const FOUND_CONT & | aFound, | ||
| MATCH_PRED | aMatchPredicate ) |
Check that a container of "found" objects matches a container of "expected" objects.
This means that:
This is a very generic function: all you need are two containers of any type and a function to check if a given "found" object corresponds to a given "expected object". Conditions:
operator<< (for logging)Not needed:
This is a slightly more complex way of doing it that, say, sorting both lists and checking element-by-element matches. However, it can tell you exactly which objects are problematic, as well as a simple go/no-go.
When you have two containers of identical types (or you have a suitable operator==) and ordering is important, you can use BOOST_CHECK_EQUAL_COLLECTIONS
| aExpected | a container of "expected" items, usually from a test case |
| aMatched | a container of "found" items, usually the result of some routine under test |
| aMatchPredicate | a predicate that determines if a given "found" object matches a given "expected" object. |
Definition at line 257 of file unit_test_utils.h.
References expected.
Referenced by BOOST_AUTO_TEST_CASE(), CheckCollisionsMatchExpected(), and CheckInvalidsMatchExpected().
Predicate to check a collection has no duplicate elements.
Definition at line 303 of file unit_test_utils.h.
References T.
Referenced by BOOST_AUTO_TEST_CASE().
| void KI_TEST::DrawArc | ( | FOOTPRINT & | aFootprint, |
| const VECTOR2I & | aCentre, | ||
| const VECTOR2I & | aStart, | ||
| const EDA_ANGLE & | aAngle, | ||
| int | aWidth, | ||
| PCB_LAYER_ID | aLayer ) |
Draw an arc on a footprint.
| aMod | The footprint to add the segment to |
| aCentre | The arc centre |
| aStart | The arc start point |
| aAngle | The arc angle |
| aWidth | The width of the arc segment |
| aLayer | The layer to draw on |
Definition at line 58 of file board_construction_utils.cpp.
References FOOTPRINT::Add(), ARC, FOOTPRINT::GetOrientation(), FOOTPRINT::GetPosition(), and SOLID.
Referenced by DrawRect().
| void KI_TEST::DrawPolyline | ( | FOOTPRINT & | aFootprint, |
| const std::vector< VECTOR2I > & | aPts, | ||
| int | aWidth, | ||
| PCB_LAYER_ID | aLayer ) |
Draw a polyline - a set of linked segments.
| aMod | The footprint to add the segment to |
| aPts | The polyline points |
| aWidth | The width of the segments |
| aLayer | The layer to draw on |
Definition at line 48 of file board_construction_utils.cpp.
References DrawSegment().
| void KI_TEST::DrawRect | ( | FOOTPRINT & | aFootprint, |
| const VECTOR2I & | aPos, | ||
| const VECTOR2I & | aSize, | ||
| int | aRadius, | ||
| int | aWidth, | ||
| PCB_LAYER_ID | aLayer ) |
Draw a rectangle on a footprint.
| aMod | The footprint to add the rectangle to |
| aPos | Rectangle centre point |
| aSize | Rectangle size (x, y) |
| aRadius | Corner radius (0 for a normal rect) |
| aWidth | Line width |
| aLayer | Layer to draw on |
Definition at line 77 of file board_construction_utils.cpp.
References ANGLE_90, DrawArc(), DrawSegment(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BOOST_AUTO_TEST_CASE().
| void KI_TEST::DrawSegment | ( | FOOTPRINT & | aFootprint, |
| const SEG & | aSeg, | ||
| int | aWidth, | ||
| PCB_LAYER_ID | aLayer ) |
Draw a segment in the given footprint.
| aMod | The footprint to add the segment to |
| aSeg | The segment geometry |
| aWidth | The width of the segment |
| aLayer | The layer to draw on |
Definition at line 31 of file board_construction_utils.cpp.
References SEG::A, FOOTPRINT::Add(), SEG::B, FOOTPRINT::GetOrientation(), FOOTPRINT::GetPosition(), SEGMENT, and SOLID.
Referenced by DrawPolyline(), and DrawRect().
| void KI_TEST::DumpBoardToFile | ( | BOARD & | aBoard, |
| const std::filesystem::path & | aFilename ) |
Utility function to simply write a Board out to a file.
Helps debug tests and utility programs by making it easy to quickly write to disk without directly using the PCB_IO_KICAD_SEXPR API.
Note: The aBoard param is non-const because PCB_IO_KICAD_SEXPR::Save demands it and I am not confident a const_cast will be a true assurance.
| aBoard | the board to write out |
| aFilename | the filename to write to |
Definition at line 61 of file board_file_utils.cpp.
References PCB_IO_KICAD_SEXPR::SaveBoard().
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(), 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(), 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(), 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(), 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(), 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(), BOOST_DATA_TEST_CASE_F(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), KI_TEST::BOARD_DUMPER::DumpBoardToFile(), LoadAndTestBoardFile(), SaveBoardToString(), and testSaveLoad().
| void KI_TEST::DumpFootprintToFile | ( | const FOOTPRINT & | aFootprint, |
| const std::filesystem::path & | aLibraryPath ) |
Same as DumpBoardToFile, but for footprints.
Definition at line 144 of file board_file_utils.cpp.
References PCB_IO_KICAD_SEXPR::FootprintSave().
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(), and LoadAndTestFootprintFile().
| void KI_TEST::DumpSchematicToFile | ( | SCHEMATIC & | aSchematic, |
| SCH_SHEET & | aSheet, | ||
| const std::string & | aFilename ) |
Definition at line 44 of file schematic_file_util.cpp.
References SCH_IO_KICAD_SEXPR::SaveSchematicFile().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().
Squared-normalized ellipse equation value at aPos: 1.0 exactly on the outline.
Definition at line 132 of file constraint_test_utils.h.
References EDA_ANGLE::AsRadians(), EDA_SHAPE::GetEllipseCenter(), EDA_SHAPE::GetEllipseMajorRadius(), EDA_SHAPE::GetEllipseMinorRadius(), EDA_SHAPE::GetEllipseRotation(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
| bool KI_TEST::FieldNameIdMatches | ( | const SCH_FIELD & | aField, |
| const std::string & | aExpectedName, | ||
| int | aExpectedId ) |
Predicate to check a field name is as expected.
| aField | SCH_FIELD to check the name |
| aExpectedName | the expected field name |
| aExpectedId | the expected field id |
Definition at line 57 of file lib_field_test_utils.h.
References BOOST_TEST_INFO(), SCH_FIELD::GetId(), and SCH_FIELD::GetUntranslatedName().
Referenced by AreDefaultFieldsCorrect(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
| void KI_TEST::FillZones | ( | BOARD * | m_board | ) |
Definition at line 304 of file board_test_utils.cpp.
References _, BOARD::BuildConnectivity(), ZONE_FILLER::Fill(), BOARD_COMMIT::Push(), TOOL_MANAGER::RegisterTool(), TOOL_MANAGER::SetEnvironment(), SKIP_CONNECTIVITY, SKIP_SET_DIRTY, SKIP_UNDO, ZONE_FILL_OP, and BOARD::Zones().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_DATA_TEST_CASE(), BOOST_DATA_TEST_CASE(), BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BACKDRILL_TEST_FIXTURE::FillZones(), STITCH_SYNTHETIC_FIXTURE::finishSetup(), and STITCH_BOARD_FIXTURE::loadBoard().
| const wxXmlNode * KI_TEST::FindFirstRect | ( | const wxXmlNode & | aNode | ) |
Find the first <rect> element in the given XML node's descendants.
Returns nullptr if no <rect> element is found.
Definition at line 88 of file svg_test_utils.cpp.
References FindFirstRect().
Referenced by FindFirstRect().
|
inline |
Get a debug-friendly string for a given s-expr type.
Definition at line 53 of file sexpr_test_utils.h.
References SEXPR::SEXPR_TYPE_ATOM_DOUBLE, SEXPR::SEXPR_TYPE_ATOM_INTEGER, SEXPR::SEXPR_TYPE_ATOM_STRING, SEXPR::SEXPR_TYPE_ATOM_SYMBOL, and SEXPR::SEXPR_TYPE_LIST.
Referenced by GetSexprDebugType(), and IsSexprOfType().
| std::string KI_TEST::GetEeschemaTestDataDir | ( | ) |
Get the configured location of Eeschema test data.
By default, this is the test data in the source tree, but can be overridden by the KICAD_TEST_EESCHEMA_DATA_DIR environment variable.
Definition at line 38 of file unit_test_utils.cpp.
References GetTestDataRootDir().
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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), ORCAD_SCH_IMPORT_FIXTURE::dataPath(), getCadstarTestFile(), getEagleTestSchematic(), getFixturePath(), TEST_SIM_LIBRARY_SPICE_FIXTURE::GetLibraryPath(), DIPTRACE_SCH_IMPORT_FIXTURE::GetTestDataDir(), PCAD_SCH_IMPORT_FIXTURE::GetTestDataDir(), ARC_CONNECTION_FIXTURE::GetTestFile(), httpLibSettingsPath(), ISSUE21821_FIXTURE::ISSUE21821_FIXTURE(), ISSUE23403_FIXTURE::ISSUE23403_FIXTURE(), ISSUE25112_FIXTURE::ISSUE25112_FIXTURE(), ISSUE25469_FIXTURE::ISSUE25469_FIXTURE(), loadDeMorganSymbol(), GEDA_SCH_IMPORT_FIXTURE::LoadGedaSchematic(), GEDA_SCH_IMPORT_FIXTURE::LoadGedaSchematicWithProperties(), loadQuadBuffer(), LoadSchematic(), TEST_VARIANT_FIELD_RESOLUTION_FIXTURE::LoadTestSchematic(), SAVEAS_SUBSHEET_FIXTURE::SAVEAS_SUBSHEET_FIXTURE(), KI_TEST::SCHEMATIC_TEST_FIXTURE::SchematicQAPath(), TEST_NETLIST_EXPORTER_SPICE_FIXTURE::SchematicQAPath(), TEST_SCH_GROUP_FIXTURE::SchematicQAPath(), TEST_SCH_SCREEN_FIXTURE::SchematicQAPath(), TEST_SCH_SHEET_LIST_FIXTURE::SchematicQAPath(), TEST_SCHEMATIC_FIXTURE::SchematicQAPath(), and TEST_SIM_REGRESSIONS_FIXTURE::SchematicQAPath().
| std::string KI_TEST::GetPcbnewTestDataDir | ( | ) |
Utility which returns a path to the data directory where the test board files are stored.
Definition at line 38 of file board_file_utils.cpp.
References QA_PCBNEW_DATA_LOCATION.
Referenced by BOARD_LOADER_TEST_FIXTURE::boardPath(), DRC_ISSUE_23868_FIXTURE::boardPath(), DRC_ISSUE_24211_FIXTURE::boardPath(), HEADLESS_PCB_CONTEXT_TEST_FIXTURE::boardPath(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), BOOST_DATA_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), checkAllCopperFillZonesHaveClearance(), checkImportedOriginOffset(), TEMP_KITCHEN_SINK_COPY::Create(), createTestCases(), DoCourtyardInvalidTest(), DoCourtyardOverlapTest(), GetAscPath(), GetBinaryPath(), GetBoardPath(), getBoardsDataDir(), getEasyEdaProV3FootprintLibPath(), getFixturePath(), DIPTRACE_CROSS_LINK_FIXTURE::GetPcbTestDataDir(), DIPTRACE_BENCHMARK_FIXTURE::GetTestDataDir(), DIPTRACE_PCB_IMPORT_FIXTURE::GetTestDataDir(), IPC2581_EXPORT_FIXTURE::GetXsdPath(), LoadAndTestBoardFile(), LoadAndTestFootprintFile(), IPC2581_EXPORT_FIXTURE::LoadBoard(), LoadBoard(), EAGLE_BINARY_IMPORT_FIXTURE::loadBoard(), VIA_STACK_DRC_FIXTURE::loadBoard(), BOARD_LOADER_TEST_FIXTURE::loadProject(), DRC_ISSUE_23868_FIXTURE::loadProject(), DRC_ISSUE_24211_FIXTURE::loadProject(), HEADLESS_PCB_CONTEXT_TEST_FIXTURE::loadProject(), AUTOTRAX_IMPORT_FIXTURE::path(), DRC_BASE_FIXTURE::saveBoardAndProjectToTempFiles(), and KI_TEST::STALE_DRU_SIDECAR_FIXTURE::scan().
|
inline |
Definition at line 72 of file sexpr_test_utils.h.
References getDebugType(), and getType().
Referenced by SEXPR::boost_test_print_type().
| std::string KI_TEST::GetTestDataRootDir | ( | ) |
Definition at line 67 of file unit_test_utils.cpp.
References QA_DATA_ROOT.
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(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), TEST_SYMBOL_LIBRARY_FIXTURE::EnsureGlobalSymbolDir(), getEasyEdaProV3ArchivePath(), getEasyEdaProV3FootprintLibPath(), getEasyEdaProV3SymbolLibPath(), getEasyEdaProV3SymbolLibPath(), GetEeschemaTestDataDir(), GetGerbviewTestDataDir(), GetTestGlbPath(), TEST_SYMBOL_LIBRARY_FIXTURE::GetTestProjectSchPath(), JOB_EXPORT_PCB_3D_TEST_FIXTURE::JOB_EXPORT_PCB_3D_TEST_FIXTURE(), SetMockConfigDir(), and TEST_SYMBOL_IMPORT_MANAGER_FIXTURE::TEST_SYMBOL_IMPORT_MANAGER_FIXTURE().
|
inline |
Get the type of the s-expression.
Definition at line 34 of file sexpr_test_utils.h.
References SEXPR::SEXPR::IsDouble(), SEXPR::SEXPR::IsInteger(), SEXPR::SEXPR::IsList(), SEXPR::SEXPR::IsString(), SEXPR::SEXPR::IsSymbol(), SEXPR::SEXPR_TYPE_ATOM_DOUBLE, SEXPR::SEXPR_TYPE_ATOM_INTEGER, SEXPR::SEXPR_TYPE_ATOM_STRING, SEXPR::SEXPR_TYPE_ATOM_SYMBOL, and SEXPR::SEXPR_TYPE_LIST.
Referenced by GetSexprDebugType(), and IsSexprOfType().
| bool KI_TEST::ImagesHaveSamePixels | ( | const wxImage & | aImgA, |
| const wxImage & | aImgB ) |
Check if an image is identical to another image, pixel by pixel.
(this is exhaustive, avoid using it for large images)
Definition at line 56 of file wximage_test_utils.cpp.
References BOOST_TEST_INFO().
Referenced by BOOST_AUTO_TEST_CASE().
| bool KI_TEST::IsBoxWithinTol | ( | const BOX & | aBox, |
| const BOX & | aExp, | ||
| typename BOX::coord_type | aTol ) |
Check that a box is close enough to another box.
Definition at line 61 of file geometry.h.
References IsVecWithinTol().
Referenced by CheckArcGeom().
|
inline |
Checks if a COLOR4D is close enough to another.
Definition at line 37 of file color4d_test_utils.h.
References KIGFX::COLOR4D::a, KIGFX::COLOR4D::b, KIGFX::COLOR4D::g, IsWithin(), and KIGFX::COLOR4D::r.
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Checks if a COLOR4D is close enough to a given RGB char value.
Definition at line 48 of file color4d_test_utils.h.
References KIGFX::COLOR4D::a, KIGFX::COLOR4D::b, KIGFX::COLOR4D::g, IsWithin(), and KIGFX::COLOR4D::r.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and IsImagePixelOfColor().
| bool KI_TEST::IsDrcMarkerOfType | ( | const PCB_MARKER & | aMarker, |
| int | aErrorCode ) |
Predicate for testing the type of a DRC marker.
| aMarker | the marker to test |
| aErrorCode | the expected DRC violation code |
Definition at line 37 of file drc_test_utils.cpp.
References RC_ITEM::GetErrorCode(), and MARKER_BASE::GetRCItem().
Referenced by CheckCollisionsMatchExpected().
| bool KI_TEST::IsImagePixelOfColor | ( | const wxImage & | aImage, |
| int | aX, | ||
| int | aY, | ||
| const KIGFX::COLOR4D & | aColor ) |
Predicate to check an image pixel matches color and alpha.
| aImage | the image to check |
| aX | pixel x-coordinate |
| aY | pixel y-coordinate |
| aColor | expected color (alpha is 1.0 if image doesn't support alpha) |
Definition at line 28 of file wximage_test_utils.cpp.
References BOOST_TEST_INFO(), and IsColorNearHex().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 77 of file sexpr_test_utils.h.
References BOOST_TEST_MESSAGE(), getDebugType(), and getType().
Referenced by SexprIsDouble(), SexprIsDoubleWithValue(), SexprIsInteger(), SexprIsIntegerWithValue(), SexprIsList(), SexprIsListOfLength(), SexprIsString(), SexprIsStringWithValue(), SexprIsSymbol(), and SexprIsSymbolWithValue().
| bool KI_TEST::IsSexprValueEqual | ( | const VAL_T & | aGot, |
| const VAL_T & | aExpected ) |
Predicate to check two s-expr values (of the same type) are equal.
Definition at line 94 of file sexpr_test_utils.h.
References BOOST_TEST_MESSAGE().
Referenced by SexprIsDoubleWithValue(), SexprIsIntegerWithValue(), SexprIsStringWithValue(), and SexprIsSymbolWithValue().
| bool KI_TEST::IsUUID | ( | const std::string & | aStr | ) |
Check if the string between the iterators looks like a UUID.
Definition at line 26 of file uuid_test_utils.cpp.
Referenced by IsUUIDPathWithLevels().
| bool KI_TEST::IsUUIDPathWithLevels | ( | const std::string & | aStr, |
| unsigned | aLevels ) |
Predicate to check a string is a UUID path format.
Eg. levels=2: /1d33ca6f-67e8-41ae-a0aa-49d857ab38d5/1d33ca6f-67e8-41ae-a0aa-49d857ab38d5/
| aStr | candidate string |
| levels | expected levels |
Definition at line 35 of file uuid_test_utils.cpp.
References BOOST_TEST_INFO(), and IsUUID().
Referenced by BOOST_AUTO_TEST_CASE().
| bool KI_TEST::IsVecWithinTol | ( | const VEC & | aVec, |
| const VEC & | aExp, | ||
| typename VEC::coord_type | aTol ) |
Check that both x and y of a vector are within expected error.
Definition at line 51 of file geometry.h.
References IsWithin().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), CheckArcGeom(), IsBoxWithinTol(), and TransformIsClose().
Check if a value is within a tolerance of a nominal value.
Definition at line 57 of file numeric.h.
References T.
Referenced by GEOM_TEST::ArePerpendicular(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), CheckArcGeom(), IsColorNear(), IsColorNearHex(), GEOM_TEST::IsPointAtDistance(), IsVecWithinTol(), and TransformIsClose().
value is in range [aNominal, aNominal + aErrorAbove]
Definition at line 84 of file numeric.h.
References IsWithinBounds(), and T.
value is in range [aNominal - aErrorBelow, aNominal]
Definition at line 76 of file numeric.h.
References IsWithinBounds(), and T.
Referenced by TestFilletSegmentConstraints().
| bool KI_TEST::IsWithinBounds | ( | T | aValue, |
| T | aNominal, | ||
| T | aErrorAbove, | ||
| T | aErrorBelow ) |
Check if a value is within a tolerance of a nominal value, with different allowances for errors above and below.
Definition at line 68 of file numeric.h.
References T.
Referenced by IsWithinAndAbove(), and IsWithinAndBelow().
Check if a value is within a tolerance of a nominal value, wrapping to a given val.
Definition at line 39 of file numeric.h.
References std::abs(), and T.
Referenced by BOOST_AUTO_TEST_CASE(), and CheckArcGeom().
| void KI_TEST::LoadAndTestBoardFile | ( | const wxString | aRelativePath, |
| bool | aRoundtrip, | ||
| std::function< void(BOARD &)> | aBoardTestFunction, | ||
| std::optional< int > | aExpectedBoardVersion = std::nullopt ) |
Perform "some test" on a board file loaded from the path, then optionally save and reload and run the test again.
The roundtrip is useful to test stability of serialisation/reload.
| aRelativePath | relative path of file to load |
| aRoundtrip | true to save, reload and re-test |
| aBoardTestFunction | the function that runs tests on the board |
| aExpectedBoardVersion | the expected board version, or nullopt to not check |
Definition at line 208 of file board_test_utils.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), DumpBoardToFile(), GetPcbnewTestDataDir(), KI_TEST::SCOPED_TEMP_DIR::Path(), and ReadBoardFromFileOrStream().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_DATA_TEST_CASE(), BOOST_DATA_TEST_CASE(), BOOST_DATA_TEST_CASE(), BOOST_DATA_TEST_CASE(), BOOST_DATA_TEST_CASE_F(), and BOOST_FIXTURE_TEST_CASE().
| void KI_TEST::LoadAndTestFootprintFile | ( | const wxString & | aLibRelativePath, |
| const wxString & | aFpName, | ||
| bool | aRoundtrip, | ||
| std::function< void(FOOTPRINT &)> | aFootprintTestFunction, | ||
| std::optional< int > | aExpectedFootprintVersion ) |
Same as LoadAndTestBoardFile, but for footprints.
Use a temporary directory, so that if something goes wrong and the file isn't written properly, we don't leave a library behind that will cause exceptions when the cache is set up on future runs.
Definition at line 249 of file board_test_utils.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), KI_TEST::SCOPED_TEMP_DIR::CreateChildDir(), DumpFootprintToFile(), GetPcbnewTestDataDir(), and ReadFootprintFromFileOrStream().
Referenced by BOOST_DATA_TEST_CASE().
| std::vector< uint8_t > KI_TEST::LoadBinaryData | ( | const std::string & | aFilePath, |
| std::optional< size_t > | aLoadBytes = std::nullopt ) |
Load the contents of a file into a vector of bytes.
If this fails, it throws a std::runtime_error with a descriptive message.
| aFilePath | the path to the file to load |
| aLoadBytes | the number of bytes to load, or all bytes if not specified |
Definition at line 91 of file unit_test_utils.cpp.
Referenced by loadDataByUri(), and LoadStringData().
| void KI_TEST::LoadBoard | ( | SETTINGS_MANAGER & | aSettingsManager, |
| const wxString & | aRelPath, | ||
| std::unique_ptr< BOARD > & | aBoard ) |
Definition at line 90 of file board_test_utils.cpp.
References BOOST_TEST_MESSAGE(), dummy, GetPcbnewTestDataDir(), SETTINGS_MANAGER::LoadProject(), SETTINGS_MANAGER::Prj(), ReadBoardFromFileOrStream(), and IO_ERROR::What().
Referenced by APPLIER_HELPERS_FIXTURE::APPLIER_HELPERS_FIXTURE(), 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(), BOOST_DATA_TEST_CASE(), BOOST_DATA_TEST_CASE(), BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), checkParity(), CROSS_PROBE_SELECTION_FIXTURE::CROSS_PROBE_SELECTION_FIXTURE(), CUSTOM_DRC_DIFF_MERGE_FIXTURE::CUSTOM_DRC_DIFF_MERGE_FIXTURE(), IMPORT_NET_NAMES_FIXTURE::IMPORT_NET_NAMES_FIXTURE(), LIB_TABLE_DIFF_MERGE_FIXTURE::LIB_TABLE_DIFF_MERGE_FIXTURE(), STITCH_BOARD_FIXTURE::loadBoard(), DRC_BASE_FIXTURE::loadBoardAndVerifyInitialExclusions(), TUNING_PATTERN_LAYER_FIXTURE::LoadPattern(), NET_CLASSES_DIFF_MERGE_FIXTURE::NET_CLASSES_DIFF_MERGE_FIXTURE(), PCB_APPLIER_FIXTURE::PCB_APPLIER_FIXTURE(), PCB_DIFFER_FIXTURE::PCB_DIFFER_FIXTURE(), DRC_BASE_FIXTURE::reloadBoardAndVerifyExclusions(), DRC_CREEPAGE_ISSUE24875_FIXTURE::runCreepage(), DRC_CREEPAGE_ISSUE24885_FIXTURE::runCreepage(), DRC_CREEPAGE_ISSUE25439_FIXTURE::runCreepage(), and runLineEndingMatrixDrcTest().
| std::unique_ptr< BOARD > KI_TEST::LoadBoardWithCapture | ( | PCB_IO & | aIoPlugin, |
| const std::string & | aFilePath, | ||
| REPORTER * | aReporter ) |
Attempt to load an board with a given IO plugin, capturing all reporter messages.
Returns the board (or nullptr on failure) and populates the reporter.
Definition at line 822 of file board_test_utils.cpp.
References PCB_IO::LoadBoard(), REPORTER::Report(), RPT_SEVERITY_ERROR, IO_BASE::SetReporter(), IO_ERROR::What(), and IO_ERROR::what().
Referenced by KI_TEST::CACHED_BOARD_LOADER::getCachedBoard().
| std::unique_ptr< SCHEMATIC > KI_TEST::LoadHierarchyFromRoot | ( | const std::string & | rootFilename, |
| PROJECT * | project ) |
Definition at line 50 of file schematic_file_util.cpp.
References SCH_IO_KICAD_SEXPR::GetError(), SCH_IO_KICAD_SEXPR::LoadSchematicFile(), and project.
Referenced by LoadSchematic().
| void KI_TEST::LoadSchematic | ( | SETTINGS_MANAGER & | aSettingsManager, |
| const wxString & | aRelPath, | ||
| std::unique_ptr< SCHEMATIC > & | aSchematic ) |
Definition at line 117 of file schematic_file_util.cpp.
References SCH_SHEET_LIST::AnnotatePowerSymbols(), SCH_SCREENS::FixLegacyPowerSymbolMismatches(), GetEeschemaTestDataDir(), SCH_SCREENS::GetFirst(), SCH_SCREENS::GetNext(), PROJECT::LEGACY_SYMBOL_LIBS, LoadHierarchyFromRoot(), SETTINGS_MANAGER::LoadProject(), path, SETTINGS_MANAGER::Prj(), PROJECT::SetElem(), SETTINGS_MANAGER::UnloadProject(), SCH_RULE_AREA::UpdateRuleAreasInScreens(), SCH_SHEET_LIST::UpdateSheetInstanceData(), and SCH_SHEET_LIST::UpdateSymbolInstanceData().
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(), 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(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), loadFixture(), ISSUE22864_FIXTURE::LoadSchematic(), SCH_APPLIER_FIXTURE::SCH_APPLIER_FIXTURE(), SCH_DIFFER_FIXTURE::SCH_DIFFER_FIXTURE(), and TEST_NETLIST_EXPORTER_FIXTURE< Exporter >::TestNetlist().
| std::string KI_TEST::LoadStringData | ( | const wxString & | aPath | ) |
Load the contents of a file into a string.
The file is read in binary mode, so the string is byte-exact. This is a thin wrapper around KI_TEST::LoadBinaryData(), so it fails in the same way.
No assumptions are made about the encoding of the file: it is up to the caller to interpret the string as appropriate.
| aPath | the path to the file to load |
Definition at line 118 of file unit_test_utils.cpp.
References LoadBinaryData().
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(), 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(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().
| tl::expected< wxXmlDocument, wxString > KI_TEST::LoadSvg | ( | const wxString & | aSvg | ) |
Definition at line 30 of file svg_test_utils.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
| tl::expected< KI_TEST::SVG_VIEWBOX, wxString > KI_TEST::ParseViewBox | ( | const wxXmlNode & | aRoot | ) |
Parse the four numbers of the SVG viewBox attribute (min-x, min-y, width, height).
Returns an error if the attribute is missing or cannot be parsed.
Definition at line 46 of file svg_test_utils.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
| void KI_TEST::PrintBoardStats | ( | const BOARD * | aBoard, |
| const std::string & | aBoardName ) |
Print detailed board statistics for debugging using test-framework logging.
Definition at line 719 of file board_test_utils.cpp.
References BOOST_TEST_MESSAGE(), BOARD::Footprints(), BOARD::GetCopperLayerCount(), BOARD::GetNetCount(), pad, PCB_ARC_T, PCB_TRACE_T, PCB_VIA_T, SMD, BOARD::Tracks(), and BOARD::Zones().
Referenced by BOOST_AUTO_TEST_CASE(), and RunBoardLoad().
| std::unique_ptr< BOARD > KI_TEST::ReadBoardFromFileOrStream | ( | const std::string & | aFilename, |
| std::istream & | aFallback = std::cin ) |
Read a board from a file, or another stream, as appropriate.
| aFilename | The file to read, or the fallback if empty |
| aFallback | the fallback stream |
Definition at line 90 of file board_file_utils.cpp.
References ReadItemFromStream().
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(), 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(), 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(), 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(), 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(), 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(), 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(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_DATA_TEST_CASE_F(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), DoCourtyardInvalidTest(), DoCourtyardOverlapTest(), extract_zone_fills_main(), LoadAndTestBoardFile(), LoadBoard(), VIA_STACK_DRC_FIXTURE::loadBoard(), loadKicadProject(), polygon_gererator_main(), polygon_triangulation_main(), and testSaveLoad().
| std::unique_ptr< BOARD_ITEM > KI_TEST::ReadBoardItemFromStream | ( | std::istream & | aStream | ) |
Utility function to read a BOARD_ITEM (probably a FOOTPRINT or a BOARD) from a file.
Helps when writing tests or utilities that can be fed an external file.
| aFilename | the file to read in |
Definition at line 68 of file board_file_utils.cpp.
References PCB_IO_KICAD_SEXPR_PARSER::Parse(), and STDISTREAM_LINE_READER::SetStream().
Referenced by ReadItemFromStream().
| std::unique_ptr< FOOTPRINT > KI_TEST::ReadFootprintFromFileOrStream | ( | const std::string & | aFilename, |
| std::istream & | aFallback ) |
Definition at line 117 of file board_file_utils.cpp.
References ReadItemFromStream().
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 LoadAndTestFootprintFile().
| std::unique_ptr< ITEM > KI_TEST::ReadItemFromStream | ( | std::istream & | aStream | ) |
Read a specific kind of BOARD_ITEM from a stream.
| aStream | the stream to read from. |
Definition at line 80 of file board_file_utils.h.
References ITEM, and ReadBoardItemFromStream().
Referenced by ReadBoardFromFileOrStream(), and ReadFootprintFromFileOrStream().
| std::unique_ptr< SCHEMATIC > KI_TEST::ReadSchematicFromFile | ( | const std::string & | aFilename, |
| PROJECT * | aProject ) |
| std::unique_ptr< SCHEMATIC > KI_TEST::ReadSchematicFromStream | ( | std::istream & | aStream, |
| PROJECT * | aProject ) |
Definition at line 69 of file schematic_file_util.cpp.
References SCH_SHEET_LIST::AnnotatePowerSymbols(), SCH_IO_KICAD_SEXPR_PARSER::GetNetChainColors(), SCH_IO_KICAD_SEXPR_PARSER::GetNetChainMemberNets(), SCH_IO_KICAD_SEXPR_PARSER::GetNetChainNetClasses(), SCH_IO_KICAD_SEXPR_PARSER::GetNetChainTerminalRefs(), SCH_SHEET::GetScreen(), name, SCH_IO_KICAD_SEXPR_PARSER::ParseSchematic(), SCHEMATIC, EDA_ITEM::SetParent(), SCH_SHEET::SetScreen(), STDISTREAM_LINE_READER::SetStream(), SCH_SCREEN::UpdateLocalLibSymbolLinks(), SCH_SHEET_LIST::UpdateSheetInstanceData(), and SCH_SHEET_LIST::UpdateSymbolInstanceData().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().
| void KI_TEST::ReportAssertOffMainThread | ( | const wxString & | aFile, |
| int | aLine, | ||
| const wxString & | aFunc, | ||
| const wxString & | aCond, | ||
| const wxString & | aMsg ) |
Print a wx assertion that fired outside the main thread, then exit the process.
Worker threads reach wx assertions through the thread pool, whose tasks are detached and therefore cannot transport an exception back to a caller. Throwing there unwinds straight into std::terminate, which reports only the last exception to escape - typically some unrelated assertion raised while the process was already coming apart. Reporting from the faulting thread keeps the assertion and its stack together.
Definition at line 59 of file wx_assert.cpp.
References KI_TEST::WX_ASSERT_ERROR::what().
Referenced by wxAssertThrower().
| BOARD_ITEM & KI_TEST::RequireBoardItemWithTypeAndId | ( | const BOARD & | aBoard, |
| KICAD_T | aItemType, | ||
| const KIID & | aID ) |
Get an item from the given board with a certain type and UUID.
If this doesn't exist, it's a BOOST_REQUIRE failure.
| aBoard | the board to look in |
| aItemType | the required item type |
| aID | the required |
Definition at line 197 of file board_test_utils.cpp.
References BOOST_REQUIRE(), BOARD::ResolveItem(), and EDA_ITEM::Type().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_DATA_TEST_CASE(), BOOST_DATA_TEST_CASE(), BOOST_DATA_TEST_CASE(), BOOST_DATA_TEST_CASE(), BOOST_DATA_TEST_CASE_F(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and TUNING_PATTERN_LAYER_FIXTURE::LoadPattern().
| void KI_TEST::RunAdditionalBlockTest | ( | const std::string & | aBoardName, |
| size_t | aBlockOffset, | ||
| const ALLEGRO::BLOCK_BASE & | aBlock ) |
Look up and run any additional ad-hoc tests for a block.
Note that these tests don't have context of the wider board, so they are necessarily limited to quite "static" checks of the block content.
Definition at line 297 of file test_block_additional.cpp.
References additionalBlockTests, and BOOST_REQUIRE().
Referenced by ALLEGRO_BLOCK_TEST_FIXTURE::RunBlockTest().
| void KI_TEST::SetMockConfigDir | ( | ) |
Definition at line 126 of file unit_test_utils.cpp.
References GetTestDataRootDir(), and path.
Referenced by fuzz_init(), and init_unit_test().
|
inline |
Predicate to check an SEXPR object converts to the expected string.
| aSexpr | s-expression |
| aExpStr | expected string |
Definition at line 205 of file sexpr_test_utils.h.
References SEXPR::SEXPR::AsString(), and BOOST_TEST_INFO().
Referenced by 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().
|
inline |
Test predicate: is the s-expression a double?
Definition at line 159 of file sexpr_test_utils.h.
References IsSexprOfType(), and SEXPR::SEXPR_TYPE_ATOM_DOUBLE.
|
inline |
Test predicate: is the s-expression a double with the given value?
Definition at line 167 of file sexpr_test_utils.h.
References SEXPR::SEXPR::GetDouble(), IsSexprOfType(), IsSexprValueEqual(), and SEXPR::SEXPR_TYPE_ATOM_DOUBLE.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inline |
Test predicate: is the s-expression an integer?
Definition at line 142 of file sexpr_test_utils.h.
References IsSexprOfType(), and SEXPR::SEXPR_TYPE_ATOM_INTEGER.
|
inline |
Test predicate: is the s-expression an integer with the given value?
Definition at line 150 of file sexpr_test_utils.h.
References SEXPR::SEXPR::GetLongInteger(), IsSexprOfType(), IsSexprValueEqual(), and SEXPR::SEXPR_TYPE_ATOM_INTEGER.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inline |
Test predicate: is the s-expression a double?
Definition at line 176 of file sexpr_test_utils.h.
References IsSexprOfType(), and SEXPR::SEXPR_TYPE_LIST.
|
inline |
Test predicate: is the s-expression a list with the given length?
Definition at line 184 of file sexpr_test_utils.h.
References BOOST_TEST_MESSAGE(), SEXPR::SEXPR::GetNumberOfChildren(), IsSexprOfType(), and SEXPR::SEXPR_TYPE_LIST.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inline |
Test predicate: is the s-expression a string?
Definition at line 125 of file sexpr_test_utils.h.
References IsSexprOfType(), and SEXPR::SEXPR_TYPE_ATOM_STRING.
|
inline |
Test predicate: is the s-expression a string with the given value?
Definition at line 133 of file sexpr_test_utils.h.
References SEXPR::SEXPR::GetString(), IsSexprOfType(), IsSexprValueEqual(), and SEXPR::SEXPR_TYPE_ATOM_STRING.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inline |
Test predicate: is the s-expression a symbol?
Definition at line 108 of file sexpr_test_utils.h.
References IsSexprOfType(), and SEXPR::SEXPR_TYPE_ATOM_SYMBOL.
|
inline |
Test predicate: is the s-expression a symbol with the given value?
Definition at line 116 of file sexpr_test_utils.h.
References SEXPR::SEXPR::GetSymbol(), IsSexprOfType(), IsSexprValueEqual(), and SEXPR::SEXPR_TYPE_ATOM_SYMBOL.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
Build the cluster of aShapes against every constraint on aBoard, solve it, and write the result back – the common adapter-test happy path, which REQUIREs the build and solve to succeed.
Definition at line 162 of file constraint_test_utils.h.
References BOARD_CONSTRAINT_ADAPTER::Apply(), BOOST_REQUIRE(), BOARD_CONSTRAINT_ADAPTER::Build(), BOARD::Constraints(), and BOARD_CONSTRAINT_ADAPTER::Solve().
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(), 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(), 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(), 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().
|
inline |
Definition at line 81 of file wx_assert.h.
References ReportAssertOffMainThread().
Referenced by BOOST_AUTO_TEST_CASE(), fuzz_init(), and init_unit_test().
|
constexpr |
Definition at line 37 of file constraint_test_utils.h.
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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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(), 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().