Files
marqdo-view/tools/test-contract.sh
T
marqdo-view dev d641ca58ac feat(PR-06): one-command frozen-CLI acceptance, evidence and final docs
- tools/acceptance.sh: RFC §18.1 end-to-end acceptance against the frozen CLI
  release archive in an isolated tool home (build/test/bundle/archive-install/
  view help/verify/export/browse/explicit CSRF run/export+security+browser
  suites/CLI SHA check) and generation of docs/evidence/<CLI-SHA>/manifest.json
- tools/test-contract.sh + .woodpecker.yml CI lanes (remote CI unverified)
- docs/ACCEPTANCE.md gate table (P0 all PASS; U-01/U-04 honestly PARTIAL),
  docs/audits/protocol-conformance.md, ADR-0006 documented RFC deviations
- unicode/CRLF/duplicate-text examples + frozen goldens + tests (S-04)
- presentation degradation matrix tests (S-05..S-07), hostile-stdout escaping
  test (X-05), keyboard accessibility browser checks (U-03)
- final README/STATUS/COMPATIBILITY/CHANGELOG with honest limitations
2026-11-22 12:06:45 +08:00

31 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Contract-focused gate: formatting, lints, all tests, Tool v1 install smoke,
# static verify and static export against the frozen core. No browser.
#
# Usage: MARQDO_BIN=/abs/path/marqdo tools/test-contract.sh
set -euo pipefail
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$repo_root"
: "${MARQDO_BIN:?set MARQDO_BIN to the frozen marqdo binary}"
export PATH="${HOME}/.cargo/bin:${PATH}"
export CARGO_HOME="${CARGO_HOME:-$repo_root/.cargo-home}"
cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings
cargo test --locked
cargo build --release --locked
MARQDO_BIN="$MARQDO_BIN" ./tools/package.sh
export MARQDO_TOOL_HOME="$repo_root/dist/contract-tool-home"
rm -rf "$MARQDO_TOOL_HOME"
"$MARQDO_BIN" tool install "$repo_root/dist/marqdo-view/tool.json" >/dev/null
"$MARQDO_BIN" view --help >/dev/null
"$MARQDO_BIN" view verify examples/mixed-modes/index.mq.md
"$MARQDO_BIN" view export examples/tables-math --out "$repo_root/dist/contract-site"
test -f "$repo_root/dist/contract-site/manifest.json"
echo "contract: PASS"