-
Notifications
You must be signed in to change notification settings - Fork 16
/
ExternalTests.cpp
56 lines (42 loc) · 1.24 KB
/
ExternalTests.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#line 2 "ExternalTests.cpp"
/*
* Define a bunch of tests in a file outside of AUnitTest to verify that
* externTest(), externTesting(), externTestF() and externTestingF() work as
* expected.
*
* Failing and expiring tests have been moved to ExpectedFailingTest/.
*/
#include <Arduino.h>
#include "AUnitMetaTest.h"
test(external) {}
test(MyTestSuite, external) {}
testing(slow_pass) {
static unsigned long start = millis();
if (millis() - start > 1000) pass();
}
testing(MyTestSuite, slow_pass) {
static unsigned long start = millis();
if (millis() - start > 1000) pass();
}
testing(slow_skip) {
static unsigned long start = millis();
if (millis() - start > 1000) skip();
}
testing(MyTestSuite, slow_skip) {
static unsigned long start = millis();
if (millis() - start > 1000) skip();
}
#if USE_AUNIT == 1
// These are external slow tests using AUnit's testF() and testingF() macro.
testF(CustomOnceFixture, fixture_external) {}
testingF(CustomAgainFixture, fixture_slow_pass) {
static unsigned long start = millis();
assertCommon(5);
if (millis() - start > 1000) pass();
}
testingF(CustomAgainFixture, fixture_slow_skip) {
static unsigned long start = millis();
assertCommon(5);
if (millis() - start > 1000) skip();
}
#endif