Welcome to Civ Zero! This project is a C++ application that includes unit testing and coverage reports. Below are the instructions to get started with this project.
Ensure you have the following installed on your system:
- A C++ compiler (
g++orclang++) makeutility
Before you can compile and run the project, you need to set up the project structure. This includes creating the necessary directories and downloading any required dependencies.
To set up the project, run:
make setupThis command will:
- Create the source, build, binary, docs, and tests directories.
- Generate a basic
main.cppfile in thesrcdirectory. - Download
doctest.h(for unit testing) into thetestsdirectory. - Create a sample test file in the
testsdirectory.
Once the setup is complete, you can compile and run the project.
To compile and run the project, use the following command:
make runTo run the unit tests, use the following command:
make testTo generate a code coverage report, use the following command:
make coverageThe coverage report will be generated in the coverage directory as an HTML file.
To clean the build artifacts, you can run:
make cleanThis will remove all compiled files and the coverage reports.
We are following a structured branching model to ensure smooth collaboration and maintain code quality across our project.
-
main: The main production-ready branch. -
dev: All features and hotfixes are integrated here before merging intomain. -
feature/your-feature: For developing new features. When working on a feature, follow this workflow:- Create a
feature/your-featurebranch fromdev. - You can commit directly to the feature branch without creating sub-branches. If you prefer, you can create sub-branches for specific tasks, such as
feature/your-feature/subtask.
- Create a
-
hotfix/your-hotfix: For urgent fixes. You can push directly to ahotfix/*branch, or if needed, create sub-branches such ashotfix/your-hotfix/subtask.
-
Working in a Feature Branch:
- Create a feature branch from
dev(e.g.,feature/your-feature). - You can commit directly to the feature branch. If desired, you can create sub-branches (e.g.,
feature/your-feature/subtask). - Once the feature is complete, submit a pull request to merge the feature branch into
dev.
- Create a feature branch from
-
Working with Hotfixes:
- For urgent fixes, create a branch directly from
mainordevwith the naming conventionhotfix/your-hotfix. - You can push directly to the
hotfix/*branch, or optionally create sub-branches (e.g.,hotfix/your-hotfix/subtask), and then create a pull request to merge intodevandmain.
- For urgent fixes, create a branch directly from
-
main:- No direct pushes allowed; all changes must go through pull requests.
- Requires at least 4 approvals before merging.
- Requires linear history (no merge commits).
- Commits must be signed and verified.
-
dev:- No direct pushes allowed; changes must go through pull requests.
- Requires at least 2 approvals before merging.
- Requires linear history (no merge commits).
-
feature/*:- You can commit directly to the feature branch, or if preferred, create sub-branches for specific tasks.
- Once the feature is complete, a pull request is required to merge the feature branch into
dev.
-
hotfix/*:- You can push directly to a
hotfix/*branch, or if preferred, create sub-branches for specific tasks. - You must create a pull request to merge into
devandmain.
- You can push directly to a
This system ensures code is integrated smoothly while maintaining flexibility for individual developers during feature development.
make class CLASS=ClassName: Create a new class with header and source files.make ctest TEST=TestName: Create a new test file in thetestsdirectory.make docs: Generate Doxygen documentation.make leaks: Check for memory leaks.
We have prepared several diagrams to help visualize the architecture and flow of the project. You can access all the diagrams on our Lucid Charts team board:
Please use your tuks email for signup as there is pro version.