README: add some info on unit tests
authorBartosz Golaszewski <bartekgola@gmail.com>
Fri, 5 May 2017 15:43:06 +0000 (17:43 +0200)
committerBartosz Golaszewski <bartekgola@gmail.com>
Fri, 5 May 2017 15:43:06 +0000 (17:43 +0200)
Describe how to build and use the testing framework.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
README.md

index 75ee722c664c9dbaf941b29e3ecf40ce3146d376..9443355c197846f08cb3527a146e65b8b3302a50 100644 (file)
--- 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
 ------------