Yes another Tester for ft_containers! This one is written completely in C++98 and can be executed trough make
git clone https://github.com/toni-schmitt/ft_containers-modular-tester.git
- Clone the tester into your ft_containers directory.
- If needed: Configure the Path to your .hpp files in the Makefile. (
make config
for help)
- If needed: Configure the Path to your .hpp files in the Makefile. (
- Print all available commands with
make help
- Test until everythig is Successful
- Execute all tests with
make test
- Execute a single test with
make test C=container T=test
(for example:make test C=vector T=modifiers
ormake test CONTAINER=vector TEST=modifiers
) - Execute all tests without Benchmarking with
make no_bench
- Execute all tests with
Adding a Test Case is super easy, just follow these steps (I added 'insert_basic' Test Case to 'vector')
Show Description
- Add a
.hpp
file undertests/src/tests/[Container]
([Container]
being the Container you want to add a Test Case) (it is advised to follow the existing Naming Convention for your newly added.hpp
file) - Copy the contents from
tests/src/tests/example_test.hpp
into your newly added.hpp
file - Modify the copied content in your newly added
.hpp
file- Modify
CONTAINER_NAME
to the Container ([Container]
) you wanted to add a Test Case to- Important:
CONTAINER_NAME
has to be the same as[Container]
(the Folder)
- Important:
- Modify
TEST_CASE_NAME
to your Test Case Name (the Name does not have to be the same as the.hpp
file, but it is advised to do so)
- Modify
- Add your own Tests
- Every Test works with log files, it is advised to write a lot of stuff into these log files
- You can write to the Log file with
ofs
and with thewrite::
namespace defined intests/src/utility/write.hpp
- You can write to the Log file with
- Every Test works with log files, it is advised to write a lot of stuff into these log files
Show Description
- Go to
tests/src/tests/[Container]/test_objects.hpp
#include
you newly added.hpp
file- Find the correct place for the new Test Object
- The Test Objects are orderd alphabetically, first listing
generic::
Test Objects (if any) and then listing[Container]::
Test Objects
- The Test Objects are orderd alphabetically, first listing
- Add a Test Object for
::std[]
(with Template parameterContainerSTD
) - Add a Test Object for
::ft[]
(with Template parameterContainerFT
)