Skip to content

Implementation of a doubly-linked list data structure (similar to std::list) for the EDB I 2021.1 course at BTI - UFRN

Notifications You must be signed in to change notification settings

joaoguilac/linked_list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This programming project provides unit tests for the sc::list<> class. A description of the assignment can be found here.

Organization

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 file main.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 the sc::vector's methods.
  • source/include: This is the folder in which you should add the vector.h file with your solution (i.e. the implementation of the class sc::vector).
  • `source/CMakeLists.txt: The cmake script file.
  • README.md: This file.
  • docs: This folder has a pdf describing the vector project.

Compiling

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):

  1. cmake -S source -B build: asks cmake to create the build directory and generate the Unix Makefile based on the script found in source/CMakeLists.txt, on the current level.
  2. cmake --build build: triggers the compiling process that creates both targets (executable).D inside build.

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.

Compiling without cmake

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

Running

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

Authorship

Program developed by Selan ([email protected]), 2021.1

© DIMAp/UFRN 2016-2021.

About

Implementation of a doubly-linked list data structure (similar to std::list) for the EDB I 2021.1 course at BTI - UFRN

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published