Difference between revisions of "Builds/Tests"
IHaveADrone (talk | contribs) m (spelling) |
|||
(One intermediate revision by one other user not shown) | |||
Line 6: | Line 6: | ||
* <code>make test_math</code>: test math lib | * <code>make test_math</code>: test math lib | ||
* <code>make test_examples</code>: test compiles all aircrafts/targets in conf/conf_tests.xml | * <code>make test_examples</code>: test compiles all aircrafts/targets in conf/conf_tests.xml | ||
* <code>make test_all_confs</code>: test compiles all confs, i.e. all | * <code>make test_all_confs</code>: test compiles all confs, i.e. all aircrafts found in all conf files found by <code>find_confs.py</code> | ||
To test compile all aircrafts in one specific conf file: | To test compile all aircrafts in one specific conf file:<br /> | ||
<code>CONF_XML=conf/conf_personal.xml prove tests/aircrafts/</code> | <code>CONF_XML=conf/conf_personal.xml prove tests/aircrafts/</code><br /> | ||
See [https://github.com/paparazzi/paparazzi/blob/master/tests/aircrafts/01_compile_all_aircrafts.t tests/aircrafts/01_compile_all_aircrafts.t] for more details. | |||
If you require more verbose output of the results run the command <code>make test TEST_VERBOSE=1</code> | If you require more verbose output of the results run the command <code>make test TEST_VERBOSE=1</code> | ||
Line 15: | Line 16: | ||
The test results can also be generated in JUnit format adding the option <code>JUNIT=1</code> to the command line i.e. <code>make test JUNIT=1</code> or <code>make test TEST_VERBOSE=1 JUNIT=1</code> | The test results can also be generated in JUnit format adding the option <code>JUNIT=1</code> to the command line i.e. <code>make test JUNIT=1</code> or <code>make test TEST_VERBOSE=1 JUNIT=1</code> | ||
JUnit formatting of test | JUnit formatting of test results requires that the Perl module <code>TAP::Formatters::JUnit</code> is installed on the machine that the tests are run on. Please see [[Builds/Tests#Installing Perl Modules| installing Perl modules]] for more details | ||
= Hardware tests = | = Hardware tests = |
Latest revision as of 06:29, 14 June 2016
Automated testing
There are a number of automated tests that can be run from the command line from the top level Paparazzi directory:
make test
: runs test_math and test_examplesmake test_math
: test math libmake test_examples
: test compiles all aircrafts/targets in conf/conf_tests.xmlmake test_all_confs
: test compiles all confs, i.e. all aircrafts found in all conf files found byfind_confs.py
To test compile all aircrafts in one specific conf file:
CONF_XML=conf/conf_personal.xml prove tests/aircrafts/
See tests/aircrafts/01_compile_all_aircrafts.t for more details.
If you require more verbose output of the results run the command make test TEST_VERBOSE=1
The test results can also be generated in JUnit format adding the option JUNIT=1
to the command line i.e. make test JUNIT=1
or make test TEST_VERBOSE=1 JUNIT=1
JUnit formatting of test results requires that the Perl module TAP::Formatters::JUnit
is installed on the machine that the tests are run on. Please see installing Perl modules for more details
Hardware tests
The hardware testing is executed using the Perl test framework.
To implement the hardware testing we need do the following
- Build the firmware
- Upload the firmware to the target board noting that multiple boards may be connected to the same computer
- Start up the server program
- Start up the link program
- Run the test suite by reading and writing data to the Ivy bus.
- Stop the server and link processes
The Perl module IO::Socket::Multicast
is required to be installed to be able to execute the hardware tests. Please see installing Perl modules for more details
To execute the hardware tests run the command make test TEST_HARDWARE=1
Installing Perl modules
On Ubuntu/Debian simply
apt-get install libio-socket-multicast-perl libtap-formatter-junit-perl
To install Perl modules directly from CPAN the following procedure can be run.
- sudo perl -MCPAN -e shell
- install <module name>
This should install all of the required modules. note that errors may be reported during the installation process so you should pay attention to what is happening.