参考所有分组,完成尽量多的内容。禁止顺手扩功能 smoke

结论:补齐 switchkins/remap 表 checker 与 cached checker 的 CLI 拒绝守卫,锁住未知选项、多余参数、缺失 cache-dir 和空白缓存目录,不新增 CNC 行为或 smoke 功能。
This commit is contained in:
cnc
2026-06-03 19:55:53 +08:00
parent 8151829643
commit bc54b5f8f8

View File

@@ -39,6 +39,10 @@ missing_source_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_native_syntax_missing_
missing_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_native_syntax_missing_source.XXXXXX.log") missing_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_native_syntax_missing_source.XXXXXX.log")
kinematics_unknown_filter_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_kinematics_manifest_unknown_filter.XXXXXX.log") kinematics_unknown_filter_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_kinematics_manifest_unknown_filter.XXXXXX.log")
kinematics_unknown_output_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_kinematics_manifest_unknown_output.XXXXXX.log") kinematics_unknown_output_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_kinematics_manifest_unknown_output.XXXXXX.log")
switchkins_checker_unknown_option_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_switchkins_checker_unknown_option.XXXXXX.log")
switchkins_checker_too_many_args_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_switchkins_checker_too_many_args.XXXXXX.log")
switchkins_cached_missing_cache_dir_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_switchkins_cached_missing_cache_dir.XXXXXX.log")
switchkins_cached_whitespace_cache_dir_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_switchkins_cached_whitespace_cache_dir.XXXXXX.log")
bad_line_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_bad_manifest_line.XXXXXX.txt") bad_line_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_bad_manifest_line.XXXXXX.txt")
bad_line_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_bad_manifest_line.XXXXXX.log") bad_line_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_bad_manifest_line.XXXXXX.log")
absolute_source_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_absolute_manifest_source.XXXXXX.txt") absolute_source_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_absolute_manifest_source.XXXXXX.txt")
@@ -76,6 +80,10 @@ cleanup_native_test_temps() {
"$missing_source_log" \ "$missing_source_log" \
"$kinematics_unknown_filter_log" \ "$kinematics_unknown_filter_log" \
"$kinematics_unknown_output_log" \ "$kinematics_unknown_output_log" \
"$switchkins_checker_unknown_option_log" \
"$switchkins_checker_too_many_args_log" \
"$switchkins_cached_missing_cache_dir_log" \
"$switchkins_cached_whitespace_cache_dir_log" \
"$bad_line_manifest" \ "$bad_line_manifest" \
"$bad_line_log" \ "$bad_line_log" \
"$absolute_source_manifest" \ "$absolute_source_manifest" \
@@ -197,6 +205,10 @@ for forbidden_manual_cleanup in \
'rm -f "$missing_source_manifest" "$missing_source_log"' \ 'rm -f "$missing_source_manifest" "$missing_source_log"' \
'rm -f "$kinematics_unknown_filter_log"' \ 'rm -f "$kinematics_unknown_filter_log"' \
'rm -f "$kinematics_unknown_output_log"' \ 'rm -f "$kinematics_unknown_output_log"' \
'rm -f "$switchkins_checker_unknown_option_log"' \
'rm -f "$switchkins_checker_too_many_args_log"' \
'rm -f "$switchkins_cached_missing_cache_dir_log"' \
'rm -f "$switchkins_cached_whitespace_cache_dir_log"' \
'rm -f "$bad_line_manifest" "$bad_line_log"' \ 'rm -f "$bad_line_manifest" "$bad_line_log"' \
'rm -f "$absolute_source_manifest" "$absolute_source_log"' \ 'rm -f "$absolute_source_manifest" "$absolute_source_log"' \
'rm -f "$invalid_build_jobs_log"' \ 'rm -f "$invalid_build_jobs_log"' \
@@ -1294,6 +1306,44 @@ grep -F 'configs/sim/axis/vismach/scara/scara.ini TOOL_TABLE=scara.tbl' check-li
grep -F 'configs/sim/qtvcp_screens/non-trivial/scara/scara.ini TOOL_TABLE=scara.tbl' check-linuxcnc-inputs.sh >/dev/null grep -F 'configs/sim/qtvcp_screens/non-trivial/scara/scara.ini TOOL_TABLE=scara.tbl' check-linuxcnc-inputs.sh >/dev/null
grep -F 'LinuxCNC M428/M429/M430 INI TOOL_TABLE files have new unresolved sources' check-linuxcnc-inputs.sh >/dev/null grep -F 'LinuxCNC M428/M429/M430 INI TOOL_TABLE files have new unresolved sources' check-linuxcnc-inputs.sh >/dev/null
grep -F 'LinuxCNC M428/M429/M430 INI TOOL_TABLE unresolved source set changed' check-linuxcnc-inputs.sh >/dev/null grep -F 'LinuxCNC M428/M429/M430 INI TOOL_TABLE unresolved source set changed' check-linuxcnc-inputs.sh >/dev/null
if ./check-linuxcnc-switchkins-remap-table.sh --unknown >"$switchkins_checker_unknown_option_log" 2>&1; then
echo "switchkins remap table checker accepted an unknown option" >&2
exit 1
fi
if ! grep -F "unknown switchkins remap table checker option: --unknown" "$switchkins_checker_unknown_option_log" >/dev/null; then
echo "switchkins remap table checker did not report unknown options clearly" >&2
sed -n '1,20p' "$switchkins_checker_unknown_option_log" >&2
exit 1
fi
if ./check-linuxcnc-switchkins-remap-table.sh linuxcnc-kinematics-source-files.txt extra >"$switchkins_checker_too_many_args_log" 2>&1; then
echo "switchkins remap table checker accepted too many arguments" >&2
exit 1
fi
if ! grep -F "too many switchkins remap table checker arguments" "$switchkins_checker_too_many_args_log" >/dev/null; then
echo "switchkins remap table checker did not report too many arguments clearly" >&2
sed -n '1,20p' "$switchkins_checker_too_many_args_log" >&2
exit 1
fi
if ./check-linuxcnc-switchkins-remap-table-cached.sh --cache-dir >"$switchkins_cached_missing_cache_dir_log" 2>&1; then
echo "cached switchkins remap table checker accepted --cache-dir without a value" >&2
exit 1
fi
if ! grep -F "missing --cache-dir value" "$switchkins_cached_missing_cache_dir_log" >/dev/null; then
echo "cached switchkins remap table checker did not report missing cache-dir values clearly" >&2
sed -n '1,20p' "$switchkins_cached_missing_cache_dir_log" >&2
exit 1
fi
if ./check-linuxcnc-switchkins-remap-table-cached.sh --cache-dir "build/switchkins cache" \
linuxcnc-kinematics-source-files.txt >"$switchkins_cached_whitespace_cache_dir_log" 2>&1; then
echo "cached switchkins remap table checker accepted whitespace in cache dir" >&2
exit 1
fi
if ! grep -F "CNC_SIM_PREFLIGHT_CACHE_DIR must not contain whitespace: build/switchkins cache" \
"$switchkins_cached_whitespace_cache_dir_log" >/dev/null; then
echo "cached switchkins remap table checker did not report whitespace cache dirs clearly" >&2
sed -n '1,20p' "$switchkins_cached_whitespace_cache_dir_log" >&2
exit 1
fi
grep -Fx "HALCMD = sets :x-offset -20" "$linuxcnc_root/configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzbc-trt.ini" >/dev/null grep -Fx "HALCMD = sets :x-offset -20" "$linuxcnc_root/configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzbc-trt.ini" >/dev/null
grep -Fx "HALCMD = sets :z-offset -15" "$linuxcnc_root/configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzbc-trt.ini" >/dev/null grep -Fx "HALCMD = sets :z-offset -15" "$linuxcnc_root/configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzbc-trt.ini" >/dev/null
grep -Fx "HALCMD = setp xyzbc-trt-kins.x-rot-point 0" "$linuxcnc_root/configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzbc-trt.ini" >/dev/null grep -Fx "HALCMD = setp xyzbc-trt-kins.x-rot-point 0" "$linuxcnc_root/configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzbc-trt.ini" >/dev/null