Torchinette is a tester for libft, designed to thoroughly verify each function in your library. With its user-friendly interface and detailed tests, Torchinette helps you validate your libft implementation.
- GCC
- Make
- Norminette
- Your libft must be in a folder named
libft
at the project root - All mandatory libft files must be present
- Clone the repository:
git clone https://github.com/arnaudderison/libft-torchinette torchinette
- Enter the directory:
cd torchinette
- Place your libft in the appropriate folder:
cp -r [PATH_TO_YOUR_LIBFT] ./libft
To compile and run all tests:
make
This will:
- Check for all required libft files
- Compile the libft if all files are present
- Compile the tester
- Run all tests automatically
make
: Checks files, compiles the project and runs testsmake check
: Verifies the presence of all required libft filesmake libft.a
: Compiles only the libftmake norm
: Checks the norminette for libftmake clean
: Removes object filesmake fclean
: Removes object files and executablemake re
: Fully recompiles the projectmake help
: Displays all available commands
The following files must be present in your libft folder:
ft_atoi.c ft_isascii.c ft_memchr.c ft_strchr.c ft_strnstr.c
ft_bzero.c ft_isdigit.c ft_memcmp.c ft_strdup.c ft_strrchr.c
ft_calloc.c ft_isprint.c ft_memcpy.c ft_strlcat.c ft_tolower.c
ft_isalnum.c ft_memset.c ft_memmove.c ft_strlcpy.c ft_toupper.c
ft_isalpha.c ft_strlen.c ft_strncmp.c libft.h
- isalpha, isdigit, isalnum, isascii, isprint
- strlen, memset, bzero, memcpy, memmove
- strlcpy, strlcat
- toupper, tolower
- strchr, strrchr
- strncmp, memchr, memcmp
- strnstr, atoi
- strdup
- calloc
- substr, strjoin
- strtrim
- split
- itoa
- strmapi
- striteri
- putchar_fd, putstr_fd, putendl_fd, putnbr_fd
The tester uses color codes for better readability:
- 🟢 Green: Test passed
- 🔴 Red: Test failed
- 🟡 Yellow: Information messages
The libft bonus functions will soon be tested:
ft_lstnew
ft_lstadd_front
ft_lstsize
ft_lstlast
ft_lstadd_back
ft_lstdelone
ft_lstclear
ft_lstiter
ft_lstmap
A new educational mode will be added to:
- Explain each encountered error in detail
- Propose solutions and approaches to fix bugs
- Provide concrete examples of correct usage
Error Type | Useful Resources |
---|---|
Segmentation fault | Understanding and debugging segfaults |
Memory leaks | Valgrind and memory management |
Buffer overflow | Protection against overflows |
Undefined behavior | Undefined behaviors in C |
- 📖 C Reference Manual
- 🔍 Pointers in C explained simply
- 🧮 Memory manipulation in C
- 📝 Coding best practices
- GDB: Basic usage guide
- Valgrind: Detecting memory leaks
- LLDB: GDB alternative for MacOS
- 42 Help Forum
- Dedicated Discord channel (coming soon)
- Weekly code review sessions (coming soon)
- Add bonus function tests
- Implement educational mode
- Improve error messages
- Enhanced user interface
- Performance tests
- Interactive debug mode
- Multilingual support
- Customizable tests
- CI/CD integration
We're open to your suggestions! Here are some currently under consideration:
- Verbose mode for more detailed test information
- Additional edge case tests
- Compatibility with other 42 projects
Contributions are welcome! Feel free to:
- Fork the project
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
If you find a bug, please create a detailed issue including:
- Bug description
- Steps to reproduce
- Expected behavior
- Screenshots if possible
This project is under free license.
- @aderison - Creator and maintainer
- To the 42 community for their support
- To all project contributors
"Let Torchinette light your way to a perfect libft!" 🔥