-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
93 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
compile: | ||
# Choosing to run compilation tests on 2 different Arduino platforms | ||
platforms: | ||
- uno | ||
- leonardo | ||
- due | ||
- zero |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
name: Arduino CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
arduino_ci: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: Arduino-CI/action@master | ||
# Arduino-CI/action@v0.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
// FILE: unit_test_001.cpp | ||
// AUTHOR: Rob Tillaart | ||
// DATE: 2020-12-18 | ||
// PURPOSE: unit tests for the DEVNULL library | ||
// https://github.com/RobTillaart/ | ||
// https://github.com/Arduino-CI/arduino_ci/blob/master/REFERENCE.md | ||
// | ||
|
||
// supported assertions | ||
// https://github.com/Arduino-CI/arduino_ci/blob/master/cpp/unittest/Assertion.h#L33-L42 | ||
// ---------------------------- | ||
// assertEqual(expected, actual) | ||
// assertNotEqual(expected, actual) | ||
// assertLess(expected, actual) | ||
// assertMore(expected, actual) | ||
// assertLessOrEqual(expected, actual) | ||
// assertMoreOrEqual(expected, actual) | ||
// assertTrue(actual) | ||
// assertFalse(actual) | ||
// assertNull(actual) | ||
// assertNotNull(actual) | ||
|
||
#include <ArduinoUnitTests.h> | ||
|
||
#define assertEqualFloat(arg1, arg2, arg3) assertOp("assertEqualFloat", "expected", fabs(arg1 - arg2), compareLessOrEqual, "<=", "actual", arg3) | ||
#define assertEqualINF(arg) assertOp("assertEqualINF", "expected", INFINITY, compareEqual, "==", "actual", arg) | ||
#define assertEqualNAN(arg) assertOp("assertEqualNAN", "expected", true, compareEqual, "==", "actual", isnan(arg)) | ||
|
||
|
||
#include "DEVNULL.h" | ||
|
||
|
||
unittest_setup() | ||
{ | ||
} | ||
|
||
unittest_teardown() | ||
{ | ||
} | ||
|
||
|
||
unittest(test_all) | ||
{ | ||
DEVNULL dn; | ||
|
||
assertEqual(0, dn.available()); | ||
assertEqual(EOF, dn.peek()); | ||
assertEqual(EOF, dn.read()); | ||
assertEqual(1, dn.write('a')); | ||
assertEqual(11, dn.print("hello world")); | ||
} | ||
|
||
unittest_main() | ||
|
||
// -------- |