Finalize the scheduling test program.

This commit is contained in:
Enrico Fraccaroli
2023-04-19 14:24:32 +02:00
parent cf0001fca6
commit 6ca621d506
7 changed files with 27 additions and 143 deletions
+5 -6
View File
@@ -61,17 +61,17 @@ set(MENTOS_TESTS_DIR ${CMAKE_SOURCE_DIR}/files/bin/tests)
set(TESTS
t_mem.c
t_fork.c
# Real-time programs
# Test real-time programs.
t_periodic1.c
t_periodic2.c
t_periodic3.c
# Exec
# Testing task execution.
t_exec.c
t_exec_callee.c
# Test environmental variables.
t_setenv.c
t_getenv.c
# Test: signals.
# Test signals.
t_stopcont.c
t_sigusr.c
t_abort.c
@@ -85,9 +85,8 @@ set(TESTS
t_kill.c
t_itimer.c
t_gid.c
# Testing my program
myProg.c
# Test scheduling feedback tests.
t_schedfb.c
)
foreach(TEST ${TESTS})
-7
View File
@@ -1,7 +0,0 @@
#include <stdio.h>
int main(void)
{
printf("File di test\n");
return 0;
}
+22
View File
@@ -0,0 +1,22 @@
/// @file t_schedfb.c
/// @brief Start the scheduler feedback session.
/// @copyright (c) 2014-2022 This file is distributed under the MIT License.
/// See LICENSE.md for details.
#include <sys/unistd.h>
#include <sys/wait.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
pid_t cpid;
printf("First test, the child will sleep, thus, they will not be scheduled.\n");
for (int i = 0; i < 10; ++i) {
if ((cpid = fork()) == 0) {
execl("/bin/tests/t_alarm", "t_alarm", NULL);
return 0;
}
}
while (wait(NULL) != -1) continue;
return 0;
}