Skip to content

Testing changes to the application

Whymarrh Whitby edited this page Apr 26, 2016 · 6 revisions

This page outlines the process for testing changes made to the application. The process of testing changes is complicated by the need to run certain changes with particular hardware (e.g. a physical Raspberry Pi, the thrusters, a particular sensor).

Running tests on a development machine

If the changes require no special hardware to test, the tests can be run on your local development machine. In this scenario, create a JUnit test case for your changes and run them via gradle test.

Running tests on the Raspberry Pi (with or without hardware attached)

Running tests* on the Raspberry Pi is a multi-part process.

* Tests in this context referring to any changes that do not belong in the main source tree.

  1. Build a test JAR via gradle testJar
  2. Copy the JAR from build/libs/Rov-1.0.0-tests.jar to the Raspberry Pi
  3. Run your test class via java -cp Rov-1.0.0-tests.jar $mainClassName

As a convenience, you can define the following shell functions:

copy () { sshpass -p raspberry scp build/libs/Rov-1.0.0-tests.jar pi@$1:~ ; }
run () { local pi=$1; shift; sshpass -p raspberry ssh pi@$pi sudo java -cp Rov-1.0.0-tests.jar $@ ; }

Example usage:

copy 192.168.88.13 && run 192.168.88.13 com.easternedgerobotics.rov.integration.PololuMaestroQuickTest 1550
Clone this wiki locally