test: move the rest of the custom initialization to litest_run

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1067>
This commit is contained in:
Peter Hutterer 2024-10-16 11:04:08 +10:00 committed by Marge Bot
parent d4c6c47677
commit c68c0f593b

View file

@ -1113,9 +1113,15 @@ restore_tty(int tty_mode)
static inline enum litest_runner_result
litest_run(struct list *suites)
{
const struct rlimit corelimit = { 0, 0 };
int inhibit_lock_fd;
int tty_mode = -1;
setenv("LIBINPUT_RUNNING_TEST_SUITE", "1", 1);
if (setrlimit(RLIMIT_CORE, &corelimit) != 0)
perror("WARNING: Core dumps not disabled");
list_init(&created_files_list);
if (run_deviceless) {
@ -4818,7 +4824,6 @@ litest_free_test_list(struct list *tests)
int
main(int argc, char **argv)
{
const struct rlimit corelimit = { 0, 0 };
enum litest_mode mode;
int rc;
const char *meson_testthreads;
@ -4857,12 +4862,6 @@ main(int argc, char **argv)
if (!run_deviceless && (rc = check_device_access()) != 0)
return rc;
setenv("CK_DEFAULT_TIMEOUT", "30", 0);
setenv("LIBINPUT_RUNNING_TEST_SUITE", "1", 1);
if (setrlimit(RLIMIT_CORE, &corelimit) != 0)
perror("WARNING: Core dumps not disabled");
enum litest_runner_result result = litest_run(&all_test_suites);
litest_free_test_list(&all_test_suites);