Harden LinuxCNC wasm and native probe workflows
This commit is contained in:
@@ -6,16 +6,58 @@ cd "$(dirname "$0")"
|
||||
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
|
||||
cxx=${CXX:-g++}
|
||||
python_includes=$(python3.13-config --includes 2>/dev/null || python3-config --includes)
|
||||
manifest=${1:-linuxcnc-rs274-source-files.txt}
|
||||
|
||||
if [[ ! -f "$manifest" ]]; then
|
||||
echo "missing manifest: $manifest" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d "$linuxcnc_root" ]]; then
|
||||
echo "missing LinuxCNC root: $linuxcnc_root" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while IFS=: read -r group path note; do
|
||||
case "$group" in
|
||||
""|\#*) continue ;;
|
||||
""|\#*)
|
||||
continue
|
||||
;;
|
||||
core|binding|tooldata)
|
||||
;;
|
||||
*)
|
||||
echo "unknown manifest group: $group" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
if [[ ! -f "$linuxcnc_root/$path" ]]; then
|
||||
echo "missing manifest file: $path" >&2
|
||||
exit 1
|
||||
fi
|
||||
done < linuxcnc-rs274-source-files.txt
|
||||
done < "$manifest"
|
||||
|
||||
missing_source_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_rs274_manifest_source.XXXXXX.txt")
|
||||
missing_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_rs274_manifest_source.XXXXXX.log")
|
||||
printf 'core:src/emc/rs274ngc/does_not_exist.cc:test missing source\n' >"$missing_source_manifest"
|
||||
if ./test-linuxcnc-source-objects.sh "$missing_source_manifest" >"$missing_source_log" 2>&1; then
|
||||
echo "linuxcnc source object probe accepted missing manifest file" >&2
|
||||
exit 1
|
||||
fi
|
||||
if ! grep -F "missing manifest file: src/emc/rs274ngc/does_not_exist.cc" "$missing_source_log" >/dev/null; then
|
||||
echo "linuxcnc source object probe did not report missing manifest file clearly" >&2
|
||||
sed -n '1,20p' "$missing_source_log" >&2
|
||||
exit 1
|
||||
fi
|
||||
if ./test-linuxcnc-source-link.sh "$missing_source_manifest" >"$missing_source_log" 2>&1; then
|
||||
echo "linuxcnc source link probe accepted missing manifest file" >&2
|
||||
exit 1
|
||||
fi
|
||||
if ! grep -F "missing manifest file: src/emc/rs274ngc/does_not_exist.cc" "$missing_source_log" >/dev/null; then
|
||||
echo "linuxcnc source link probe did not report missing manifest file clearly" >&2
|
||||
sed -n '1,20p' "$missing_source_log" >&2
|
||||
exit 1
|
||||
fi
|
||||
rm -f "$missing_source_manifest" "$missing_source_log"
|
||||
|
||||
common_flags=(
|
||||
-std=c++17
|
||||
@@ -45,4 +87,3 @@ for source in "${probe_sources[@]}"; do
|
||||
done
|
||||
|
||||
echo "linuxcnc rs274 source syntax probe passed"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user