From 35a5fdb2529ee71494f878ed89074ec9696148db Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Fri, 5 May 2017 17:43:06 +0200 Subject: [PATCH] README: add some info on unit tests Describe how to build and use the testing framework. Signed-off-by: Bartosz Golaszewski --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 75ee722..9443355 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,27 @@ Examples: # anything. Find the line by name. # gpiomon --num-events=1 --silent `gpiofind "USR-IN"` +TESTING +------- + +A comprehensive unit testing framework is included with the library and can be +used to test both the library code and the linux kernel user-space interface. + +The minimum kernel version required to run the tests is 4.11. The tests work +together with the gpio-mockup kernel module which must be enabled. NOTE: the +module must not be built-in. + +To build the testing executable run: + + ./configure --enable-tests + make check + +As opposed to standard autotools projects, libgpiod doesn't execute any tests +when invoking 'make check'. Instead the user must run them manually with +superuser privileges: + + sudo ./tests/unit/gpiod-unit + CONTRIBUTING ------------ -- 2.30.2