fputc('\n', stream);
}
-static void GU_PRINTF(1, 2) gu_msg(const char *fmt, ...)
+static void GU_PRINTF(1, 2) msg(const char *fmt, ...)
{
va_list va;
static void module_cleanup(void)
{
- gu_msg("cleaning up");
+ msg("cleaning up");
if (mockup_loaded())
kmod_module_remove_module(globals.module, 0);
const char *modpath;
int status;
- gu_msg("checking gpio-mockup availability");
+ msg("checking gpio-mockup availability");
globals.module_ctx = kmod_new(NULL, NULL);
if (!globals.module_ctx)
if (status)
die_perr("unable to remove gpio-mockup");
- gu_msg("gpio-mockup ok");
+ msg("gpio-mockup ok");
}
static void test_load_module(struct _gu_chip_descr *descr)
atexit(module_cleanup);
- gu_msg("libgpiod unit-test suite");
- gu_msg("%u tests registered", globals.num_tests);
+ msg("libgpiod unit-test suite");
+ msg("%u tests registered", globals.num_tests);
check_gpio_mockup();
- gu_msg("running tests");
+ msg("running tests");
for (test = globals.test_list_head; test; test = test->_next) {
test_prepare(&test->chip_descr);
test->func();
- gu_msg("test '%s': %s", test->name,
+ msg("test '%s': %s", test->name,
globals.test_ctx.test_failed ? "FAILED" : "OK");
if (globals.test_ctx.test_failed)
globals.tests_failed++;
}
if (!globals.tests_failed)
- gu_msg("all tests passed");
+ msg("all tests passed");
else
gu_err("%u out of %u tests failed",
globals.tests_failed, globals.num_tests);