Files
OpenSTA/test/regression.sh
Jaehyun Kim a1c1685c04 Clean up test suite per 3-way code review findings
- Remove temp files: network_gcd_traversal.log, util_report_redirect.log
- Delete 19 comment-only C++ test stubs (dead code for removed APIs)
- Remove redundant graph_make_verify test (covered by graph_advanced)
- Centralize assert_file_nonempty/assert_file_contains into test/helpers.tcl
  and remove inline copies from 17 verilog test files
- Fix Build.sh stray quotes in heredoc output
- Fix regression.sh unquoted variable expansions
- Update .gitignore: add */test/*.log and Testing/

All 6087 tests pass.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-04-02 22:27:27 +09:00

38 lines
887 B
Bash
Executable File

#!/usr/bin/env bash
# Regression test runner for OpenSTA module tests.
# Modeled after OpenROAD/test/regression_test.sh.
# Usage: regression.sh <sta_exe> <test_name>
STA_EXE="$1"
TEST_NAME="$2"
RESULT_DIR="results"
LOG_FILE="${RESULT_DIR}/${TEST_NAME}.log"
DIFF_FILE="${RESULT_DIR}/${TEST_NAME}.diff"
mkdir -p "${RESULT_DIR}"
# Run test, merge stderr into stdout, capture to log.
"${STA_EXE}" -no_init -no_splash -exit "${TEST_NAME}.tcl" > "${LOG_FILE}" 2>&1
sta_exit=$?
if [ $sta_exit -ne 0 ]; then
echo "Error: sta exited with code ${sta_exit}"
cat "${LOG_FILE}"
exit 1
fi
# Compare against golden file.
if [ ! -f "${TEST_NAME}.ok" ]; then
echo "Error: golden file ${TEST_NAME}.ok not found"
exit 1
fi
if diff "${TEST_NAME}.ok" "${LOG_FILE}" > "${DIFF_FILE}" 2>&1; then
exit 0
else
echo "FAIL: output differs from ${TEST_NAME}.ok"
cat "${DIFF_FILE}"
exit 1
fi