diff --git a/.arduino-ci.yml b/.arduino-ci.yml new file mode 100644 index 0000000..7364656 --- /dev/null +++ b/.arduino-ci.yml @@ -0,0 +1,25 @@ +platforms: + rpipico: + board: rp2040:rp2040:rpipico + package: rp2040:rp2040 + gcc: + features: + defines: + - ARDUINO_ARCH_RP2040 + warnings: + flags: + +packages: + rp2040:rp2040: + url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json + +compile: + platforms: + - uno +# - m4 +# - esp32 +# - esp8266 +# - rpipico +libraries: + - "SoftwareSerial" + - "ArduinoJson" diff --git a/.github/workflows/arduino-lint.yml b/.github/workflows/arduino-lint.yml new file mode 100644 index 0000000..0ec25f8 --- /dev/null +++ b/.github/workflows/arduino-lint.yml @@ -0,0 +1,12 @@ +name: Arduino-lint + +on: [push, pull_request] +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: arduino/arduino-lint-action@v1 + with: + library-manager: update + compliance: strict diff --git a/.github/workflows/arduino_test_runner.yml b/.github/workflows/arduino_test_runner.yml new file mode 100644 index 0000000..fadfa90 --- /dev/null +++ b/.github/workflows/arduino_test_runner.yml @@ -0,0 +1,17 @@ +--- +name: Arduino CI + +on: [push, pull_request] + +jobs: + runTest: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + - run: | + gem install arduino_ci + arduino_ci.rb diff --git a/.github/workflows/jsoncheck.yml b/.github/workflows/jsoncheck.yml new file mode 100644 index 0000000..5f05b12 --- /dev/null +++ b/.github/workflows/jsoncheck.yml @@ -0,0 +1,17 @@ +name: JSON check + +on: + push: + paths: + - '**.json' + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: json-syntax-check + uses: limitusus/json-syntax-check@v1 + with: + pattern: "\\.json$" diff --git a/README.md b/README.md index 5b4e0bf..b1e06bb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +[![Arduino CI](https://github.com/ripred/TomServo/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci) +[![Arduino-lint](https://github.com/ripred/TomServo/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/ripred/TomServo/actions/workflows/arduino-lint.yml) +![code size:](https://img.shields.io/github/languages/code-size/ripred/TomServo) +[![GitHub release](https://img.shields.io/github/release/ripred/TomServo.svg?maxAge=3600)](https://github.com/ripred/TomServo/releases) +[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/ripred/TomServo/blob/master/LICENSE) + # Thomas  Servo  Eskwire ![TomServo32x32.png](TomServo32x32.png) diff --git a/test/unit_test_001.cpp b/test/unit_test_001.cpp new file mode 100644 index 0000000..4c06395 --- /dev/null +++ b/test/unit_test_001.cpp @@ -0,0 +1,56 @@ +// +// FILE: unit_test_001.cpp +// AUTHOR: Trent M. Wyatt +// DATE: 2024-01-04 +// PURPOSE: unit tests for ArduinoCLI library +// https://github.com/RobTillaart/SIMON +// + + +// supported assertions +// ---------------------------- +// assertEqual(expected, actual); // a == b +// assertNotEqual(unwanted, actual); // a != b +// assertComparativeEquivalent(expected, actual); // abs(a - b) == 0 or (!(a > b) && !(a < b)) +// assertComparativeNotEquivalent(unwanted, actual); // abs(a - b) > 0 or ((a > b) || (a < b)) +// assertLess(upperBound, actual); // a < b +// assertMore(lowerBound, actual); // a > b +// assertLessOrEqual(upperBound, actual); // a <= b +// assertMoreOrEqual(lowerBound, actual); // a >= b +// assertTrue(actual); +// assertFalse(actual); +// assertNull(actual); + +// // special cases for floats +// assertEqualFloat(expected, actual, epsilon); // fabs(a - b) <= epsilon +// assertNotEqualFloat(unwanted, actual, epsilon); // fabs(a - b) >= epsilon +// assertInfinity(actual); // isinf(a) +// assertNotInfinity(actual); // !isinf(a) +// assertNAN(arg); // isnan(a) +// assertNotNAN(arg); // !isnan(a) + + +#include + +#include "Arduino.h" +#include "TomServo.h" + + +unittest_setup() +{ + fprintf(stderr, "TomServo Library\n"); +} + +unittest_teardown() +{ +} + +unittest(test_mock) +{ +} + +unittest_main() + +// -- END OF FILE -- + +