The test monitor panel reports self-test results to the Arduino programming visualizer. Self-tests are typically used during manufacturing of custom devices for functional testing. Functional testing checks if all of the components on the board are operating correctly.

This page describes the methods implemented by the TestResult class in the MegunoLink Arduino library to report results to a test-monitor panel. Refer to Arduino programming for documentation on the visualizer.

Test monitor panel
The test monitor reports self-test results.

To use the TestReport, create a variable and call one of the methods below. For example:

Method Descriptions

Test Report Constructor

Creates a TestReport variable, which can be used to send commands to MegunoLink to record the results from tests.

TestReport(Print &Destination = Serial);

Parameters
Name Type Required? Description
Destination Print & No Sets the serial connection to use for sending messages to MegunoLink. Defaults to Serial, the default Arduino RS232 port.

StartingTest

Informs MegunoLink that a test is about to start. MegunoLink resets all test results to unknown and starts waiting for test results.

void StartingTest();

TestComplete

Informs MegunoLink that all the test results have been sent. MegunoLink reports the overall test result and continues with the next step in the programming sequence (if any).

void TestComplete();

Report Result using a TestId

Sends the outcome of a test to MegunoLink. The test result reported is identified by the TestId in MegunoLink. The outcome is either pass or fail. Data, providing additional information about the test result, may be optionally included. This data is displayed for the user in the test result panel.

void ReportResult(int TestId, bool Pass);
void ReportResult(int TestId, bool Pass, TData Data);

Parameters
Name Type Required? Description
TestId int Yes The id of the test to match in MegunoLink.
Pass bool Yes Outcome of the test. True indicates the test passed; false indicates it failed.
Data TData No Additional data to include in the test report. Any data type supported by the Arduino print method may be used.

Report Result using a Test Name

Sends the outcome of a test to MegunoLink. The test result reported is identified by name in MegunoLink. The outcome is either pass or fail. Data, providing additional information about the test result, may be optionally included. This data is displayed for the user in the test result panel.

void ReportResult(const char *Name, bool Pass);
void ReportResult(const char *Name, bool Pass, TData Data);
void ReportResult(const __FlashStringHelper *Name, bool Pass);
void ReportResult(const __FlashStringHelper *Name, bool Pass, TData Data);

Parameters
Name Type Required? Description
Name const char *, const __FlashStringHelper Yes The name of the test to match in MegunoLink.
Pass bool Yes Outcome of the test. True indicates the test passed; false indicates it failed.
Data TData No Additional data to include in the test report. Any data type supported by the Arduino print method may be used.

Report a Passing Test Result

Sends a passing test result to MegunoLink. Data, providing additional information about the test result, may be optionally included. This data is displayed for the user in the test result panel.

void Pass(const char *Name);
void Pass(const char *Name, TData Data);
void Pass(const __FlashStringHelper *Name);
void Pass(const __FlashStringHelper *Name, TData Data);

Parameters
Name Type Required? Description
Name const char *, const __FlashStringHelper Yes The name of the test to match in MegunoLink.
Data TData No Additional data to include in the test report. Any data type supported by the Arduino print method may be used.

Report a Failing Test Result

Sends a failing test result to MegunoLink. Data, providing additional information about the test result, may be optionally included. This data is displayed for the user in the test result panel.

void Fail(const char *Name);
void Fail(const char *Name, TData Data);
void Fail(const __FlashStringHelper *Name);
void Fail(const __FlashStringHelper *Name, TData Data);

Parameters
Name Type Required? Description
Name const char *, const __FlashStringHelper Yes The name of the test to match in MegunoLink.
Data TData No Additional data to include in the test report. Any data type supported by the Arduino print method may be used.

Leave a Comment

Start typing and press Enter to search