diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 863d8936..1a5088a1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -348,7 +348,7 @@ jobs: run: | set -euo pipefail PY="$(command -v python3 || command -v python)" - "$PY" tools/test_template.py --toolchain "${{ matrix.toolchain }}" + "$PY" tools/ci/test_template.py --toolchain "${{ matrix.toolchain }}" - name: Check release coordinate and bilingual entry pages if: matrix.name == 'linux-gcc' && matrix.arch == 'x86_64' diff --git a/.gitignore b/.gitignore index 45750d16..3fc5a9da 100644 --- a/.gitignore +++ b/.gitignore @@ -43,7 +43,7 @@ compile_commands.json *.dwo *.d -# Local test scratch (tools/test_template.py keeps its workspace here so the +# Local test scratch (tools/ci/test_template.py keeps its workspace here so the # mcpp shim can resolve the project-pinned toolchain) .tmp/ diff --git a/docs/architecture.md b/docs/architecture.md index d65ad2cb..0708c992 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -290,7 +290,7 @@ keeps byte-identical notices. configuration records the incremental TU count and mtimes. - `tools/check_mwrap_release.py`: identity, version scheme, tag, licence split and retained-document bytes. -- `tools/test_template.py`: installs an isolated `MCPP_HOME` fixture, runs a real +- `tools/ci/test_template.py`: installs an isolated `MCPP_HOME` fixture, runs a real `mcpp new`, parses the rendered manifest (complete selector, version, features), then builds and runs the project — no sed rendering. - `tools/package-source.sh`: `boost-m-.tar.gz` from the tracked tree, diff --git a/docs/architecture.zh.md b/docs/architecture.zh.md index 7ded9825..ac05aa3d 100644 --- a/docs/architecture.zh.md +++ b/docs/architecture.zh.md @@ -258,7 +258,7 @@ feature(两种 Boost.Test 形态绝不能链接在一起)。 必须干净;在同一配置上再做一次构建,记录增量 TU 数量和 mtime。 - `tools/check_mwrap_release.py`:校验标识、版本方案、tag、许可证拆分以及保留 文档的字节。 -- `tools/test_template.py`:安装隔离的 `MCPP_HOME` 测试环境,执行真实的 +- `tools/ci/test_template.py`:安装隔离的 `MCPP_HOME` 测试环境,执行真实的 `mcpp new`,解析渲染出的清单(完整选择器、版本、features),然后构建并运行 该项目——不使用 sed 渲染。 - `tools/package-source.sh`:从受版本控制的代码树生成 diff --git a/tools/test_template.py b/tools/ci/test_template.py similarity index 97% rename from tools/test_template.py rename to tools/ci/test_template.py index e24c4ddf..412aa3db 100755 --- a/tools/test_template.py +++ b/tools/ci/test_template.py @@ -13,9 +13,9 @@ dependency is redirected to the fixture with the same parser, features kept. Usage: - python3 tools/test_template.py # default template - python3 tools/test_template.py --template lib # a named template - python3 tools/test_template.py --keep # leave the fixture on disk + python3 tools/ci/test_template.py # default template + python3 tools/ci/test_template.py --template lib # a named template + python3 tools/ci/test_template.py --keep # leave the fixture on disk """ import argparse import json @@ -27,7 +27,7 @@ import tempfile import tomllib -ROOT = Path(__file__).resolve().parents[1] +ROOT = Path(__file__).resolve().parents[2] def package_identity(): diff --git a/tools/template_smoke.sh b/tools/template_smoke.sh deleted file mode 100755 index 6370c9de..00000000 --- a/tools/template_smoke.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash -# Render every shipped template through a real `mcpp new`, then build and run it. -# -# The work lives in tools/test_template.py: it installs an isolated MCPP_HOME -# fixture for the candidate version, runs mcpp's own renderer, parses the -# rendered manifest (complete selector, version, features) with tomllib, and only -# then redirects the dependency to the fixture. Hand-substituting placeholders -# with sed is explicitly not evidence for a template. -# -# Usage: bash tools/template_smoke.sh [--template NAME] [--toolchain SPEC] -set -euo pipefail - -ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" -exec python3 "$ROOT/tools/test_template.py" "$@"