From dc7ebdbb73fc546e507c849e710615dea976d9e6 Mon Sep 17 00:00:00 2001 From: homeburger Date: Wed, 6 May 2026 22:18:03 -0500 Subject: [PATCH 01/14] file structure and hello world program --- .gitignore | 2 ++ CMakeLists.txt | 25 +++++++++++++++++++++++++ README.md | 2 -- assets/.gitkeep | 0 config/.gitkeep | 0 lib/.gitkeep | 0 scripts/build.sh | 0 src/main.cpp | 9 +++++++++ 8 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 assets/.gitkeep create mode 100644 config/.gitkeep create mode 100644 lib/.gitkeep create mode 100644 scripts/build.sh create mode 100644 src/main.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c4f0d1e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +build/* diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..7f62281 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,25 @@ + +cmake_minimum_required(VERSION 3.10) + +project(maiden) + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR}) + +# add_subdirectory() to nest CMakeLists + +add_executable(maiden + src/main.cpp + # include extra source files here +) + +target_include_directories(maiden PRIVATE + "${CMAKE_CURRENT_SOURCE_DIR}/src" + # add additional include directories here +) + +target_link_libraries(maiden PRIVATE + # add libraries here +) diff --git a/README.md b/README.md index e6fa26c..12a1452 100644 --- a/README.md +++ b/README.md @@ -15,5 +15,3 @@ The maiden project is a GPU accelerated 3D rendering engine built with C++ based ## Development Roadmap ### lots of todo here - - diff --git a/assets/.gitkeep b/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/config/.gitkeep b/config/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/lib/.gitkeep b/lib/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100644 index 0000000..e69de29 diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..6e7b57f --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,9 @@ + +#include + +int main(int argc, char** argv) { + + std::cout << "hi mom !" << std::endl; + + return 0; +} -- 2.49.1 From 35cc73b04f05126b4e7697f51c83ed55f834d20a Mon Sep 17 00:00:00 2001 From: homeburger Date: Wed, 6 May 2026 23:05:14 -0500 Subject: [PATCH 02/14] add testing infrastructure --- .gitignore | 1 + CMakeLists.txt | 28 +++++++++++++++++++++++++--- src/App.cpp | 18 ++++++++++++++++++ src/App.hpp | 19 +++++++++++++++++++ src/main.cpp | 5 +++++ test/TestApp.cpp | 36 ++++++++++++++++++++++++++++++++++++ 6 files changed, 104 insertions(+), 3 deletions(-) create mode 100644 src/App.cpp create mode 100644 src/App.hpp create mode 100644 test/TestApp.cpp diff --git a/.gitignore b/.gitignore index c4f0d1e..3394524 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ build/* +Testing/* diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f62281..3c3321f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.23) project(maiden) @@ -8,18 +8,40 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR}) +# gtest +include(FetchContent) +FetchContent_Declare( + googletest + GIT_REPOSITORY https://github.com/google/googletest.git + GIT_TAG v1.17.x # Use a specific version tag or commit hash +) +FetchContent_MakeAvailable(googletest) + # add_subdirectory() to nest CMakeLists add_executable(maiden + src/App.cpp src/main.cpp # include extra source files here ) +add_executable(maiden_test + src/App.cpp + test/TestApp.cpp +) + target_include_directories(maiden PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src" # add additional include directories here ) -target_link_libraries(maiden PRIVATE - # add libraries here +target_include_directories(maiden_test PRIVATE + "${CMAKE_CURRENT_SOURCE_DIR}/src" ) + +target_link_libraries(maiden_test PRIVATE + GTest::gmock_main +) + +include(GoogleTest) +gtest_discover_tests(maiden_test) diff --git a/src/App.cpp b/src/App.cpp new file mode 100644 index 0000000..0026493 --- /dev/null +++ b/src/App.cpp @@ -0,0 +1,18 @@ + +#include "App.hpp" + +void App::run() { + + std::cout << "im an app and im running !!" << std::endl; + + (void)foo(); + + return; + +} + +int32_t App::foo() { + + return 12; + +} diff --git a/src/App.hpp b/src/App.hpp new file mode 100644 index 0000000..500db8c --- /dev/null +++ b/src/App.hpp @@ -0,0 +1,19 @@ + +#pragma once + +#include +#include + +class App { + + public: + App() = default; + ~App() = default; + + void run(); + + private: + + int32_t foo(); + +}; diff --git a/src/main.cpp b/src/main.cpp index 6e7b57f..80dab38 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,9 +1,14 @@ #include +#include "App.hpp" + int main(int argc, char** argv) { std::cout << "hi mom !" << std::endl; + App app; + app.run(); + return 0; } diff --git a/test/TestApp.cpp b/test/TestApp.cpp new file mode 100644 index 0000000..65159fa --- /dev/null +++ b/test/TestApp.cpp @@ -0,0 +1,36 @@ + +#include +#include + +#define private public +#include +#undef private + +class TestApp : public testing::Test { + + protected: + + void createUut() { + uut_ = std::make_unique(); + } + + std::unique_ptr uut_; + +}; + +TEST_F(TestApp, TestApp_run_nominal) { + + createUut(); + uut_->run(); + + // no expect here + +} + +TEST_F(TestApp, TestApp_foo_nominal) { + + createUut(); + + EXPECT_EQ(uut_->foo(), 12); + +} -- 2.49.1 From b7e509ce96ac892bfd9d991a1f65e4cc8cbcfb4b Mon Sep 17 00:00:00 2001 From: homeburger Date: Thu, 7 May 2026 23:56:48 -0500 Subject: [PATCH 03/14] add build and test instructions to readme --- CMakeLists.txt | 10 +++++++++- README.md | 42 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c3321f..e177d05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ include(FetchContent) FetchContent_Declare( googletest GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG v1.17.x # Use a specific version tag or commit hash + GIT_TAG v1.17.x ) FetchContent_MakeAvailable(googletest) @@ -39,9 +39,17 @@ target_include_directories(maiden_test PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src" ) +target_compile_options(maiden_test PRIVATE --coverage) +target_link_options(maiden_test PRIVATE --coverage) + +# TODO: add option for disabling tests (like if target == DEBUG then tests on, otherwise tests off) target_link_libraries(maiden_test PRIVATE + GTest::gmock GTest::gmock_main ) +include(CTest) +enable_testing() # ctest is whatever + include(GoogleTest) gtest_discover_tests(maiden_test) diff --git a/README.md b/README.md index 12a1452..27d798c 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,46 @@ The maiden project is a GPU accelerated 3D rendering engine built with C++ based ## Getting Started -### git instructions here -### build instructions here +### Clone Repository +```bash +$ git clone https://git.vxbard.net/homeburger/maiden.git + +# If there's any necessary submodules then: +$ git clone --recurse-submodules https://git.vxbard.net/homeburger/maiden.git + +# If you have already cloned the repository and you need its submodules: +$ git submodule update --init --recursive +``` +### Build +This app uses CMake and C++20, so a compatible compiler (gcc8, clang9, msvc16) are necessary. + +Most library prerequisites are handled within CMake. Any others that need to be manually installed will be described below as the project grows. + +To build the project (using default build directory "build"): +```bash +# configure +$ cmake -S . -B build # + any extra options + +# build +$ cmake --build build -j + +# execute +$ cd build +$ ./maiden +``` + +### Testing +This app uses GoogleTest for building unit tests. The below instructions use ctest and gcovr for test execution and code coverage: +```bash +# execute unit tests +$ ctest -T Test # + filter options + +# analyze code coverage +$ cd build +$ gcovr -r .. --filter "../src" +``` + ### app troubleshooting here -### testing instructions here ## Development Roadmap ### lots of todo here -- 2.49.1 From 4a44f763928e40af1ea9bf32175c90dd2efe2457 Mon Sep 17 00:00:00 2001 From: homeburger Date: Fri, 8 May 2026 11:39:49 -0500 Subject: [PATCH 04/14] add gitea action for build and test --- .gitea/workflows/build_and_test.yaml | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .gitea/workflows/build_and_test.yaml diff --git a/.gitea/workflows/build_and_test.yaml b/.gitea/workflows/build_and_test.yaml new file mode 100644 index 0000000..69c72b7 --- /dev/null +++ b/.gitea/workflows/build_and_test.yaml @@ -0,0 +1,51 @@ + +name: Build and Test verification +run-name: ${{ gitea.actor }} +on: [push] + +jobs: + build: + runs-on: debian12 + container: + image: git.vxbard.net/homeburger/bard-cpp-builder:1.0 + steps: + - name: clone + uses: actions/checkout@v3 + + - name: container-setup + run: container-setup.sh + + - name: configure + run: cmake -S . -B build + + - name: build + run: cmake build --build -j + + - name: upload + uses: actions/upload-artifact@v3 + with: + name: build-artifact + path: build/* + + test: + runs-on: debian12 + container: + image: git.vxbard.net/homeburger/bard-cpp-builder:1.0 + needs: build + steps: + - name: container-setup + run: container-setup.sh + + - name: download + uses: actions/download-artifact@v3 + with: + name: build-artifact + + - name: run_unit_tests + run: | + cd build + ctest -T Test + + - name: code_coverage + run: gcovr -r .. --filter "../src" + \ No newline at end of file -- 2.49.1 From caad6c598caaecba7cef1fca63eca0de96442cad Mon Sep 17 00:00:00 2001 From: homeburger Date: Fri, 8 May 2026 11:41:17 -0500 Subject: [PATCH 05/14] i know how to use cmake i promise --- .gitea/workflows/build_and_test.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitea/workflows/build_and_test.yaml b/.gitea/workflows/build_and_test.yaml index 69c72b7..7b4a673 100644 --- a/.gitea/workflows/build_and_test.yaml +++ b/.gitea/workflows/build_and_test.yaml @@ -19,7 +19,7 @@ jobs: run: cmake -S . -B build - name: build - run: cmake build --build -j + run: cmake --build build -j - name: upload uses: actions/upload-artifact@v3 @@ -48,4 +48,3 @@ jobs: - name: code_coverage run: gcovr -r .. --filter "../src" - \ No newline at end of file -- 2.49.1 From 8cae87cf1b2e486a6fee860c7ca8346e215bdae7 Mon Sep 17 00:00:00 2001 From: homeburger Date: Fri, 8 May 2026 11:43:23 -0500 Subject: [PATCH 06/14] test script syntax --- .gitea/workflows/build_and_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build_and_test.yaml b/.gitea/workflows/build_and_test.yaml index 7b4a673..c3697db 100644 --- a/.gitea/workflows/build_and_test.yaml +++ b/.gitea/workflows/build_and_test.yaml @@ -43,7 +43,7 @@ jobs: - name: run_unit_tests run: | - cd build + cd build-artifact ctest -T Test - name: code_coverage -- 2.49.1 From ee46c8418bb008f48377bd505078c65bb6747b7f Mon Sep 17 00:00:00 2001 From: homeburger Date: Fri, 8 May 2026 11:56:33 -0500 Subject: [PATCH 07/14] pipeline testing --- .gitea/workflows/build_and_test.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build_and_test.yaml b/.gitea/workflows/build_and_test.yaml index c3697db..a68397a 100644 --- a/.gitea/workflows/build_and_test.yaml +++ b/.gitea/workflows/build_and_test.yaml @@ -25,7 +25,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: build-artifact - path: build/* + path: build test: runs-on: debian12 @@ -43,7 +43,8 @@ jobs: - name: run_unit_tests run: | - cd build-artifact + ls -al + cd build ctest -T Test - name: code_coverage -- 2.49.1 From b7af7d3df429d9e57a5580ea124643a8de658b17 Mon Sep 17 00:00:00 2001 From: homeburger Date: Fri, 8 May 2026 12:01:16 -0500 Subject: [PATCH 08/14] extract to path --- .gitea/workflows/build_and_test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/build_and_test.yaml b/.gitea/workflows/build_and_test.yaml index a68397a..2880866 100644 --- a/.gitea/workflows/build_and_test.yaml +++ b/.gitea/workflows/build_and_test.yaml @@ -40,6 +40,7 @@ jobs: uses: actions/download-artifact@v3 with: name: build-artifact + path: build - name: run_unit_tests run: | -- 2.49.1 From d0f5869f26703d6aa963b3cf25613851bbc68e2e Mon Sep 17 00:00:00 2001 From: homeburger Date: Fri, 8 May 2026 12:04:32 -0500 Subject: [PATCH 09/14] make artifacts executable --- .gitea/workflows/build_and_test.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build_and_test.yaml b/.gitea/workflows/build_and_test.yaml index 2880866..1a644f6 100644 --- a/.gitea/workflows/build_and_test.yaml +++ b/.gitea/workflows/build_and_test.yaml @@ -42,9 +42,11 @@ jobs: name: build-artifact path: build + - name: Make Executable + run: chmod -R +x ./build + - name: run_unit_tests run: | - ls -al cd build ctest -T Test -- 2.49.1 From 2349fdbcab71d47047be1cffe7dee4a65f670d2a Mon Sep 17 00:00:00 2001 From: homeburger Date: Fri, 8 May 2026 13:31:24 -0500 Subject: [PATCH 10/14] gcovr scan path --- .gitea/workflows/build_and_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build_and_test.yaml b/.gitea/workflows/build_and_test.yaml index 1a644f6..44d7b39 100644 --- a/.gitea/workflows/build_and_test.yaml +++ b/.gitea/workflows/build_and_test.yaml @@ -51,4 +51,4 @@ jobs: ctest -T Test - name: code_coverage - run: gcovr -r .. --filter "../src" + run: gcovr -r . --filter "../src" -- 2.49.1 From 7deabb42e20cc881ed7cc45c43b901e89ddc65e8 Mon Sep 17 00:00:00 2001 From: homeburger Date: Fri, 8 May 2026 14:08:19 -0500 Subject: [PATCH 11/14] gcovr grrr --- .gitea/workflows/build_and_test.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build_and_test.yaml b/.gitea/workflows/build_and_test.yaml index 44d7b39..2fe102c 100644 --- a/.gitea/workflows/build_and_test.yaml +++ b/.gitea/workflows/build_and_test.yaml @@ -51,4 +51,6 @@ jobs: ctest -T Test - name: code_coverage - run: gcovr -r . --filter "../src" + run: | + cd build + gcovr -r .. --filter "../src" -- 2.49.1 From a138c4b3c5043943bc36183338ffd022833546ea Mon Sep 17 00:00:00 2001 From: homeburger Date: Fri, 8 May 2026 14:24:09 -0500 Subject: [PATCH 12/14] bundle into single job --- .gitea/workflows/build_and_test.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitea/workflows/build_and_test.yaml b/.gitea/workflows/build_and_test.yaml index 2fe102c..ccd69a3 100644 --- a/.gitea/workflows/build_and_test.yaml +++ b/.gitea/workflows/build_and_test.yaml @@ -49,8 +49,4 @@ jobs: run: | cd build ctest -T Test - - - name: code_coverage - run: | - cd build gcovr -r .. --filter "../src" -- 2.49.1 From a36faa6c0e145affe11db6b6cb72cd3bf60c9f62 Mon Sep 17 00:00:00 2001 From: homeburger Date: Fri, 8 May 2026 14:27:31 -0500 Subject: [PATCH 13/14] github actions are dumb --- .gitea/workflows/build_and_test.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build_and_test.yaml b/.gitea/workflows/build_and_test.yaml index ccd69a3..0523671 100644 --- a/.gitea/workflows/build_and_test.yaml +++ b/.gitea/workflows/build_and_test.yaml @@ -33,6 +33,9 @@ jobs: image: git.vxbard.net/homeburger/bard-cpp-builder:1.0 needs: build steps: + - name: clone + uses: actions/checkout@v3 + - name: container-setup run: container-setup.sh @@ -42,11 +45,15 @@ jobs: name: build-artifact path: build - - name: Make Executable + - name: make_executable run: chmod -R +x ./build - name: run_unit_tests run: | cd build ctest -T Test - gcovr -r .. --filter "../src" + + - name: code_coverage + run: | + cd build + gcovr -r .. --filter "../src" -- 2.49.1 From 84756b46fb84a042eb77166c3889c260b9748673 Mon Sep 17 00:00:00 2001 From: homeburger Date: Fri, 8 May 2026 14:29:48 -0500 Subject: [PATCH 14/14] change pipeline name --- .gitea/workflows/build_and_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build_and_test.yaml b/.gitea/workflows/build_and_test.yaml index 0523671..919dc44 100644 --- a/.gitea/workflows/build_and_test.yaml +++ b/.gitea/workflows/build_and_test.yaml @@ -1,6 +1,6 @@ name: Build and Test verification -run-name: ${{ gitea.actor }} +run-name: ${{ gitea.actor }}: Build & Test on ${{ gitea.ref_name }} on: [push] jobs: -- 2.49.1