Overview
The C++ framework has two test suites:
Both suites use Google Test (fetched automatically by CMake).
Unit Tests
Unit tests are built by default and run without an LLM server. They cover all twenty core modules:One additional module,
test_tui_console.cpp (FTXUI TUI console), is compiled into tests_mock only when GAIA_BUILD_TUI=ON (the default).Building Unit Tests
Unit tests are built by default when building the C++ framework as a standalone project (GAIA_BUILD_TESTS=ON). The standard build commands from the Quickstart produce the tests_mock binary automatically:
- Windows (MSVC)
- Linux
build\Release\tests_mock.exeIf you’re consuming
gaia_core as a sub-project (via FetchContent or add_subdirectory), tests are off by default. Pass -DGAIA_BUILD_TESTS=ON to enable them.Running Unit Tests
- Windows
- Linux
Run the test binary directly:Or via CTest:
Filtering Tests
Google Test supports test filtering via--gtest_filter:
Integration Tests
Integration tests exercise the full stack — real LLM inference, live MCP server connections, and actual agent workflows. They require:- A running LLM server (Lemonade recommended) with a model loaded
- Windows (the tested agents use PowerShell)
uvxon PATH (for MCP tests)
Building Integration Tests
Integration tests are not built by default. Enable them with theGAIA_BUILD_INTEGRATION_TESTS CMake option:
tests_integration binary alongside the unit test binary.
Running Integration Tests
-
Start an LLM server with a model loaded:
-
Set environment variables (optional — defaults shown):
-
Run the tests:
CI Pipeline
The C++ CI workflow (.github/workflows/build_cpp.yml) runs five jobs on every PR that touches cpp/:
The integration test job runs on AMD STX hardware with a real Lemonade Server and Qwen3-4B model. It is treated as non-blocking in CI (infrastructure issues on self-hosted runners don’t fail the PR).
Adding New Tests
Unit Tests
Add your test file tocpp/tests/ and register it in CMakeLists.txt:
<gtest/gtest.h>, use TEST() or TEST_F() macros, and mock LLM responses where needed. See test_agent.cpp for mocking examples.
Integration Tests
Add your test file tocpp/tests/integration/ and register it in the tests_integration target in CMakeLists.txt:
- Read
GAIA_CPP_BASE_URLandGAIA_CPP_TEST_MODELfrom environment variables - Use reasonable timeouts (the CI sets 300s per test)
- Be idempotent — no permanent side effects