Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Sfabi28/printf_tester

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ft_printf Tester

Last Commit

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.

📁 1. Installation

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/" >> .gitignore

Ensure that the path is right and set a proper timeout time INSIDE the launch.sh file

   SOURCE_PATH="../"
   TIME=3 (valgrind has x3)

⚙️ 2. Usage Commands


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.

📊 3. Results Legend


[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.

📝 4. Debugging with Logs


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!🖥️

🛠️ More 42 Tools

Explore my full suite of testers:

libft get_next_line push_swap

About

A comprehensive Printf Tester for 42 students. Includes strict tests, unit testing, and smart Valgrind memory leak checks.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.