Brief project description or introduction here.
/src/:
/tests/:
src/
structure)Welcome to the BLOCK14PG project repository. This document provides instructions on how to build the main project source code and execute unit tests.
CMake: Ensure you have CMake installed and available from the command line.
brew install cmake
choco install cmake
Compiler: Ensure a C++ compiler is installed suitable for your platform, e.g., MinGW for Windows or GCC for Linux.
Google Test Framework: This is essential for our unit tests.
git clone https://github.com/google/googletest.git
Navigate to the src
directory:
cd path/to/BLOCK14PG/src
Create a build directory (if it doesn't exist) and navigate into it:
mkdir build
cd build
Configure the project using CMake. Adapt the generator as per your build system:
cmake .. -G "MinGW Makefiles" # For Windows with MinGW
Compile the project:
mingw32-make # For Windows with MinGW
The compiled executable can be found within the build
directory. Navigate there to run the program.
Make sure the prerequisites mentioned above are met.
Add your test case in the valid_test_cases
folder or invalid_test_cases
folder.
For Unit Test Contributors:
Edit the project's root CMakeLists.txt
to include your test executable:
# Add test executable
add_executable(runUnitTests tests/test_main.cpp ${source})
target_link_libraries(runUnitTests gtest gtest_main)
Create or modify tests/test_main.cpp
or another preferred file name.
Navigate to the googletest
directory, then to build
. If the build
directory doesn't exist, create it:
cd googletest
mkdir -p build
cd build
Configure the project using CMake:
cmake ..
Compile the tests:
make
Run the tests:
./runUnitTests
We've integrated Cppcheck for static code analysis to maintain code quality. Before committing any changes, it's recommended to run Cppcheck locally to spot any potential issues.
Install Cppcheck on your machine. For most platforms, you can find installation instructions on the official Cppcheck website.
Navigate to your project directory in the terminal or command prompt.
Use the following command to run Cppcheck:
src/
with C++11 standard:
cppcheck --enable=all --std=c++11 src/
tests/
with C++17 standard:
cppcheck --enable=all --std=c++17 tests/
Make sure you've resolved any warnings or errors flagged by Cppcheck before making a commit.
If you're a first-time user, the tool might report some false positives or suggest micro-optimizations. Focus on genuine issues or bugs it highlights.
In case you encounter a lot of "missing include" notifications, you can add --suppress=missingIncludeSystem
to the command to suppress them. However, these are typically informational and can be ignored.
In BLOCK14PG, we use GitHub Actions to ensure that our codebase remains consistent and reliable. This helps us detect and fix issues early in the development process, improving the overall quality of our software.
Our CI is configured to test the code in the following environments:
clang++
compiler.g++
compiler.To see the CI status for recent commits, navigate to the Actions
tab in our GitHub repository.
For collaborators:
If you encounter an issue or have suggestions, please discuss it with the team or mention it in our internal communication channels.
To be added: "Getting Started", "Installation", "Usage", etc.