diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index dd14328..750fcb8 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -18,7 +18,9 @@ cmake --build --preset=test --parallel 2 ctest --preset=test --output-on-failure --no-tests=error ``` -CTest registers `std_test` and `example`, not individual doctest cases. +CTest registers `std_test`, `std_in_source_tests`, and `example`, not individual +doctest cases. The generated in-source runner has no cases until private tests +are added to production translation units. Run a single doctest case directly after building: ```sh @@ -59,8 +61,9 @@ cmake --build --preset=docs ``` The generated site is `build/docs/html/index.html`. CI tests Ubuntu GCC, -Ubuntu Clang, macOS, and Windows, runs clang-tidy, and checks installed -package artifacts. The docs CI job runs on published releases. +Ubuntu Clang, macOS, and Windows and runs clang-tidy using source builds only. +Do not add or run installation, installed-consumer, or package-artifact tests. +The docs CI job runs on published releases. ## Architecture @@ -111,11 +114,16 @@ package artifacts. The docs CI job runs on published releases. ## Tests and documentation -`tests/std_test.cpp` owns the doctest main. Its `evaluate` helper destroys +`tests/std_test.cpp` owns the public-contract doctest main. Its `evaluate` helper destroys the parser before executing the emitted program, so expression tests also exercise callback lifetime. The scalar case table covers both ordinary and receiver syntax; separate cases cover closures, overload coexistence, rejected signatures, floating-point edge cases, and tuple structure. +Keep these public-interface tests external. Private tests, if added, belong in +their owning `.cpp` under `#if CPP_LIBRARY_TESTING()` after including +``; guard doctest and test-only helpers there too. +Use the toolkit's thread, static-test-support, generated-runner, and 120-second +timeout defaults. Standalone tests must not receive the private `src` include root. `examples/example.cpp` is compiled and run by CTest and included directly in the Doxygen tutorial. Keep that example consistent with the tutorial. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9e0a6b..cc054ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,27 +57,6 @@ jobs: - name: Test run: ctest --preset=test - - name: Build and Install - run: | - cmake --preset=default - cmake --build --preset=default - cmake --install build/default --prefix "${{ runner.temp }}/install" - env: - CC: ${{ matrix.cc }} - CXX: ${{ matrix.cxx }} - if: ${{ matrix.cc }} - - - name: Build and Install - run: | - cmake --preset=default - cmake --build --preset=default - cmake --install build/default --prefix "${{ runner.temp }}/install" - if: ${{ !matrix.cc }} - - - name: Check installed package artifacts - run: | - cmake "-DPACKAGE_TEST_PREFIX=${{ runner.temp }}/install" -P build/default/cpp-library-test-package.cmake - clang-tidy: runs-on: ubuntu-latest diff --git a/.scout/memory/index.md b/.scout/memory/index.md index 36e816a..2b7e7a0 100644 --- a/.scout/memory/index.md +++ b/.scout/memory/index.md @@ -3,4 +3,4 @@ ## Knowledge - [[knowledge/initialize-shared-installation-defaults-before-cel-dependencies.md|Initialize shared installation defaults before CEL dependencies]] (pattern, 0.80) `cel-install` `cpp_library_setup` `cpmaddpackage` `installation-defaults` `fresh-cmake-cache` -- [[knowledge/keep-ci-generation-and-package-checks-owned-by-cpp-library.md|Keep CI generation and package checks owned by cpp-library]] (decision, 1.00) `cpp-library` `generated-ci` `packaging` `cpm` +- [[knowledge/keep-ci-generation-and-package-checks-owned-by-cpp-library.md|Keep source-only CI generation owned by cpp-library]] (decision, 1.00) `cpp-library` `generated-ci` `packaging` `cpm` diff --git a/.scout/memory/knowledge/initialize-shared-installation-defaults-before-cel-dependencies.md b/.scout/memory/knowledge/initialize-shared-installation-defaults-before-cel-dependencies.md index c70360e..513fcf7 100644 --- a/.scout/memory/knowledge/initialize-shared-installation-defaults-before-cel-dependencies.md +++ b/.scout/memory/knowledge/initialize-shared-installation-defaults-before-cel-dependencies.md @@ -20,6 +20,6 @@ Keep cel-std's cpp_library_setup call before the cel-parser CPMAddPackage call; CEL packages share the CEL_INSTALL cache option. cpp-library initializes it from PROJECT_IS_TOP_LEVEL only on its first declaration. If a nested parser/runtime package declares it first, a fresh build can cache OFF and cel-std installs nothing. Initializing the root through cpp_library_setup first gives the intended top-level default while preserving an explicit CEL_INSTALL=OFF. Do not restore a library-specific predeclaration of the shared option. -When changing dependency/setup order, verify Release installation with a fresh CMake cache and no explicit CEL_INSTALL value, then verify the explicit OFF case. A previously configured cache retaining ON can hide this regression; use the generated package-artifact check to detect a missing installation. +When changing dependency/setup order, inspect a fresh source-build CMake cache to confirm CEL_INSTALL's default and explicit OFF handling. Do not exercise installation or package-artifact tests; the user requires source-only validation. Aliases / also known as: CEL_INSTALL, cpp_library_setup, CPMAddPackage, installation defaults, fresh CMake cache diff --git a/.scout/memory/knowledge/keep-ci-generation-and-package-checks-owned-by-cpp-library.md b/.scout/memory/knowledge/keep-ci-generation-and-package-checks-owned-by-cpp-library.md index 2a86c5a..e9e233c 100644 --- a/.scout/memory/knowledge/keep-ci-generation-and-package-checks-owned-by-cpp-library.md +++ b/.scout/memory/knowledge/keep-ci-generation-and-package-checks-owned-by-cpp-library.md @@ -1,5 +1,5 @@ --- -title: "Keep CI generation and package checks owned by cpp-library" +title: "Keep source-only CI generation owned by cpp-library" entity_type: decision confidence: 1.00 created: 2026-11-19T22:20:43Z @@ -8,17 +8,17 @@ last_reinforced: 2026-11-19T22:20:43Z access_count: 1 sources: - ".github/workflows/ci.yml:1-4" - - ".github/workflows/ci.yml:78-80" + - "CMakeLists.txt:4" - "User input: \"the CI yaml is intended to come from cpp-library without modification or it will be overridden. And the shorthand for for CPMAddPackage() is intended.\"" tags: ["cpp-library", "generated-ci", "packaging", "cpm"] tier: knowledge source: user --- -# Keep CI generation and package checks owned by cpp-library +# Keep source-only CI generation owned by cpp-library -Treat .github/workflows/ci.yml as generated output: fix its template or shared packaging checks in stlab/cpp-library and regenerate, rather than hand-editing the client workflow. Preserve intended CPMAddPackage shorthand; do not expand dependency declarations merely to change installation eligibility. +Treat .github/workflows/ci.yml as generated output: fix its template or shared source-build checks in stlab/cpp-library and regenerate, rather than hand-editing the client workflow. Preserve intended CPMAddPackage shorthand; do not expand dependency declarations merely to change installation eligibility. -Use cpp-library's generated package-artifact check for packaging validation. Do not add or run project-specific installed-package consumption tests beyond cpp-library's provided checks (user-wide rule). +cpp-library 6.2.0 generates source-only CI. Do not add or run installation, installed-consumer, or package-artifact tests, including any inherited toolkit checks. Retain the opt-in install preset without exercising it (user-wide rule). A successful documentation build does not prove Pages publication. Diagnose build, artifact upload, and deployment separately; published-release docs behavior belongs to the upstream workflow template. Distinguish generated find_dependency metadata from physically installing dependency packages. diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 297e047..df55722 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -240,7 +240,7 @@ "$gcc", "$msCompile" ], - "detail": "Release build for installation with CPM_USE_LOCAL_PACKAGES enabled for testing installed packages Requires the CMake Tools extension (ms-vscode.cmake-tools) — without it, this task fails to start.", + "detail": "Release build for installation, preferring locally installed dependencies before fetching. Requires the CMake Tools extension (ms-vscode.cmake-tools) — without it, this task fails to start.", "windows": { "options": { "shell": { diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e602ec..3c37665 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) include(cmake/CPM.cmake) -CPMAddPackage("gh:stlab/cpp-library@6.1.0") +CPMAddPackage("gh:stlab/cpp-library@6.2.0") include("${cpp-library_SOURCE_DIR}/cpp-library.cmake") cpp_library_enable_dependency_tracking() @@ -23,5 +23,15 @@ cpp_library_setup( DOCS_OPTIONS "USE_MDFILE_AS_MAINPAGE = ${CMAKE_CURRENT_SOURCE_DIR}/README.md" ) -CPMAddPackage("gh:stlab/cel-parser@1.1.1") +CPMAddPackage("gh:stlab/cel-parser@1.1.2") target_link_libraries(std PUBLIC cel::parser) + +# Standalone tests use public headers, not the toolkit's private source include root. +get_property(directory_targets DIRECTORY PROPERTY BUILDSYSTEM_TARGETS) +foreach(directory_target IN LISTS directory_targets) + get_target_property(include_directories "${directory_target}" INCLUDE_DIRECTORIES) + if(include_directories) + list(REMOVE_ITEM include_directories "${CMAKE_CURRENT_SOURCE_DIR}/src") + set_property(TARGET "${directory_target}" PROPERTY INCLUDE_DIRECTORIES "${include_directories}") + endif() +endforeach() diff --git a/CMakePresets.json b/CMakePresets.json index 99ba84a..2efd009 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -8,6 +8,7 @@ "binaryDir": "${sourceDir}/build/default", "generator": "Ninja", "cacheVariables": { + "CEL_INSTALL": "OFF", "CMAKE_BUILD_TYPE": "Release", "BUILD_TESTING": "OFF", "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", @@ -22,6 +23,7 @@ "binaryDir": "${sourceDir}/build/test", "generator": "Ninja", "cacheVariables": { + "CEL_INSTALL": "OFF", "CMAKE_BUILD_TYPE": "Debug", "BUILD_TESTING": "ON", "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", @@ -36,6 +38,7 @@ "binaryDir": "${sourceDir}/build/docs", "generator": "Ninja", "cacheVariables": { + "CEL_INSTALL": "OFF", "CMAKE_BUILD_TYPE": "Release", "BUILD_TESTING": "OFF", "BUILD_DOCS": "ON", @@ -51,6 +54,7 @@ "binaryDir": "${sourceDir}/build/clang-tidy", "generator": "Ninja", "cacheVariables": { + "CEL_INSTALL": "OFF", "CMAKE_BUILD_TYPE": "Debug", "BUILD_TESTING": "ON", "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", @@ -66,6 +70,7 @@ "binaryDir": "${sourceDir}/build/init", "generator": "Ninja", "cacheVariables": { + "CEL_INSTALL": "OFF", "CMAKE_BUILD_TYPE": "Release", "BUILD_TESTING": "OFF", "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", @@ -77,10 +82,11 @@ { "name": "install", "displayName": "Install Configuration", - "description": "Release build for installation with CPM_USE_LOCAL_PACKAGES enabled for testing installed packages", + "description": "Release build for installation, preferring locally installed dependencies before fetching", "binaryDir": "${sourceDir}/build/install", "generator": "Ninja", "cacheVariables": { + "CEL_INSTALL": "ON", "CMAKE_BUILD_TYPE": "Release", "BUILD_TESTING": "OFF", "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", diff --git a/docs/tutorial.md b/docs/tutorial.md index 924774c..1ce0cc0 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -69,7 +69,7 @@ fails. ## Consume an installed package -Install `cel-runtime` 1.1.2 and `cel-parser` 1.1.1 separately before installing +Install `cel-runtime` 1.1.3 and `cel-parser` 1.1.2 separately before installing `cel-std`. From the `cel-std` source directory, run: ```sh