Go into your project folder and type:
git clone https://github.com/lsarrazi/ft_containers_tester.git tester && cd tester
git clone https://github.com/lsarrazi/ft_containers_tester.git tester && cd tester && ./test.sh base/*/*
Set your project path in test.sh
ftcontainers_path=".." # Path to your project headers
Your headers should be named in lowercase, like "vector.hpp".
Run all base tests
./test.sh base/*/*
Run all base tests + all bonus tests
./test.sh base/*/* bonus/*/*
Run specific container only
./test.sh base/list/*
Run specific test only
./test.sh base/list/constructor
Run debug mode (specific test only)
./test.sh debug base/list/constructor
Debug mode displays compilation errors and runs lldb in case of crash.
This script depends on the following programs: *optional
- Compiler: clang++, g++ (Could be set in test.sh)
- Debugger: lldb, gdb (Could be set in test.sh)
- Debugging tool: valgrind*
- Shell: bash
sudo apt-get install valgrind lldb-10 && ln -s /usr/bin/lldb-10 /usr/local/bin/lldb
Each test attempts to debug a particular function. The tests may depend on different functions.
You will be able to find these files in each test directory:
- log.txt: The compilation logs
- expected.txt: The output that your library should produce to succeed the test
- out.txt: The actual output that your library produce
- diff.txt: The difference between expected.txt and output.txt
- valgrind.txt: The output of valgrind
Each test is executed independently of the others in its own executable.
Tests are compiled and run in parallel to maximize performance.
The majority of the original tests are copies from https://www.cplusplus.com/reference/stl/
Here is what it looks like:
The tests provided are insufficient for a complete debugging of a standard library, as well as a correct and conscientious correction to the ft_containers project. Please consider this when using the tester.
Everyone can contribute by enhancing a test or adding a new one. Just make a pull request
- lsarrazi 👑