Skip to content

Latest commit

 

History

History
73 lines (46 loc) · 2.57 KB

README.md

File metadata and controls

73 lines (46 loc) · 2.57 KB

Gem Version Build Status Documentation

ArduinoCI Ruby gem (arduino_ci)

Arduino CI is a Ruby gem for executing Continuous Integration (CI) tests on an Arduino library -- both locally and as part of a service like Travis CI.

Installation In Your GitHub Project And Using Travis CI

Add a file called Gemfile (no extension) to your Arduino project:

source 'https://rubygems.org'
gem 'arduino_ci'

Next, you need this in .travis.yml

sudo: false
language: ruby
script:
   - bundle install
   - bundle exec arduino_ci_remote.rb

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.

Unit tests in test/

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.

The most basic unit test file is as follows:

#include <ArduinoUnitTests.h>
#include "../do-something.h"

unittest(your_test_name)
{
  assertEqual(4, doSomething());
}

unittest_main()

This test defines one unittest (a macro provided by ArduionUnitTests.h), called your_test_name, which makes some assertions on the target library. The unittest_main() is a macro for the int main() boilerplate required for unit testing.

More Documentation

This software is in alpha. But SampleProjects/DoSomething has a decent writeup and is a good bare-bones example of all the features.

Known Problems

Author

This gem was written by Ian Katz ([email protected]) in 2018. It's released under the Apache 2.0 license.

See Also