subsystem-summary-of-test
Installation
SKILL.md
Test Subsystem — Test Utilities and Infrastructure
The src/test/ directory contains test infrastructure, helpers, and utilities used across the entire stellar-core test suite. It does NOT contain the actual test cases (those live alongside their subsystems). This document covers the test framework, helper classes, and conventions.
Test Framework and Runner (test.h / test.cpp)
Test Entry Point
runTest(CommandLineArgs const& args)— Main test runner entry point. Configures Catch2 session, parses CLI args (log level, metrics, version selection, tx meta recording), seeds PRNGs, and runs all tests.- Uses Catch2 as the underlying test framework (wrapped via
Catch2.h).
Test Configuration
getTestConfig(int instanceNumber, Config::TestDbMode mode)— Returns a lazily-created, cachedConfigfor the given instance number. Configs are stored ingTestCfg[mode]arrays. Default mode isTESTDB_BUCKET_DB_VOLATILE. Key config settings:RUN_STANDALONE = true,FORCE_SCP = true,MANUAL_CLOSE = trueWORKER_THREADS = 3, invariant checks enabled (exceptEventsAreConsistentWithEntryDiffs)- Test root directories created via
TmpDiringTestRoots - Node seed derived deterministically from instance number + command-line seed
- Single-node quorum with
UNSAFE_QUORUM = true NETWORK_PASSPHRASE = "(V) (;,,;) (V)"- DB can be in-memory SQLite, file-backed SQLite, or PostgreSQL