mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-20 15:00:06 +01:00
test: move the kernel test to the same infrastructure
We previously had this separate because it tested separate things. Now the setup is generic enough that we should just re-use it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
1f9e087dac
commit
c4cfd7668a
2 changed files with 6 additions and 20 deletions
|
|
@ -83,8 +83,10 @@ test_libevdev_LDADD = $(CHECK_LIBS) $(top_builddir)/libevdev/libevdev.la
|
|||
test_libevdev_LDFLAGS = -no-install
|
||||
|
||||
test_kernel_SOURCES = \
|
||||
test-main.c \
|
||||
test-kernel.c \
|
||||
$(common_sources)
|
||||
|
||||
test_kernel_CFLAGS = -I$(top_srcdir)
|
||||
test_kernel_LDADD = $(CHECK_LIBS) $(top_builddir)/libevdev/libevdev.la
|
||||
|
||||
|
|
|
|||
|
|
@ -160,31 +160,15 @@ out:
|
|||
}
|
||||
END_TEST
|
||||
|
||||
int main(int argc, char **argv)
|
||||
TEST_SUITE_ROOT_PRIVILEGES(kernel)
|
||||
{
|
||||
SRunner *sr;
|
||||
Suite *s;
|
||||
TCase *tc;
|
||||
int failed;
|
||||
Suite *s = suite_create("kernel");
|
||||
|
||||
if (getuid() != 0) {
|
||||
fprintf(stderr, "This test needs to run as root\n");
|
||||
return 77;
|
||||
}
|
||||
|
||||
s = suite_create("kernel tests");
|
||||
|
||||
tc = tcase_create("EVIOCREVOKE");
|
||||
TCase *tc = tcase_create("EVIOCREVOKE");
|
||||
tcase_add_test(tc, test_revoke);
|
||||
tcase_add_test(tc, test_revoke_invalid);
|
||||
tcase_add_test(tc, test_revoke_fail_after);
|
||||
suite_add_tcase(s, tc);
|
||||
|
||||
sr = srunner_create(s);
|
||||
srunner_run_all(sr, CK_NORMAL);
|
||||
|
||||
failed = srunner_ntests_failed(sr);
|
||||
srunner_free(sr);
|
||||
|
||||
return failed;
|
||||
return s;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue