Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ _Read this at every session start (after git sync). Each row links to a detailed

- **Physics**: Jolt Physics (migrated from Bullet3). Use `EngineContext::Get()->GetPhysics()`
- **Networking**: Enabled by default (`ENABLE_NETWORKING=ON`), UDP sockets, no external deps
- **Tests**: 338 test files, 4290 tests (all pass on native Linux except 1 pre-existing MMO test)
- **Tests**: 339 test files, 4312 tests (all pass on native Linux except 1 pre-existing MMO test)
- **Editor**: 59 panels, all wired including GizmoSystem, CollaborativeEditSession, CinematicSequencer, TimeOfDay, AbilityEditor, TriggerEditor, ConditionEditor, DecalEditor
- **Rendering**: All 12 former stubs now have .cpp implementations. 6 RHI backends (D3D11, D3D12, Vulkan, OpenGL, Metal, NullRHI)
- **Post-processing**: 14 passes (Bloom, AutoExposure, Tonemapping, ColorGrading, FXAA, DOF, MotionBlur, Vignette, ChromaticAberration, FilmGrain, LensDistortion, LightShafts, LensFlare, Sharpen)
Expand Down
2 changes: 1 addition & 1 deletion .github/badges/files.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"label": "source files",
"message": "1574",
"message": "1575",
"color": "green"
}
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ SparkConsole/ ← External debug console app (named pipe communication)

Shaders/HLSL/ ← DirectX shaders (PBR, post-processing, compute)
Shaders/GLSL/ ← OpenGL shaders (experimental)
Tests/ ← 4290 unit tests across 338 files, CTest integration
Tests/ ← 4312 unit tests across 339 files, CTest integration
Templates/ ← Game module templates
Assets/ ← Demo scenes, models, scripts
```
Expand Down
2 changes: 1 addition & 1 deletion .github/prompts/build-test.prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Builds on every push/PR: Windows MSVC + Linux GCC + Linux Clang (Debug + Release

## Testing

4290 unit tests across 338 files in `Tests/` with internal framework + CTest.
4312 unit tests across 339 files in `Tests/` with internal framework + CTest.

```bash
cd build && ctest --output-on-failure # all tests
Expand Down
2 changes: 1 addition & 1 deletion .github/prompts/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ SparkConsole/ ← External debug console app (named pipe communication)

Shaders/HLSL/ ← DirectX shaders (PBR, post-processing, compute)
Shaders/GLSL/ ← OpenGL shaders (experimental)
Tests/ ← 4290 unit tests across 338 files, CTest integration
Tests/ ← 4312 unit tests across 339 files, CTest integration
Templates/ ← Game module templates
Assets/ ← Demo scenes, models, scripts
```
Expand Down
36 changes: 28 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ jobs:
# Code Coverage — GCC with lcov
# ===========================================================================
coverage:
name: "Code Coverage (GCC)"
name: "Code Coverage (GCC + per-subsystem thresholds)"
permissions:
contents: read
pull-requests: write
Expand All @@ -780,7 +780,7 @@ jobs:
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_FLAGS="--coverage -fprofile-update=atomic" -DCMAKE_C_FLAGS="--coverage -fprofile-update=atomic" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage" \
-DBUILD_TESTS=ON
-DBUILD_TESTS=ON -DBUILD_GAME_MODULES=ON
- name: Build
env:
CCACHE_COMPRESS: "true"
Expand All @@ -789,12 +789,16 @@ jobs:
- name: Test
env:
SPARK_TEST_EXCLUDE: "LoadTest_"
run: cd build && ./bin/SparkTests 2>&1 | tee ../test-output.log; tail -5 ../test-output.log
run: cd build && ./bin/SparkTests --verbose 2>&1 | tee ../test-output.log; tail -5 ../test-output.log
- name: Generate coverage
run: |
lcov --capture --directory build --output-file coverage.info --ignore-errors mismatch,mismatch,gcov,negative --rc geninfo_unexecuted_blocks=1
lcov --remove coverage.info '/usr/*' '*/ThirdParty/*' '*/Tests/*' --output-file coverage.info --ignore-errors unused,negative
lcov --list coverage.info --ignore-errors unused,negative 2>&1 | tee coverage-summary.txt
- name: Per-subsystem coverage analysis
run: |
chmod +x scripts/coverage-report.sh
scripts/coverage-report.sh coverage.info --json coverage.json 2>&1 | tee subsystem-coverage.txt || true
- name: Extract error summary
if: failure()
run: |
Expand All @@ -820,12 +824,25 @@ jobs:
try {
const summary = fs.readFileSync('coverage-summary.txt', 'utf8');
const lines = summary.split('\n');
// Extract the total line (last non-empty line with a percentage)
const totalLine = lines.filter(l => /Total:/.test(l) || /\d+\.\d+%/.test(l)).pop() || '';
let body = `## Code Coverage (GCC + lcov)\n\n`;
// Get the last 30 lines which contain the per-directory breakdown
const table = lines.slice(-35).join('\n');
let body = `## Code Coverage (GCC + lcov)\n\n`;
body += `\`\`\`\n${table}\n\`\`\`\n`;

// Append per-subsystem breakdown if available
try {
const json = JSON.parse(fs.readFileSync('coverage.json', 'utf8'));
body += `\n### Per-Subsystem Coverage\n\n`;
body += `| Subsystem | Lines | Hit | Coverage | Threshold | Status |\n`;
body += `|-----------|-------|-----|----------|-----------|--------|\n`;
for (const s of json.subsystems) {
const icon = s.pass ? ':white_check_mark:' : ':x:';
body += `| ${s.subsystem} | ${s.lines} | ${s.hit} | ${s.coverage}% | ${s.threshold}% | ${icon} |\n`;
}
body += `\n**Total: ${json.total_coverage}%** (${json.total_hit}/${json.total_lines} lines)\n`;
} catch (e2) {
// subsystem data not available
}

await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -839,7 +856,10 @@ jobs:
uses: actions/upload-artifact@v7
with:
name: coverage-report
path: coverage.info
path: |
coverage.info
coverage.json
subsystem-coverage.txt
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}

# ===========================================================================
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ GameModules/SparkGameVisualScript/Source/ — Visual script game module (DLL)
SparkConsole/src/ — Standalone console application
SparkShaderCompiler/src/ — Shader compilation tool
SparkSDK/ — Public SDK/interface headers
Tests/ — 4290 unit tests across 338 files, CTest
Tests/ — 4312 unit tests across 339 files, CTest
```

NullRHIDevice automatically activates when no GPU backend is available — engine continues in headless mode. GLAD (OpenGL loader) and SDL2 are bundled in `ThirdParty/`. SDL2 requires `libgl-dev` before CMake configure on Linux.
Expand Down Expand Up @@ -297,7 +297,7 @@ To reproduce CI failures locally, see `.claude/knowledge/ci-reproducible-builds.
| `build-windows-vs2026` | windows-latest | MSVC v144 | Debug, Release | `continue-on-error` |
| `build-linux-mingw-wine` | ubuntu-24.04 | MinGW-w64 + Wine | Release | `continue-on-error` |
| `build-macos` | macos-latest | Apple Clang | Debug, Release | `continue-on-error` |
| `coverage` | ubuntu-24.04 | GCC | Debug | `--coverage` + lcov |
| `coverage` | ubuntu-24.04 | GCC | Debug | `--coverage` + lcov, per-subsystem thresholds |
| `clang-tidy` | ubuntu-24.04 | Clang | Debug | `continue-on-error` |
| `todo-count` | ubuntu-24.04 | — | — | threshold: 20 |

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

**Quality & Testing:**

[![Tests](https://img.shields.io/badge/tests-4290_cases-brightgreen)](https://github.com/Krilliac/SparkEngine/tree/Working/Tests)
[![Tests](https://img.shields.io/badge/tests-4312_cases-brightgreen)](https://github.com/Krilliac/SparkEngine/tree/Working/Tests)
[![clang--format](https://img.shields.io/badge/style-clang--format-blue)](https://github.com/Krilliac/SparkEngine/blob/Working/.clang-format)
[![clang--tidy](https://img.shields.io/badge/analysis-clang--tidy-blue)](https://github.com/Krilliac/SparkEngine/blob/Working/.clang-tidy)

Expand Down Expand Up @@ -412,7 +412,7 @@ SparkEngine/
| |-- Scenes/ # Level/scene JSON files
| |-- Scripts/ # AngelScript game scripts
|-- Templates/ # Game module project templates
|-- Tests/ # 4290 unit tests across 338 files (CTest + 5 sanitizers)
|-- Tests/ # 4312 unit tests across 339 files (CTest + 5 sanitizers)
|-- tools/
| |-- SparkBuild.exe # Pre-built SparkBuild binary
| |-- update-sparkbuild.* # Manual update scripts (ps1/sh)
Expand Down Expand Up @@ -457,7 +457,7 @@ The following libraries are included directly in the source tree:

## Tests

4290 unit tests across 338 test files covering all major engine systems, built with a lightweight internal test framework (no external test dependencies). Integrated with CMake's CTest.
4312 unit tests across 339 test files covering all major engine systems, built with a lightweight internal test framework (no external test dependencies). Integrated with CMake's CTest.

```bash
# Build and run tests
Expand Down
13 changes: 9 additions & 4 deletions SparkEngine/Source/Utils/StringUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,17 @@ namespace Spark
inline std::vector<std::string> Split(const std::string& str, char delimiter)
{
std::vector<std::string> tokens;
std::string token;
std::istringstream stream(str);
while (std::getline(stream, token, delimiter))
if (str.empty())
return tokens;
size_t start = 0;
size_t end = str.find(delimiter);
while (end != std::string::npos)
{
tokens.push_back(token);
tokens.push_back(str.substr(start, end - start));
start = end + 1;
end = str.find(delimiter, start);
}
tokens.push_back(str.substr(start));
return tokens;
}

Expand Down
1 change: 1 addition & 0 deletions Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ add_executable(SparkTests
TestJobSystem.cpp
TestOpaqueHandle.cpp
TestSparkError.cpp
TestThreadDebugger.cpp
TestCollisionSystem.cpp
TestNetworkSecurity.cpp
TestSubTickInput.cpp
Expand Down
Loading
Loading