Ada_Drivers_Library/testsuite
Fabien Chouteau 5a197cfbeb Migration to GNAT Community 2020 2020-05-29 18:56:37 +02:00
..
tests Fix use of an anonymous access type allocator warnings 2019-04-08 19:11:21 +02:00
utils HAL.GPIO: Switch to a capability system 2018-07-11 18:46:16 +02:00
.gitignore Add the basis for an automated native testsuite... 2016-11-01 11:28:07 +01:00
README.md Testsuite: add support to check memory issues with Valgrind 2016-11-01 11:28:07 +01:00
run.py Migration to GNAT Community 2020 2020-05-29 18:56:37 +02:00

README.md

Ada_Drivers_Library testsuite

Without nice emulator support, testing bare-board code is hard. The goal of this testsuite is to leverage the native support packages in this repository to test services and components that rely on native implementations for HAL interfaces.

How to run the testsuite

First, make sure you have a Python 3 interpreter available, and then run:

./run.py

The standard output report should be obvious to read. In order to restrict the set of executed tests, run instead:

./run.py foo bar

This will execute all tests that have either foo or bar in their name

If Valgrind is available, add a --valgrind switch to detect memory issues such as invalid operations or leaks.

How to write testcases

Every subdirectory in tests/ that contains a tc.gpr file is a testcase. Each testcase embeds one or more test drivers (i.e. Ada programs) that run test code and write to their standard output to demonstrate that some feature is correctly implemented. For each test driver X, the project file must build an executable as bin/X and there must be a X.out file next to the tc.gpr project file that states what the test driver output should be for the test to pass.