AUnit  0.3.1
Unit testing framework for Arduino platforms inspired by ArduinoUnit.
Classes | Macros
Test.h File Reference

Various macros (test(), testing(), externTest(), externTesting()) are defined in this header. More...

#include <stdint.h>
#include "FCString.h"
Include dependency graph for Test.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  aunit::Test
 Base class of all test cases. More...
 
class  aunit::TestOnce
 Similar to Test but performs the loop() method only once. More...
 

Macros

#define test(name)
 Macro to define a test that will be run only once. More...
 
#define testing(name)
 Macro to define a test that will run repeatly upon each iteration of the global loop() method, stopping when the something calls Test::pass(), Test::fail() or Test::skip(). More...
 
#define externTest(name)
 Create an extern reference to a test() test case object defined elsewhere. More...
 
#define externTesting(name)
 Create an extern reference to a testing() test case object defined elsewhere. More...
 

Detailed Description

Various macros (test(), testing(), externTest(), externTesting()) are defined in this header.

Definition in file Test.h.

Macro Definition Documentation

◆ externTest

#define externTest (   name)
Value:
struct test_ ## name : aunit::TestOnce {\
test_ ## name();\
void once();\
};\
extern test_##name test_##name##_instance
virtual void once()=0
User-provided test case.
Similar to Test but performs the loop() method only once.
Definition: Test.h:233

Create an extern reference to a test() test case object defined elsewhere.

This is only necessary if you use assertTestXxx() or checkTestXxx() when the test is in another file (or defined after the assertion on it).

Definition at line 74 of file Test.h.

◆ externTesting

#define externTesting (   name)
Value:
struct test_ ## name : aunit::Test {\
test_ ## name();\
void loop();\
};\
extern test_##name test_##name##_instance
Base class of all test cases.
Definition: Test.h:100
virtual void loop()=0
The user-provided test case function.

Create an extern reference to a testing() test case object defined elsewhere.

This is only necessary if you use assertTestXxx() or checkTestXxx() when the test is in another file (or defined after the assertion on it).

Definition at line 86 of file Test.h.

◆ test

#define test (   name)
Value:
struct test_ ## name : aunit::TestOnce {\
test_ ## name();\
virtual void once() override;\
} test_ ## name ## _instance;\
test_ ## name :: test_ ## name() : TestOnce(F(#name)) {}\
void test_ ## name :: once()
virtual void once()=0
User-provided test case.
Similar to Test but performs the loop() method only once.
Definition: Test.h:233

Macro to define a test that will be run only once.

Definition at line 50 of file Test.h.

◆ testing

#define testing (   name)
Value:
struct test_ ## name : aunit::Test {\
test_ ## name();\
virtual void loop() override;\
} test_ ## name ## _instance;\
test_ ## name :: test_ ## name() : Test(F(#name)) {}\
void test_ ## name :: loop()
Base class of all test cases.
Definition: Test.h:100
virtual void loop()=0
The user-provided test case function.

Macro to define a test that will run repeatly upon each iteration of the global loop() method, stopping when the something calls Test::pass(), Test::fail() or Test::skip().

Definition at line 62 of file Test.h.