Repository Public
1#!/usr/bin/env bash2# ORIX Docs3# File: Scripts/docx-compat.sh4# Description: Runs the DOCX reference corpus through Import → Export → Reimport → Export → Reimport and writes the measured5# compatibility report to docs/reports/docx-compatibility.md and .json. Opens no window and needs no network.6# Usage: Scripts/docx-compat.sh [--fast] [--regenerate-corpus]7# --fast skip the LibreOffice conversions (the report then says "not run")8# --regenerate-corpus rebuild the pandoc / LibreOffice fixtures first (Tests/DocDOCXTests/Corpus/generate.sh)9#10# Author: Simon-Pierre Boucher11# Contact: contact@spboucher.ai12set -euo pipefail1314ROOT="$(cd "$(dirname "$0")/.." && pwd)"15PKG="$ROOT/Packages/ORIXDocsKit"16CORPUS="$PKG/Tests/DocDOCXTests/Corpus"17SCRATCH="${ORIX_SCRATCH:-/tmp/orixdocs-docx}"18SLOW=119for arg in "$@"; do20 case "$arg" in21 --fast) SLOW=0 ;;22 --regenerate-corpus) "$CORPUS/generate.sh" ;;23 *) echo "unknown option: $arg" >&2; exit 2 ;;24 esac25done2627mkdir -p "$ROOT/docs/reports"28cd "$PKG"29# The hand-authored packages are built by the test helpers; a copy is written next to the corpus so they can be inspected.30ORIX_ONLY=DocModel,DocContainer,DocDOCX,DocDOCXTests \31ORIX_SLOW_TESTS="$SLOW" \32ORIX_DOCX_REPORT_DIR="$ROOT/docs/reports" \33ORIX_DOCX_DUMP_DIR="$CORPUS/hand-authored" \34 swift test --scratch-path "$SCRATCH" --filter CompatibilityReportTests3536echo "Report: $ROOT/docs/reports/docx-compatibility.md"37echo "Data: $ROOT/docs/reports/docx-compatibility.json"38