KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KI_TEST::BOARD_EXPECTATION_TEST Class Reference

#include <board_expectations.h>

Classes

struct  DESCRIPTOR
 Lightweight descriptor for a BOARD_EXPECTATION_TEST, which can be used to refer to the test unambiguously. More...
 

Public Member Functions

 BOARD_EXPECTATION_TEST (const std::string &aBrdName)
 
void RunTest (const BOARD &aBrd) const
 Runs the test against the given board.
 

Static Public Member Functions

static std::unique_ptr< BOARD_EXPECTATION_TESTCreateFromJson (const std::string &aBrdName, const nlohmann::json &aBrdExpectations)
 
static std::vector< DESCRIPTORExtractExpectationTestsFromJson (const nlohmann::json &aExpectationArray)
 Extracts expectation tests from the given JSON array and returns a list of test references that can be used to run the tests.
 
static void RunFromRef (const std::string &aBrdName, const BOARD &aBoard, const BOARD_EXPECTATION_TEST::DESCRIPTOR &aExpectationTestRef)
 Constructs a BOARD_EXPECTATION_TEST from the given JSON definition, and runs it on the given board.
 

Private Attributes

std::unique_ptr< BOARD_EXPECTATIONm_expectation
 
std::string m_BrdName
 
bool m_skip = false
 

Detailed Description

Definition at line 64 of file board_expectations.h.

Constructor & Destructor Documentation

◆ BOARD_EXPECTATION_TEST()

KI_TEST::BOARD_EXPECTATION_TEST::BOARD_EXPECTATION_TEST ( const std::string & aBrdName)
inline

Definition at line 81 of file board_expectations.h.

References m_BrdName.

Member Function Documentation

◆ CreateFromJson()

std::unique_ptr< BOARD_EXPECTATION_TEST > BOARD_EXPECTATION_TEST::CreateFromJson ( const std::string & aBrdName,
const nlohmann::json & aBrdExpectations )
static

◆ ExtractExpectationTestsFromJson()

std::vector< BOARD_EXPECTATION_TEST::DESCRIPTOR > BOARD_EXPECTATION_TEST::ExtractExpectationTestsFromJson ( const nlohmann::json & aExpectationArray)
static

Extracts expectation tests from the given JSON array and returns a list of test references that can be used to run the tests.

This is intended to be used to extract the expectation tests from the JSON at static init time to register the tests with the test runner. This does not actually create the expectation test objects, just extracts the minimal information needed to register them.

Definition at line 1209 of file board_expectations.cpp.

References index, and name.

Referenced by getBoardTestDefinitions().

◆ RunFromRef()

void BOARD_EXPECTATION_TEST::RunFromRef ( const std::string & aBrdName,
const BOARD & aBoard,
const BOARD_EXPECTATION_TEST::DESCRIPTOR & aExpectationTestRef )
static

Constructs a BOARD_EXPECTATION_TEST from the given JSON definition, and runs it on the given board.

Definition at line 1300 of file board_expectations.cpp.

References BOOST_TEST_CONTEXT(), CreateFromJson(), KI_TEST::BOARD_EXPECTATION_TEST::DESCRIPTOR::m_TestJson, and KI_TEST::BOARD_EXPECTATION_TEST::DESCRIPTOR::m_TestName.

Referenced by buildAllegroBoardSuites().

◆ RunTest()

void BOARD_EXPECTATION_TEST::RunTest ( const BOARD & aBrd) const

Runs the test against the given board.

Definition at line 1276 of file board_expectations.cpp.

References BOOST_TEST_CONTEXT(), BOOST_TEST_MESSAGE(), m_expectation, and m_skip.

Member Data Documentation

◆ m_BrdName

std::string KI_TEST::BOARD_EXPECTATION_TEST::m_BrdName
private

Definition at line 112 of file board_expectations.h.

Referenced by BOARD_EXPECTATION_TEST().

◆ m_expectation

std::unique_ptr<BOARD_EXPECTATION> KI_TEST::BOARD_EXPECTATION_TEST::m_expectation
private

Definition at line 111 of file board_expectations.h.

Referenced by RunTest().

◆ m_skip

bool KI_TEST::BOARD_EXPECTATION_TEST::m_skip = false
private

Definition at line 113 of file board_expectations.h.

Referenced by RunTest().


The documentation for this class was generated from the following files: