Harden LinuxCNC wasm and native probe workflows
This commit is contained in:
59
test-linuxcnc-wasm-source-syntax.sh
Executable file
59
test-linuxcnc-wasm-source-syntax.sh
Executable file
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
|
||||
manifest=${1:-linuxcnc-rs274-wasm-source-files.txt}
|
||||
cxx=${CXX:-g++}
|
||||
|
||||
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
|
||||
|
||||
common_flags=(
|
||||
-std=c++20
|
||||
-DULAPI
|
||||
-fsyntax-only
|
||||
-include wctype.h
|
||||
-I "$(pwd)/core/include"
|
||||
-I "$(pwd)/core/src"
|
||||
-I "$(pwd)/core/wasm_shims"
|
||||
-I "$linuxcnc_root/src"
|
||||
-I "$linuxcnc_root/src/emc"
|
||||
-I "$linuxcnc_root/src/emc/nml_intf"
|
||||
-I "$linuxcnc_root/src/emc/rs274ngc"
|
||||
-I "$linuxcnc_root/src/emc/motion"
|
||||
-I "$linuxcnc_root/include"
|
||||
)
|
||||
|
||||
sources=()
|
||||
while IFS=: read -r group path note; do
|
||||
case "$group" in
|
||||
core)
|
||||
if [[ ! -f "$linuxcnc_root/$path" ]]; then
|
||||
echo "missing manifest source: $path" >&2
|
||||
exit 1
|
||||
fi
|
||||
sources+=("$path")
|
||||
;;
|
||||
""|\#*|blocked)
|
||||
;;
|
||||
*)
|
||||
echo "unknown manifest group: $group" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done < "$manifest"
|
||||
|
||||
for source in "${sources[@]}"; do
|
||||
"$cxx" "${common_flags[@]}" "$linuxcnc_root/$source"
|
||||
done
|
||||
|
||||
echo "linuxcnc wasm-safe source syntax probe passed (${#sources[@]} files)"
|
||||
Reference in New Issue
Block a user