From cb5991fe4b3b6582b3399ed1e410c52f2c2e985b Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Tue, 30 Jul 2019 13:53:13 +0200 Subject: [PATCH] tests: setup libgpiomockup before checking the kernel version 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 --- tests/gpiod-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/gpiod-test.c b/tests/gpiod-test.c index f75173c..d003c1c 100644 --- a/tests/gpiod-test.c +++ b/tests/gpiod-test.c @@ -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) { -- 2.30.2