Refactor dependencies and improve test runner diagnostics
- Updated `Cargo.toml` files across multiple crates to replace local `egui` and `eframe` dependencies with workspace references, ensuring consistent platform support. - Enhanced `run_all_tests.bat` and `run_all_tests.sh` scripts to capture and report names of failed and skipped crates, improving test diagnostics. - Fixed duplicate keys in `hcie-text/Cargo.toml` and ensured proper feature activation for Linux builds in affected crates. - Added a new repair plan document outlining steps to address failing crates and improve overall test execution reliability.
This commit is contained in:
+49
-14
@@ -16,19 +16,28 @@ cd "$ROOT_DIR"
|
||||
PASS=0
|
||||
FAIL=0
|
||||
SKIP=0
|
||||
FAILED_CRATES=()
|
||||
SKIPPED_CRATES=()
|
||||
START_TIME=$(date +%s)
|
||||
|
||||
SKIP_IO=false
|
||||
SKIP_4K=false
|
||||
INCLUDE_IGNORED=false
|
||||
EXTRA_ARGS=()
|
||||
CARGO_ARGS=()
|
||||
TEST_ARGS=()
|
||||
PARSING_TEST_ARGS=false
|
||||
|
||||
for arg in "$@"; do
|
||||
if [ "$PARSING_TEST_ARGS" = true ]; then
|
||||
TEST_ARGS+=("$arg")
|
||||
continue
|
||||
fi
|
||||
case "$arg" in
|
||||
--no-io) SKIP_IO=true ;;
|
||||
--no-4k) SKIP_4K=true ;;
|
||||
--ignored) INCLUDE_IGNORED=true ;;
|
||||
*) EXTRA_ARGS+=("$arg") ;;
|
||||
--) PARSING_TEST_ARGS=true ;;
|
||||
*) CARGO_ARGS+=("$arg") ;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -37,17 +46,36 @@ SEPARATOR() { printf '%*s\n' 80 '' | tr ' ' '='; }
|
||||
run_crate() {
|
||||
local crate="$1"
|
||||
local label="$2"
|
||||
local extra="${3:-}"
|
||||
shift 2
|
||||
local -a crate_test_args=("$@")
|
||||
local -a cmd=(cargo test -p "$crate" "${CARGO_ARGS[@]}")
|
||||
if (( ${#crate_test_args[@]} > 0 || ${#TEST_ARGS[@]} > 0 )); then
|
||||
cmd+=(-- "${crate_test_args[@]}" "${TEST_ARGS[@]}")
|
||||
fi
|
||||
|
||||
SEPARATOR
|
||||
echo "[$label] Running: cargo test -p $crate $extra"
|
||||
printf '[%s] Running:' "$label"
|
||||
printf ' %q' "${cmd[@]}"
|
||||
printf '\n'
|
||||
SEPARATOR
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
if cargo test -p "$crate" $extra "${EXTRA_ARGS[@]+${EXTRA_ARGS[@]}}" 2>&1; then
|
||||
if "${cmd[@]}" 2>&1; then
|
||||
PASS=$((PASS + 1))
|
||||
else
|
||||
FAIL=$((FAIL + 1))
|
||||
FAILED_CRATES+=("$crate")
|
||||
fi
|
||||
}
|
||||
|
||||
run_ignored_tests() {
|
||||
local crate="$1"
|
||||
local -a cmd=(cargo test -p "$crate" "${CARGO_ARGS[@]}" -- --ignored "${TEST_ARGS[@]}")
|
||||
|
||||
if "${cmd[@]}" 2>&1; then
|
||||
PASS=$((PASS + 1))
|
||||
else
|
||||
FAIL=$((FAIL + 1))
|
||||
FAILED_CRATES+=("${crate}[ignored]")
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -56,9 +84,15 @@ display_summary() {
|
||||
echo ""
|
||||
SEPARATOR
|
||||
echo " BULK TEST EXECUTION COMPLETE"
|
||||
echo " Crates passed: $PASS"
|
||||
echo " Crates failed: $FAIL"
|
||||
echo " Test runs passed: $PASS"
|
||||
echo " Test runs failed: $FAIL"
|
||||
echo " Crates skipped: $SKIP"
|
||||
if (( ${#FAILED_CRATES[@]} > 0 )); then
|
||||
echo " Failed crates: ${FAILED_CRATES[*]}"
|
||||
fi
|
||||
if (( ${#SKIPPED_CRATES[@]} > 0 )); then
|
||||
echo " Skipped crates: ${SKIPPED_CRATES[*]}"
|
||||
fi
|
||||
echo " Elapsed time: ${elapsed}s"
|
||||
SEPARATOR
|
||||
[ "$FAIL" -eq 0 ] && echo " ALL CRATES PASSED" || echo " $FAIL crate(s) have failing tests"
|
||||
@@ -86,11 +120,12 @@ run_crate "hcie-history" "Layer 2"
|
||||
if [ "$SKIP_IO" = true ]; then
|
||||
echo "[SKIP] hcie-io (--no-io flag)"
|
||||
SKIP=$((SKIP + 1))
|
||||
SKIPPED_CRATES+=("hcie-io")
|
||||
else
|
||||
run_crate "hcie-io" "Layer 2"
|
||||
fi
|
||||
|
||||
run_crate "hcie-psd" "Layer 2"
|
||||
run_crate "psd" "Layer 2"
|
||||
run_crate "hcie-vision" "Layer 2"
|
||||
run_crate "hcie-build-info" "Layer 2"
|
||||
|
||||
@@ -98,7 +133,7 @@ run_crate "hcie-build-info" "Layer 2"
|
||||
# Layer 4: ENGINE API
|
||||
# ──────────────────────────────────────────────────────────
|
||||
if [ "$SKIP_4K" = true ]; then
|
||||
run_crate "hcie-engine-api" "Layer 4" "--skip benchmark_4k_stroke_on_multilayer_document"
|
||||
run_crate "hcie-engine-api" "Layer 4" --skip benchmark_4k_stroke_on_multilayer_document
|
||||
else
|
||||
run_crate "hcie-engine-api" "Layer 4"
|
||||
fi
|
||||
@@ -130,10 +165,10 @@ if [ "$INCLUDE_IGNORED" = true ]; then
|
||||
SEPARATOR
|
||||
echo "Running IGNORED tests (visual checks, benchmarks)"
|
||||
SEPARATOR
|
||||
cargo test -p hcie-engine-api -- --ignored || true
|
||||
cargo test -p hcie-brush-engine -- --ignored || true
|
||||
cargo test -p hcie-iced-gui -- --ignored || true
|
||||
cargo test -p hcie-fx -- --ignored || true
|
||||
run_ignored_tests hcie-engine-api
|
||||
run_ignored_tests hcie-brush-engine
|
||||
run_ignored_tests hcie-iced-gui
|
||||
run_ignored_tests hcie-fx
|
||||
fi
|
||||
|
||||
display_summary
|
||||
|
||||
Reference in New Issue
Block a user