A comprehensive testing suite for your Libft project! This tester helps you verify both the mandatory and bonus functions of your Libft implementation.
- First, clone the tester repository in your home directory:
cd ~
git clone https://github.com/MoulatiMehdi/libft-test.git libft-test
⚠️ Make sure to clone it aslibft-testto ensure the default make commands work properly!⚠️ Make sure that all the your functions are in your libft.h!
Navigate to your libft directory where all your .c files are located:
cd path/to/your/libftTo test all functions in your libft:
make -f ~/libft-test/MakefileTo test a specific function or group of functions:
make -f ~/libft-test/Makefile [function_name]Examples (run these from your libft directory):
# Test individual functions
make -f ~/libft-test/Makefile atoi # Tests ft_atoi
make -f ~/libft-test/Makefile strlen # Tests ft_strlen
# Test function groups
make -f ~/libft-test/Makefile is # Tests all is* functions (isalpha, isdigit, etc.)
make -f ~/libft-test/Makefile to # Tests all to* functions (tolower, toupper)atoibzerocallocitoalstnewmemchrmemcmpmemcpymemmovememsetputchar_fdputendl_fdputnbr_fdputstr_fdsplitstrchrstrdupstriteristrjoinstrlcatstrlcpystrlenstrmapistrrchrstrtrim
You can test these groups with a single command:
IS Functions (Test all with make -f ~/libft-test/Makefile is):
isalnumisalphaisasciiisdigitisprint
TO Functions (Test all with make -f ~/libft-test/Makefile to):
tolowertoupper
~/libft-test/ # Tester location (in home directory)
your/libft/ # Your libft directory with:
├── ft_atoi.c
├── ft_isalpha.c
├── ft_tolower.c
├── libft.h
└── ... (other source files)
If you encounter any issues with the make command, verify that:
- The tester is cloned in your home directory as
libft-test - You're running the commands from your libft directory where your
.cfiles are located - Your libft.h header file is properly included
- All your functions are properly prefixed with
ft_ - Your source files are compiled and up to date
- The tester assumes your functions follow the 42 naming convention (prefixed with
ft_) - All tests must compile without any warnings or errors
- You can test individual functions or use group commands (
isorto) - Using
iswill test all isalpha, isdigit, isalnum, isascii, and isprint functions - Using
towill test both tolower and toupper functions - Make sure all your source files are saved before running tests
If you find any bugs or have suggestions for improvement, please open an issue in the repository!
Happy testing! 🎉