mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-05-28 15:34:31 +00:00
feat(userspace/apps/test/utest): add TestProcess function for executing test programs
Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
parent
e003af38ff
commit
4d333f94bc
@ -15,7 +15,8 @@
|
|||||||
"userspace/libc",
|
"userspace/libc",
|
||||||
"userspace/libs/libdemo",
|
"userspace/libs/libdemo",
|
||||||
"vscode",
|
"vscode",
|
||||||
"userspace/apps/sys/init"
|
"userspace/apps/sys/init",
|
||||||
|
"userspace/apps/test/utest"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
Userspace/apps/test/utest/fb/fb.c
Normal file
4
Userspace/apps/test/utest/fb/fb.c
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
int fb_main()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
@ -860,13 +860,46 @@ void fork_bomb_syscall()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestProcess(const char *program, char *const argv[])
|
||||||
|
{
|
||||||
|
printf("testing: %s\n", program);
|
||||||
|
pid_t pid = fork();
|
||||||
|
if (pid == 0)
|
||||||
|
{
|
||||||
|
execvp(program, argv);
|
||||||
|
perror("execvp");
|
||||||
|
}
|
||||||
|
else if (pid < 0)
|
||||||
|
perror("fork");
|
||||||
|
fflush(stderr);
|
||||||
|
}
|
||||||
|
|
||||||
|
extern int simd_main();
|
||||||
|
extern int web_main();
|
||||||
|
extern int fb_main();
|
||||||
|
|
||||||
int main(int argc, char *argv[], char *envp[])
|
int main(int argc, char *argv[], char *envp[])
|
||||||
{
|
{
|
||||||
if (argv[1] != NULL && strcmp(argv[1], "loop") == 0)
|
if (argv[1] != NULL)
|
||||||
{
|
{
|
||||||
printf("[%d] Looping...\n", getpid());
|
if (strcmp(argv[1], "loop") == 0)
|
||||||
while (1)
|
{
|
||||||
;
|
printf("[%d] Looping...\n", getpid());
|
||||||
|
while (1)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strcmp(argv[1], "--kernel") == 0)
|
||||||
|
{
|
||||||
|
printf("- Starting full tests...\n");
|
||||||
|
TestProcess("/bin/libc_test", NULL);
|
||||||
|
printf("- test: simd");
|
||||||
|
simd_main();
|
||||||
|
printf("- test: web");
|
||||||
|
web_main();
|
||||||
|
printf("- test: framebuffer");
|
||||||
|
fb_main();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("- Testing userspace...\n");
|
printf("- Testing userspace...\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user