From c8b55b3fd4924abcdf919458b0d8adb0ec00b0f2 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Tue, 26 Jul 2022 23:23:50 +0200 Subject: user: break out the shell and tests into separate binaries --- src/user/app/init/tests/stress.c | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 src/user/app/init/tests/stress.c (limited to 'src/user/app/init/tests/stress.c') diff --git a/src/user/app/init/tests/stress.c b/src/user/app/init/tests/stress.c deleted file mode 100644 index 9be88d7..0000000 --- a/src/user/app/init/tests/stress.c +++ /dev/null @@ -1,28 +0,0 @@ -#define TEST_MACROS -#include "tests.h" -#include -#include -#include - -static void run_forked(void (*fn)()) { - if (!fork()) { - fn(); - exit(0); - } else { - /* successful tests must return 0 - * TODO add a better fail msg */ - if (_syscall_await() != 0) test_fail(); - } -} - - -static void stress_fork(void) { - for (size_t i = 0; i < 2048; i++) { - if (!fork()) exit(0); - _syscall_await(); - } -} - -void stress_all(void) { - run_forked(stress_fork); -} -- cgit v1.2.3