Files
Python3-Win9x/scripts/vc6-probe-pathcch.test.sh

59 lines
1.9 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# Regression tests for the narrow VC6 compat/msvc600/pathcch.h shim.
#
# Skipped (not failed) when Wine + MSVC600 are unavailable, matching the other
# VC6 probe test scripts. The live check is compile-only: it verifies that the
# fixture using representative PathCchFindExtension paths reaches cl.exe exit 0.
#
# Usage: scripts/vc6-probe-pathcch.test.sh
set -u
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PROBE="$REPO_ROOT/scripts/vc6-probe-core.sh"
fail=0
pass() { echo "ok - $1"; }
bad() { echo "not ok - $1"; fail=1; }
if grep -q 'PathCchFindExtension' "$REPO_ROOT/compat/msvc600/pathcch.h" && \
grep -q 'defined(_MSC_VER).*1200' "$REPO_ROOT/compat/msvc600/pathcch.h"; then
pass "compat/msvc600/pathcch.h provides a VC6-scoped PathCchFindExtension shim"
else
bad "compat/msvc600/pathcch.h provides a VC6-scoped PathCchFindExtension shim"
fi
MSVC600_ROOT="${MSVC600_ROOT:-$REPO_ROOT/MSVC600}"
if command -v wine >/dev/null 2>&1 && [ -e "$MSVC600_ROOT/VC98/Bin/CL.EXE" ]; then
out="$($PROBE scripts/fixtures/vc6_pathcch_smoke.c 2>&1)"
status=$?
if [ "$status" -eq 0 ]; then
pass "PathCchFindExtension smoke fixture compiles under VC6 (exit 0)"
else
bad "PathCchFindExtension smoke fixture compiles under VC6 (exit $status)"
echo "$out"
fi
if printf '%s' "$out" | grep -q "Cannot open include file: 'pathcch.h'"; then
bad "pathcch smoke fixture does not regress to missing pathcch.h"
else
pass "pathcch smoke fixture does not regress to missing pathcch.h"
fi
if printf '%s' "$out" | grep -qi 'error'; then
bad "pathcch smoke fixture: no compiler errors in output"
else
pass "pathcch smoke fixture: no compiler errors in output"
fi
else
echo "skip - wine/MSVC600 not available; skipping live pathcch integration check"
fi
if [ "$fail" -ne 0 ]; then
echo "FAILED"
exit 1
fi
echo "ALL TESTS PASSED"