tests: setup libgpiomockup before checking the kernel version
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 30 Jul 2019 11:53:13 +0000 (13:53 +0200)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 30 Jul 2019 11:53:13 +0000 (13:53 +0200)
The gpio-mockup helper library checks the kernel version itself when
creating the context object. We then check the version again (as the
minimum versions for libgpiomockup and the test-suite may differ) in
the test-suite's main function. Make sure the library runs the check
first as we don't want to tell the user the version is OK and then
fail because it isn't...

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
tests/gpiod-test.c

index f75173c7ff0192261eceed068d10e9bde02c4b4d..d003c1ced587c4c08f2f3a1c21aa634c5db3b9a5 100644 (file)
@@ -857,13 +857,13 @@ int main(int argc TEST_UNUSED, char **argv TEST_UNUSED)
        msg("libgpiod test suite");
        msg("%u tests registered", globals.num_tests);
 
-       check_kernel();
-       check_tool_path();
-
        globals.mockup = gpio_mockup_new();
        if (!globals.mockup)
                die_perr("error checking the availability of gpio-mockup");
 
+       check_kernel();
+       check_tool_path();
+
        msg("running tests");
 
        for (test = globals.test_list_head; test; test = test->_next) {