You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: GoogleTest harness — CMake, presets, support helpers, runner #43
Part of #41. The test harness the area suites build on. Do this first.
tests/CMakeLists.txt (top-level CMakeLists.txt at the repo root that adds tests/), C++26, GoogleTest v1.18.0 via FetchContent pinned to the tag, gtest_discover_tests.
CMakePresets.json with configure/build/test/workflow presets: gcc-15 (Homebrew g++-15), clang-22 (Homebrew /opt/homebrew/opt/llvm/bin/clang++, -stdlib=libc++), and a documented Docker recipe for GCC 16 (gcc:16 image) for C++26 tests.
Layout mirrors docs/examples/: tests/<area>/<page>_test.cpp; one CMake target per area (examples_containers_tests, …) so areas build independently, plus an all aggregate. A helper tests/support/ for capturing std::cout/std::print output into a string and a CPPDOCS_REQUIRE(__cpp_lib_x)-style skip macro (GTEST_SKIP with a reason).
tools/run_tests.sh [preset] runs the workflow preset; CLAUDE.md and README get a "Running the tests" section (local only; no CI).
One worked example per area folder (e.g. tests/containers/vector_test.cpp with 3–5 tests) so the area sub-issues have a pattern to copy.
Acceptance:cmake --workflow --preset gcc-15 and --preset clang-22 configure, build and pass; the Docker GCC 16 recipe runs; skips print their reason.
Skips print their reason. Examples: needs __cpp_lib_generator (not defined by this toolchain), and needs __cpp_lib_optional >= 202506L (this toolchain has 202110L).
The snippet checker baseline is still clean after the page fixes.
Still open
std::execution (__cpp_lib_senders) isn't implemented by any local toolchain, so those tests only skip.
Named-module tests need CMake CXX_MODULES file sets, which the harness doesn't build yet.
Homebrew GCC 15 on macOS has a std::nested_exception bug, so that test skips there.
Activity
homer6 commentedon Oct 31, 2026
Delivered in #52.
What changed
CMakeLists.txt(root) andtests/CMakeLists.txt:FetchContentpinned to the tag, andgtest_discover_tests.examples_<area>_tests, built from the*_test.cppfiles that exist, plus theexamples_testsaggregate.CMakePresets.json: configure, build, test and workflow presets for:gcc-15(g++-15).clang-22(Homebrew clang++ with-stdlib=libc++, linked against Homebrew's libc++ and libunwind with rpaths).gcc-16(run inside thegcc:16Docker image).tests/support/:capture.hppcapturesstd::cout,printfandstd::printin order. It redirects fd 1 and forwards cout's buffer into stdout.feature.hppprovidesCPPDOCS_REQUIRE/CPPDOCS_REQUIRE_VERSION, which skip with the missing macro and the version found.tools/run_tests.sh [preset] [ctest args]:gcc-16it runs inside Docker afterapt-get install cmake ninja-build.README.mdandCLAUDE.md: "Running the tests" sections..gitignore:build/andout/.docs/examples/area folder andlanguage/subfolder, each with 2–5 tests on one page's claims.vector.md:std::bitsetis C++98, not C++20.futures.md: a broken promise throwsstd::future_error/future_errc::broken_promise.comparison.md: a defaulted<=>does declare==.coroutines.md:take(10)resumes the generator an 11th time.Why
cmake --workflow --preset gcc-15: 100% passed (GCC 15.2).cmake --workflow --preset clang-22: 100% passed (Clang 22.1.8 with libc++).tools/run_tests.sh gcc-16: 100% passed (Docker GCC 16.2, CMake 3.31.6).needs __cpp_lib_generator (not defined by this toolchain), andneeds __cpp_lib_optional >= 202506L (this toolchain has 202110L).Still open
std::execution(__cpp_lib_senders) isn't implemented by any local toolchain, so those tests only skip.CXX_MODULESfile sets, which the harness doesn't build yet.std::nested_exceptionbug, so that test skips there.test: add GoogleTest harness with CMake presets and support helpers
test: add a worked example test file for every docs/examples area
docs: document running the tests; fix claims the new tests disproved
homer6 commentedon Oct 31, 2026
Merged in #52 (3b3f168) on the owner's review.
What changed
main; theCLAUDE.mdintro conflict with docs: refresh README and CLAUDE.md now that #20 has shipped #49 was resolved by keeping both facts (snippets compile-checked; claims tested bytests/).Why
Still open