tests: print an info message after building tests
authorBartosz Golaszewski <bartekgola@gmail.com>
Wed, 8 Mar 2017 14:09:27 +0000 (15:09 +0100)
committerBartosz Golaszewski <bartekgola@gmail.com>
Wed, 8 Mar 2017 14:09:27 +0000 (15:09 +0100)
We can't automatically run unit tests from 'make check' as the test
executable works together with the gpio-mockup kernel module. Without
any additional udev configuration /dev/gpiochipX files are only
accessible for superuser.

Print a message explaining what to do after the tests are built.

NOTE: the message says that linux kernel >=v4.11 is needed to run the
tests. This is not true currently, as we don't test events yet. Event
injecting over debugfs is a new feature of gpio-mockup and will be
available in the upcoming kernel release.

Once v4.11 is released and appropriate test cases implemented, we'll
make it a hard requirement for tests.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
tests/unit/Makefile.am

index 031be75b5bb47ed32c119b90d3efd7352b6c3c0e..24e091b351978d4c4d101aa09fb18033370ac9e8 100644 (file)
@@ -19,3 +19,15 @@ gpiod_unit_SOURCES = gpiod-unit.c \
                        tests-line.c \
                        tests-misc.c \
                        tests-simple-api.c
+
+check: check-am
+       @echo "********************************************************"
+       @echo "* Unit tests have been built as tests/unit/gpio-unit.  *"
+       @echo "*                                                      *"
+       @echo "* They require linux kernel version >=v4.11 and the    *"
+       @echo "* gpio-mockup module (must not be built-in).           *"
+       @echo "*                                                      *"
+       @echo "* Run the test executable with superuser privileges or *"
+       @echo "* make sure /dev/gpiochipX files are readable and      *"
+       @echo "* writable by normal users.                            *"
+       @echo "********************************************************"