This programming project provides unit tests for the sc::list<>
class. A description of the assignment can be found here.
The folders and files of this project are the following:
source/tests/tm
: This is the library that provides supports for the unit tests. Do not change or delete this folder.source/tests
: This folder has the filemain.cpp
that contains all the tests. You might want to change this file and comment out some of the tests while you have not finished all thesc::vector
's methods.source/include
: This is the folder in which you should add thevector.h
file with your solution (i.e. the implementation of the classsc::vector
).- `source/CMakeLists.txt: The cmake script file.
README.md
: This file.docs
: This folder has a pdf describing the vector project.
This project may be compiled with CMake. CMake is an open-source, cross-platform family of tools designed to build, test and package software. Basically, cmake reads a script (CMakeLists.txt
) with meta-information on the project and creates a Makefile automatically, tailored to your system configuration.
After that, you may run the make
command, as usual.
Alternatively, the same script might be used to create Xcode projects, Ninja, or Microsoft Visual Studio projects, for instance.
CMake supports out-of-source build. This means the source code is stored in one folder and the generated executable files should be stored in another folder: project should never mix-up the source tree with the build tree.
In particular, this project creates a single target (executable), called all_tests
.
But don't worry, they are already set up in the CMakeLists.txt
script.
To compile this project with cmake follow these steps (from the root folder):
cmake -S source -B build
: asks cmake to create the build directory and generate the Unix Makefile based on the script found insource/CMakeLists.txt
, on the current level.cmake --build build
: triggers the compiling process that creates both targets (executable).D insidebuild
.
The executable is created inside the build
directory.
For further details, please refer to the cmake documentation website.
NOTE however, that this project may compile at first but the tests will most certainly fail.
We have in this project two batches of tests: 24 unit tests for the sc::list
class, and 9 unit tests for the sc::list::iterator
class, and 22 tests for the utility operations. You should try to get passed all these tests.
If you wish to compile this project without the cmake, create the build
folder manually (mkdir build
), then try to run the command below:
g++ -Wall -std=c++11 -I source/include -I source/tests/tm source/tests/main.cpp source/tests/tm/test_manager.cpp -o build/all_tests
From the project's root folder, run as usual (assuming $
is the terminal prompt):
$ ./build/tests/all_tests #with cmake
$ ./build/all_tests #without cmake
Program developed by Selan ([email protected]), 2021.1
© DIMAp/UFRN 2016-2021.