将最小解释器验证改为fixture驱动
结论:最小解释器 harness 改为读取 G-code fixture,并通过 expected canonical event fixture 验证 G0/G1/feed 输出,后续扩展覆盖可直接新增 fixture。检查:git diff --check 通过;wasm-port/tests/native/verify_native_probes.sh 通过。
This commit is contained in:
@@ -3,6 +3,7 @@ set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
BUILD_DIR="$ROOT_DIR/build/native"
|
||||
EXPECTED_EVENTS="$ROOT_DIR/tests/fixtures/canon/minimal_linear.events"
|
||||
|
||||
"$ROOT_DIR/tools/build_native_probes.sh"
|
||||
|
||||
@@ -35,11 +36,13 @@ check_exitcode linuxcnc_rs274_compile_probe
|
||||
RUN_STDOUT="$BUILD_DIR/linuxcnc_interp_minimal_harness.run.stdout.log"
|
||||
|
||||
grep -Fq "read=0" "$RUN_STDOUT"
|
||||
grep -Fq "execute=0" "$RUN_STDOUT"
|
||||
grep -Fq "execute_feed=0" "$RUN_STDOUT"
|
||||
grep -Fq "execute_line_1=0" "$RUN_STDOUT"
|
||||
grep -Fq "execute_line_2=0" "$RUN_STDOUT"
|
||||
grep -Fq "parse_line=0" "$RUN_STDOUT"
|
||||
grep -Fq "canon_event=STRAIGHT_TRAVERSE line=0 x=1 y=2 z=0" "$RUN_STDOUT"
|
||||
grep -Fq "canon_event=SET_FEED_RATE rate=120" "$RUN_STDOUT"
|
||||
grep -Fq "canon_event=STRAIGHT_FEED line=0 x=3 y=4 z=0" "$RUN_STDOUT"
|
||||
|
||||
while IFS= read -r expected_event; do
|
||||
[[ -z "$expected_event" ]] && continue
|
||||
grep -Fq "$expected_event" "$RUN_STDOUT"
|
||||
done < "$EXPECTED_EVENTS"
|
||||
|
||||
echo "native probe validation complete"
|
||||
|
||||
Reference in New Issue
Block a user