Skip to main content

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:
Binary: build\Release\tests_mock.exe
If 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

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)
  • uvx on PATH (for MCP tests)

Building Integration Tests

Integration tests are not built by default. Enable them with the GAIA_BUILD_INTEGRATION_TESTS CMake option:
This produces the tests_integration binary alongside the unit test binary.
Do not mix unit and integration tests in CTest. If you enable integration tests, CTest will discover both suites. Run tests_integration separately with an LLM server running — otherwise CTest will hang waiting for the LLM connection.

Running Integration Tests

  1. Start an LLM server with a model loaded:
  2. Set environment variables (optional — defaults shown):
  3. Run the tests:
Integration tests have a 300-second timeout per test. If a test hangs, verify the LLM server is responding at the configured URL.

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 to cpp/tests/ and register it in CMakeLists.txt:
Follow the existing pattern — include <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 to cpp/tests/integration/ and register it in the tests_integration target in CMakeLists.txt:
Integration tests should:
  • Read GAIA_CPP_BASE_URL and GAIA_CPP_TEST_MODEL from environment variables
  • Use reasonable timeouts (the CI sets 300s per test)
  • Be idempotent — no permanent side effects