Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable 2 CI systems side by side #21

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
language: ruby
sudo: false

# Disabling cache to make speed comparison more fair
# cache:
# directories:
# - ~/arduino_ide
# files:
# - ~/arduino-*-linux64.tar.xz


env:
global:
- ARDUINO_IDE_VERSION="1.8.6"


git:
depth: false
quiet: true

jobs:
include:
# One job is the CI script defined by Adafruit/travis-ci-arduino
# It's configured here and using .skip files
-
name: travis-ci-arduino
before_install:
- source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh)
install:
- echo "this is the 'install' section of .travis.yml"
script:
- build_main_platforms

# The other job is the CI script defined by ianfixes/arduino_ci
# It's launched here and uses .arduino-ci.yml (if provided) for customization
-
name: arduino_ci
os: osx
script:
- bundle install
- bundle exec arduino_ci_remote.rb

notifications:
email:
on_success: change
on_failure: change
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'https://rubygems.org'

gem 'arduino_ci', '~> 0.1.14'
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions test/strip.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include <ArduinoUnitTests.h>
#include "../Adafruit_WS2801.h"

unittest(set_strip_values)
{
GodmodeState* state = GODMODE();
state->reset();

// create strip of length 10
Adafruit_WS2801 strip;
strip = Adafruit_WS2801(10, 3, 2);
strip.begin();
strip.show();
assertEqual(30, state->digitalPin[3].toAscii(1, true).length());

// set all 10 pixels to some arbitrary HSV value
for (int i = 0; i < 10; ++i) {
strip.setPixelColor(i, 500);
}
strip.show();

assertEqual(60, state->digitalPin[3].toAscii(1, true).length());

// pin 2 is the clock pin, we expect 0xAA, which is 0b10101010
assertEqual(0xAA, (unsigned char)(state->digitalPin[2].toAscii(1, true)[0]));
assertEqual(0xAA, (unsigned char)(state->digitalPin[2].toAscii(1, true)[1]));
assertEqual(0xAA, (unsigned char)(state->digitalPin[2].toAscii(1, true)[2]));

// pin 3 is the data, we expect 3 byte groups, all zeroes
assertEqual(0, (unsigned int)(state->digitalPin[3].toAscii(1, true)[0]));
assertEqual(0, (unsigned int)(state->digitalPin[3].toAscii(1, true)[1]));
assertEqual(0, (unsigned int)(state->digitalPin[3].toAscii(1, true)[2]));

// the second 30 bytes will be our pixel color. not sure what to expect
// but I _do_ expect it to repeat
assertEqual(0, (unsigned int)(state->digitalPin[3].toAscii(1, true)[30]));
assertEqual(1, (unsigned int)(state->digitalPin[3].toAscii(1, true)[31]));
assertEqual(4294967284, (unsigned int)(state->digitalPin[3].toAscii(1, true)[32]));
assertEqual(0, (unsigned int)(state->digitalPin[3].toAscii(1, true)[33]));
assertEqual(1, (unsigned int)(state->digitalPin[3].toAscii(1, true)[34]));
assertEqual(4294967284, (unsigned int)(state->digitalPin[3].toAscii(1, true)[35]));
}

unittest_main()