15 Commits

Author SHA1 Message Date
94691e11fd fix pipeline error
All checks were successful
Build and Test verification / build (push) Successful in 22s
Build and Test verification / test (push) Successful in 4s
2026-05-08 14:42:33 -05:00
84756b46fb change pipeline name 2026-05-08 14:29:48 -05:00
a36faa6c0e github actions are dumb
All checks were successful
Build and Test verification / build (push) Successful in 22s
Build and Test verification / test (push) Successful in 4s
2026-05-08 14:27:31 -05:00
a138c4b3c5 bundle into single job
Some checks failed
Build and Test verification / build (push) Successful in 22s
Build and Test verification / test (push) Failing after 3s
2026-05-08 14:24:09 -05:00
7deabb42e2 gcovr grrr
Some checks failed
Build and Test verification / build (push) Successful in 22s
Build and Test verification / test (push) Failing after 3s
2026-05-08 14:08:19 -05:00
2349fdbcab gcovr scan path
Some checks failed
Build and Test verification / build (push) Successful in 22s
Build and Test verification / test (push) Failing after 3s
2026-05-08 13:31:24 -05:00
d0f5869f26 make artifacts executable
Some checks failed
Build and Test verification / build (push) Successful in 22s
Build and Test verification / test (push) Failing after 3s
2026-05-08 12:04:32 -05:00
b7af7d3df4 extract to path
Some checks failed
Build and Test verification / build (push) Successful in 22s
Build and Test verification / test (push) Failing after 2s
2026-05-08 12:01:16 -05:00
ee46c8418b pipeline testing
Some checks failed
Build and Test verification / build (push) Successful in 22s
Build and Test verification / test (push) Failing after 2s
2026-05-08 11:56:33 -05:00
8cae87cf1b test script syntax
Some checks failed
Build and Test verification / build (push) Successful in 22s
Build and Test verification / test (push) Failing after 2s
2026-05-08 11:43:23 -05:00
caad6c598c i know how to use cmake i promise
Some checks failed
Build and Test verification / build (push) Successful in 22s
Build and Test verification / test (push) Failing after 3s
2026-05-08 11:41:17 -05:00
4a44f76392 add gitea action for build and test
Some checks failed
Build and Test verification / build (push) Failing after 6s
Build and Test verification / test (push) Has been skipped
2026-05-08 11:39:49 -05:00
b7e509ce96 add build and test instructions to readme 2026-05-07 23:56:48 -05:00
35cc73b04f add testing infrastructure 2026-05-06 23:05:14 -05:00
dc7ebdbb73 file structure and hello world program 2026-05-06 22:18:03 -05:00
12 changed files with 243 additions and 5 deletions

View File

@@ -0,0 +1,59 @@
name: Build and Test verification
run-name: "${{ gitea.actor }}: Build & Test on ${{ gitea.ref_name }}"
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: clone
uses: actions/checkout@v3
- name: container-setup
run: container-setup.sh
- name: download
uses: actions/download-artifact@v3
with:
name: build-artifact
path: build
- name: make_executable
run: chmod -R +x ./build
- name: run_unit_tests
run: |
cd build
ctest -T Test
- name: code_coverage
run: |
cd build
gcovr -r .. --filter "../src"

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
build/*
Testing/*

55
CMakeLists.txt Normal file
View File

@@ -0,0 +1,55 @@
cmake_minimum_required(VERSION 3.23)
project(maiden)
set(CMAKE_CXX_STANDARD 20)
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
)
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_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)

View File

@@ -8,12 +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

0
assets/.gitkeep Normal file
View File

0
config/.gitkeep Normal file
View File

0
lib/.gitkeep Normal file
View File

0
scripts/build.sh Normal file
View File

18
src/App.cpp Normal file
View File

@@ -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;
}

19
src/App.hpp Normal file
View File

@@ -0,0 +1,19 @@
#pragma once
#include <iostream>
#include <cstdint>
class App {
public:
App() = default;
~App() = default;
void run();
private:
int32_t foo();
};

14
src/main.cpp Normal file
View File

@@ -0,0 +1,14 @@
#include <iostream>
#include "App.hpp"
int main(int argc, char** argv) {
std::cout << "hi mom !" << std::endl;
App app;
app.run();
return 0;
}

36
test/TestApp.cpp Normal file
View File

@@ -0,0 +1,36 @@
#include <gmock/gmock.h>
#include <memory>
#define private public
#include <App.hpp>
#undef private
class TestApp : public testing::Test {
protected:
void createUut() {
uut_ = std::make_unique<App>();
}
std::unique_ptr<App> 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);
}