You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That's literally all there is to it on the repository side. You'll need to go to https://travis-ci.org/profile/ and enable testing for your Arduino project. Once that happens, you should be all set.
29
+
That's literally all there is to it on the repository side. You'll need to go to https://travis-ci.org/profile/ and enable testing for your Arduino project. Once that happens, you should be all set. The script will test all example projects of the library and all unit tests.
30
+
31
+
### Unit tests in `test/`
32
+
33
+
All `.cpp` files in the `test/` directory of your Arduino library are assumed to contain unit tests. Each and every one will be compiled and executed on its own.
34
+
35
+
The most basic unit test file is as follows:
36
+
37
+
```C++
38
+
#include <ArduinoUnitTests.h>
39
+
#include "../do-something.h"
40
+
41
+
unittest(your_test_name)
42
+
{
43
+
assertEqual(4, doSomething());
44
+
}
45
+
46
+
int main(int argc, char *argv[]) {
47
+
return Test::run_and_report(argc, argv);
48
+
}
49
+
```
50
+
51
+
This test defines one `unittest` (a macro provided by `ArduionUnitTests.h`), called `your_test_name`, which makes some assertions on the target library. The `int main` section is boilerplate.
0 commit comments