The Maly Libft Tester Showcase Video on Youtube (1.1.0)
Currently up-to-date with Libft subject version 19.2.
A fast, cross-platform (Linux/macOS) Libft tester for 42 students. This tester executes over 500 tests in under 0.02 seconds.
- Prerequisites
- Building and Running the Tester
- What this tester DOES check
- What this tester does NOT check
- Setting up automated tests in your Makefile
- Acknowledgments
- Linux or MacOS
- GCC or Clang compiler
- Your compiled libft.a library
Use the provided build.sh script.
Pass the path to your compiled libft.a archive as the only argument.
./build.sh <path/to/libft.a>Run the tester:
./testerFor more information about command-line arguments that can be parsed, run:
./tester help- Checks correct outputs for all Libft functions.
- Checks memory leaks (using linker-level wrapping on Linux and flat namespace overrides on macOS).
- Checks segmentation faults, timeouts, bus errors, double frees using process isolation.
- Provides detailed hex and string memory dumps in failed_reports.txt for any failed tests.
- Does NOT check if your libft project was written in accordance with the 42 Norm.
- Does NOT check your libft project's Makefile and its rules, flags, relinking, etc.
- Does NOT check if you declared any global variables in your project.
- Does NOT check if you used any unallowed functions in your project.
- Does NOT check for any README requirements.
Create one variable for the Tester's directory path and one for optional Tester's arguments.
# Example setup
TESTER_DIRECTORY_PATH := ../maly_libft_tester
TESTER_ARGUMENTS := --set-timeout-ms 50Create a new rule named test:
test: $(NAME)
$(TESTER_DIRECTORY_PATH)/build.sh ./$(NAME)
./tester $(TESTER_ARGUMENTS)And declare it as .PHONY so it always runs:
.PHONY: all clean fclean re testAdd the compiled tester executable to your existing fclean rule so it gets properly removed alongside your library:
fclean: clean
$(RM) $(NAME)
$(RM) testerThat is it!
The base and OS layers of this project are derived from RADDebugger by Epic Games. I would like to thank the RAD team for sharing their high-quality code, which significantly improved the robustness and portability of this tester.
