A comprehensive and strict tester for the 42 Libft project.
This tester includes Smart Memory Leak Detection via Valgrind. To ensure maximum speed without sacrificing safety, Valgrind is only active for functions that require memory allocation (e.g., ft_split, ft_calloc).
Standard checks (Segfaults and Timeouts) are performed on all functions.
- Smart Valgrind Integration: Runs slow memory checks only where necessary.
- Detailed Logging: Generates a
tests_log.logfile with specific failure details. - Crash & Timeout Protection: Detects segfaults and infinite loops.
- Norminette Check: Includes a quick Norminette pass.
- Forbidden Functions Check: Verifies that no forbidden functions are used in your binary.
Ensure that the folder of this tester (libft_tester) is located INSIDE the root of your libft project.
Correct Directory Structure:
/libft_root
βββ Makefile
βββ libft.h
βββ *.c (your source files)
βββ libft_tester/ <--- YOU ARE HERE
βββ .launch.sh
βββ Makefile
βββ CHANGELOG.md
βββ README.md
βββ tests_log.log (generated after run)
**Important:** To avoid accidentally committing the tester to your repository, add `libft_tester/` to your `.gitignore` file:
echo "libft_tester/" >> .gitignoreEnsure that the path is right and set a proper timeout time INSIDE the launch.sh file
TIMEOUT_TIME=5
The tester supports different modes and optional integration with Valgrind.
Command,Description
make launches tests on all libft
make "function name" launches tests only on the function
[OK] : The printed output and the return value are identical to the original.
[KO] : There is a discrepancy. Check the log file for details.
[LEAK] : There are memory leaks in your function.
[CRASH] : Your function segfaulted (Segmentation Fault).
[TIMEOUT] : Your function caused an infinite loop (adjust TIMEOUT_TIME in .sh if needed).
Many of the tests were made by AI.
I personally checked them all before publishing this tester.
If you have any doubt on the results please contact me on my email (you can find it on my GitHub main page)
Happy debugging!π₯οΈ
Explore my full suite of testers: