A comprehensive and strict tester for the 42 ft_printf project. It supports both Mandatory and Bonus parts, includes memory leak detection via Valgrind, and generates detailed logs for debugging.
Ensure that the folder of this tester (printf_tester) is located INSIDE the root of your ft_printf project.
Correct Directory Structure:
/ft_printf_root
βββ Makefile
βββ ft_printf.h
βββ *.c (your source files)
βββ printf_tester/ <--- YOU ARE HERE
βββ .launch.sh
βββ Makefile
βββ README.md
βββ CHANGELOG.md
βββ test_result.log
βββ srcs
Important: To avoid accidentally committing the tester to your repository, add printf_tester/ to your .gitignore file:
echo "printf_tester/" >> .gitignoreEnsure that the path is right and set a proper timeout time INSIDE the launch.sh file
SOURCE_PATH="../"
TIME=3 (valgrind has x3)
The tester supports different modes and optional integration with Valgrind.
Command,Description
make,Runs ALL tests (Mandatory + Bonus).
make m,Runs MANDATORY tests only.
make b,Runs BONUS tests only.
Command,Description
make val,Runs ALL tests with Valgrind checks.
make m val,Runs MANDATORY tests with Valgrind.
make b val,Runs BONUS tests with Valgrind.
[OK] : The printed output and the return value (ret) are identical to the original printf.
[KO] : There is a discrepancy. Check the log file for details.
If Valgrind is active:
[MOK] : Memory OK. No leaks and no invalid memory access errors.
[MKO] : Memory KO. Leaks, invalid read/write, or uninitialized variables found.
Test ID: 87 [Bonus #] -> KO
ORIG Str: ' 0xa' <-- What printf printed
USER Str: '0x a' <-- What your ft_printf printed
ORIG Ret: 5 <-- Return value of printf
USER Ret: 7 <-- Return value of ft_printf
Happy debugging!π₯οΈ
Explore my full suite of testers: