Pierre Prinetti
Pierre Prinetti

Reputation: 9632

Test Raspberry Pi code on Travis

I'm using the pi-gpio node module to program my Raspberry Pi.
I would like to test my code on Travis.

I've found this post which explains how to set up a virtual ARM machine on Travis: http://www.tomaz.me/2013/12/02/running-travis-ci-tests-on-arm.html (I still haven't managed to get it work: it fails on loading pi-gpio. But this could be my fault.)

Has something changed since 2013? Is there an easier way to test my NodeJS code on Travis-ci?

Upvotes: 2

Views: 685

Answers (1)

user2629998
user2629998

Reputation:

The problem is that pi-gpio requires a real Raspberry PI with its hardware, and of course fails because QEMU can't yet emulate such hardware, so the only solution is to make yourself a stub version of pi-gpio that replicates the behavior of the real pi-gpio without trying to interact with any hardware and provides methods to get the status for the GPIO pins so your tests can use that to assert the state of the GPIO pins.

Upvotes: 2

Related Questions