#!/usr/bin/env bash set -euo pipefail # Reconfigure with IR pipeline enabled, build, then run Lab2 test script. RESULT_FILE="test/test_result/run_lab2_result.log" mkdir -p "$(dirname \"$RESULT_FILE\")" : > "$RESULT_FILE" { echo "[run_lab2] start: $(date '+%Y-%m-%d %H:%M:%S')" echo "[run_lab2] logging to: $RESULT_FILE" cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCOMPILER_PARSE_ONLY=OFF cmake --build build -j "$(nproc)" bash scripts/test_lab2.sh echo "[run_lab2] end: $(date '+%Y-%m-%d %H:%M:%S')" } 2>&1 | tee "$RESULT_FILE"