参考所有分组,完成尽量多的内容:收紧 manifest 坏行校验
结论:通用 LinuxCNC manifest lister 现在与输入校验一致拒绝缺少 note 或字段数量异常的坏行,并在 all-native guardrail 中覆盖通用 lister 与 native/source-link 调用链;未扩展 smoke 功能。
This commit is contained in:
@@ -44,13 +44,20 @@ case "$output_mode" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
seen_sources=()
|
seen_sources=()
|
||||||
while IFS=: read -r group path note; do
|
manifest_line_number=0
|
||||||
case "$group" in
|
while IFS= read -r manifest_line || [[ -n "$manifest_line" ]]; do
|
||||||
|
manifest_line_number=$((manifest_line_number + 1))
|
||||||
|
case "$manifest_line" in
|
||||||
""|\#*)
|
""|\#*)
|
||||||
continue
|
continue
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
IFS=: read -r group path note extra <<<"$manifest_line"
|
||||||
|
if [[ -z "$group" || -z "$path" || -z "$note" || -n "${extra:-}" ]]; then
|
||||||
|
echo "bad manifest line $manifest_line_number: $manifest_line" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
if ! contains_group "$allowed_groups" "$group"; then
|
if ! contains_group "$allowed_groups" "$group"; then
|
||||||
echo "unknown manifest group: $group" >&2
|
echo "unknown manifest group: $group" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -1013,6 +1013,38 @@ for script in \
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
printf 'core:src/emc/rs274ngc/interp_arc.cc\n' >"$bad_line_manifest"
|
||||||
|
if ./list-linuxcnc-manifest-sources.sh \
|
||||||
|
"$bad_line_manifest" \
|
||||||
|
core \
|
||||||
|
relative \
|
||||||
|
core \
|
||||||
|
core \
|
||||||
|
"missing manifest source" >"$bad_line_log" 2>&1; then
|
||||||
|
echo "common manifest source lister accepted bad manifest line" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if ! grep -F "bad manifest line 1: core:src/emc/rs274ngc/interp_arc.cc" "$bad_line_log" >/dev/null; then
|
||||||
|
echo "common manifest source lister did not report bad manifest line clearly" >&2
|
||||||
|
sed -n '1,20p' "$bad_line_log" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
for script in \
|
||||||
|
list-linuxcnc-source-manifest-sources.sh \
|
||||||
|
test-linuxcnc-source-syntax.sh \
|
||||||
|
test-linuxcnc-source-objects.sh \
|
||||||
|
test-linuxcnc-source-link.sh; do
|
||||||
|
if "./$script" "$bad_line_manifest" >"$bad_line_log" 2>&1; then
|
||||||
|
echo "$script accepted bad manifest line" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if ! grep -F "bad manifest line 1: core:src/emc/rs274ngc/interp_arc.cc" "$bad_line_log" >/dev/null; then
|
||||||
|
echo "$script did not report bad manifest line clearly" >&2
|
||||||
|
sed -n '1,20p' "$bad_line_log" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
./list-linuxcnc-source-manifest-sources.sh "$manifest" core >/dev/null
|
./list-linuxcnc-source-manifest-sources.sh "$manifest" core >/dev/null
|
||||||
native_manifest_core=$(./list-linuxcnc-source-manifest-sources.sh "$manifest" core)
|
native_manifest_core=$(./list-linuxcnc-source-manifest-sources.sh "$manifest" core)
|
||||||
grep -Fx "src/emc/rs274ngc/interp_arc.cc" <<<"$native_manifest_core" >/dev/null
|
grep -Fx "src/emc/rs274ngc/interp_arc.cc" <<<"$native_manifest_core" >/dev/null
|
||||||
|
|||||||
Reference in New Issue
Block a user