git clone https://github.com/kichkiro/philosophers_tester.git
cd philosophers_tester
pip3 install -r requirements.txt
python3 src/__main__.py [project path]
python3 src/__main__.py [project path]
The tester performs the following tests:
- make:
- compile the project.
- norminette:
- run norminette.
- global variables:
- check if global variables are present.
- death_1:
- test the program with a single philosopher, it should die in the following sequence:
- timestamp_in_ms X has taken a fork
- timestamp_in_ms X died
- test the program with a single philosopher, it should die in the following sequence:
- death_2:
- in this test, no philosopher should die.
- death_3:
- in this test, a philosopher should die.
- Valgrind Memcheck:
- to check for memory leaks.
- Valgrind Helgrind:
- to check for concurrency issues such as, race conditions and deadlocks.
- Thread Sanitize:
- recompile the program with the -fsanitize=thread option. ThreadSanitize is another concurrency error checking tool.
IF n_philo == 1;
ELIF n_philo > 1:
IF n_philo % 2 == 0:
IF time_to_die < (time_to_eat + time_to_sleep);
IF time_to_eat > (time_to_die / 2);
ELIF n_philo % 2 == 1:
IF time_to_die < (time_to_eat + time_to_sleep);
IF time_to_eat > (time_to_die / 3);
To report bugs or recommend improvements, contact me:
- Slack: kichkiro
- E-Mail: kichkiro@student.42firenze.it
See LICENSE