高效率推进 LinuxCNC 源码对齐流程

说明:集中 LinuxCNC 源码清单与 wasm/native probe 的路径解析,补强 manifest、shim、source-link 检查,并保持 LinuxCNC 源码后端对齐验证流程可复用。

验证:./test-native.sh;./test-linuxcnc-source-link.sh;./test-all-native.sh;wasm source/probe 相关脚本。
This commit is contained in:
cnc
2026-05-27 11:14:06 +08:00
parent ce2f3f3769
commit 40a63c76f7
44 changed files with 3566 additions and 475 deletions

View File

@@ -17,34 +17,61 @@ if [[ ! -d "$linuxcnc_root" ]]; then
fi
python_blockers=()
core_python_sources=()
dlopen_blockers=()
core_dlopen_sources=()
tooldata_blockers=()
core_tooldata_sources=()
shimmed_tooldata_users=()
core_tooldata_users=()
native_backend_blockers=()
native_fs_blockers=()
core_native_fs_sources=()
core_count=0
blocked_count=0
blocked_replacements=()
core_source_list=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_wasm_blocker_core_sources.XXXXXX.txt")
blocked_source_list=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_wasm_blocker_blocked_sources.XXXXXX.txt")
trap 'rm -f "$core_source_list" "$blocked_source_list"' EXIT
while IFS=: read -r group path note; do
[[ -z "$group" || "$group" == \#* ]] && continue
case "$group" in
core)
continue
;;
blocked)
blocked_replacement_for() {
case "$1" in
src/emc/tooldata/tooldata_mmap.cc)
./list-linuxcnc-wasm-safe-shims.sh tooldata_mmap_backend.cc
;;
*)
echo "unknown manifest group: $group" >&2
exit 1
return 1
;;
esac
}
./list-linuxcnc-wasm-manifest-sources.sh "$manifest" core > "$core_source_list"
./list-linuxcnc-wasm-manifest-sources.sh "$manifest" blocked > "$blocked_source_list"
core_count=$(wc -l < "$core_source_list")
blocked_count=$(wc -l < "$blocked_source_list")
scan_source() {
local group=$1
local path=$2
full_path="$linuxcnc_root/$path"
if [[ ! -f "$full_path" ]]; then
echo "missing manifest source: $path" >&2
exit 1
if [[ "$group" == "blocked" ]]; then
if ! replacement=$(blocked_replacement_for "$path"); then
echo "missing blocked replacement mapping: $path" >&2
exit 1
fi
if [[ ! -f "$replacement" ]]; then
echo "missing blocked replacement source: $replacement" >&2
exit 1
fi
blocked_replacements+=("$path -> $replacement")
fi
if [[ "$path" == src/emc/tooldata/* ]]; then
tooldata_blockers+=("$path")
if [[ "$group" == "blocked" ]]; then
tooldata_blockers+=("$path")
else
core_tooldata_sources+=("$path")
fi
fi
if [[ "$path" == "src/emc/tooldata/tooldata_mmap.cc" ]]; then
@@ -52,21 +79,47 @@ while IFS=: read -r group path note; do
fi
if grep -Eq 'Python\.h|boost/python|pythonplugin|PyObject|PyInit_' "$full_path"; then
python_blockers+=("$path")
if [[ "$group" == "blocked" ]]; then
python_blockers+=("$path")
else
core_python_sources+=("$path")
fi
fi
if grep -Eq 'dlopen|dlsym|RTLD_' "$full_path"; then
dlopen_blockers+=("$path")
if [[ "$group" == "blocked" ]]; then
dlopen_blockers+=("$path")
else
core_dlopen_sources+=("$path")
fi
fi
if grep -Eq 'mkstemp|mkstemps|dirent\.h|opendir|readdir|unistd\.h' "$full_path"; then
native_fs_blockers+=("$path")
if [[ "$group" == "blocked" ]]; then
native_fs_blockers+=("$path")
else
core_native_fs_sources+=("$path")
fi
fi
if [[ "$path" != src/emc/tooldata/* ]] && grep -Eq 'tooldata/tooldata.hh|tooldata_' "$full_path"; then
shimmed_tooldata_users+=("$path")
if [[ "$group" == "blocked" ]]; then
shimmed_tooldata_users+=("$path")
else
core_tooldata_users+=("$path")
fi
fi
done < "$manifest"
}
while IFS= read -r path; do
[[ -z "$path" ]] && continue
scan_source core "$path"
done < "$core_source_list"
while IFS= read -r path; do
[[ -z "$path" ]] && continue
scan_source blocked "$path"
done < "$blocked_source_list"
print_group() {
local title=$1
@@ -80,9 +133,20 @@ print_group() {
echo
}
echo "[manifest]"
echo "core=$core_count"
echo "blocked=$blocked_count"
echo
print_group "python" "${python_blockers[@]}"
print_group "dlopen" "${dlopen_blockers[@]}"
print_group "tooldata" "${tooldata_blockers[@]}"
print_group "tooldata-users" "${shimmed_tooldata_users[@]}"
print_group "native-backend" "${native_backend_blockers[@]}"
print_group "native-fs" "${native_fs_blockers[@]}"
print_group "blocked-replacements" "${blocked_replacements[@]}"
print_group "core-python-shimmed" "${core_python_sources[@]}"
print_group "core-dlopen-shimmed" "${core_dlopen_sources[@]}"
print_group "core-tooldata-shimmed" "${core_tooldata_sources[@]}"
print_group "core-tooldata-users-shimmed" "${core_tooldata_users[@]}"
print_group "core-native-fs-shimmed" "${core_native_fs_sources[@]}"

View File

@@ -4,27 +4,55 @@ set -euo pipefail
cd "$(dirname "$0")"
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
manifest=${1:-linuxcnc-rs274-wasm-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
manifest=$(cd "$(dirname "$manifest")" && pwd)/$(basename "$manifest")
linuxcnc_root=$(cd "$linuxcnc_root" && pwd)
default_manifest="$PWD/linuxcnc-rs274-wasm-source-files.txt"
# This script writes fixed build and public artifact paths, so serialize it.
exec 9>"${TMPDIR:-/tmp}/cnc_sim_build_wasm.lock"
flock 9
manifest_core_count=0
manifest_blocked_count=0
manifest_core_sources=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_wasm_manifest_core.XXXXXX.txt")
manifest_blocked_sources=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_wasm_manifest_blocked.XXXXXX.txt")
trap 'rm -f "$manifest_core_sources" "$manifest_blocked_sources"' EXIT
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" core > "$manifest_core_sources"
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" blocked > "$manifest_blocked_sources"
manifest_core_count=$(wc -l < "$manifest_core_sources")
manifest_blocked_count=$(wc -l < "$manifest_blocked_sources")
if [[ "$manifest_core_count" -eq 0 || "$manifest_blocked_count" -eq 0 ]]; then
echo "unexpected wasm manifest partition: core=$manifest_core_count blocked=$manifest_blocked_count" >&2
exit 1
fi
if [[ "$manifest" == "$default_manifest" ]] && [[ "$manifest_core_count" -ne 25 || "$manifest_blocked_count" -ne 1 ]]; then
echo "unexpected wasm manifest partition: core=$manifest_core_count blocked=$manifest_blocked_count" >&2
exit 1
fi
echo "LinuxCNC wasm blocker scan"
./test-linuxcnc-wasm-blockers.sh
./test-linuxcnc-wasm-blockers.sh "$manifest"
echo "LinuxCNC wasm-safe source syntax probe"
./test-linuxcnc-wasm-source-syntax.sh
./test-linuxcnc-wasm-source-syntax.sh "$manifest"
echo "LinuxCNC wasm-safe source object probe"
./test-linuxcnc-wasm-source-objects.sh
./test-linuxcnc-wasm-source-objects.sh "$manifest"
echo "LinuxCNC wasm-safe CMake probe target"
./test-linuxcnc-wasm-cmake-safe-probe.sh
./test-linuxcnc-wasm-cmake-safe-probe.sh "$manifest"
echo "LinuxCNC wasm tooldata shim link probe"
./test-linuxcnc-wasm-tooldata-link.sh
@@ -51,10 +79,10 @@ echo "LinuxCNC wasm rs274ngc_pre object probe"
./test-linuxcnc-wasm-rs274ngc-pre-object.sh
echo "LinuxCNC wasm rs274ngc_pre link blocker scan"
./test-linuxcnc-wasm-rs274ngc-pre-link-blockers.sh
./test-linuxcnc-wasm-rs274ngc-pre-link-blockers.sh "$manifest"
echo "LinuxCNC wasm rs274ngc_pre link probe"
./test-linuxcnc-wasm-rs274ngc-pre-link.sh
./test-linuxcnc-wasm-rs274ngc-pre-link.sh "$manifest"
if ! command -v emcmake >/dev/null 2>&1; then
echo "Emscripten is required. Install/activate emsdk so emcmake and emcc are in PATH." >&2
@@ -64,6 +92,7 @@ fi
emcmake cmake -S core -B build/wasm \
-DCMAKE_BUILD_TYPE=Release \
-DCNC_SIM_LINUXCNC_ROOT="$linuxcnc_root" \
-DCNC_SIM_LINUXCNC_WASM_SOURCE_MANIFEST="$manifest" \
-DCNC_SIM_ENABLE_LINUXCNC_WASM_SAFE_PROBE=ON
cmake --build build/wasm

View File

@@ -243,6 +243,11 @@ if(NOT EMSCRIPTEN)
target_link_libraries(rtcp_kinematics_smoke PRIVATE cnc_sim_core)
target_include_directories(rtcp_kinematics_smoke PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
add_executable(linuxcnc_gees_table_smoke
tests/linuxcnc_gees_table_smoke.cpp
)
target_include_directories(linuxcnc_gees_table_smoke PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
add_executable(simulator_gcode_controls_smoke
tests/simulator_gcode_controls_smoke.cpp
)

File diff suppressed because it is too large Load Diff

View File

@@ -443,6 +443,37 @@ int main() {
ok &= expect(saw_g432_h_tool_length, "expected LinuxCNC G43.2 H tool-table additive event");
ok &= expect(saw_g49_dynamic_tool_length_clear, "expected LinuxCNC G49 dynamic tool length clear event");
const char g49_tool_offset_parameter_program[] =
"G21 G90 G17\n"
"G43.2 H1\n"
"O10 if [#<_tool_offset> EQ 1]\n"
"G1 X1 F100\n"
"O10 endif\n"
"G49\n"
"O10 if [#<_tool_offset> EQ 0]\n"
"G1 X2 F100\n"
"O10 endif\n"
"M30\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
g49_tool_offset_parameter_program,
sizeof(g49_tool_offset_parameter_program) - 1) == 0,
cnc_sim_last_error(sim));
bool saw_g49_tool_offset_parameter_before = false;
bool saw_g49_tool_offset_parameter_after = false;
for (const auto &event : events) {
saw_g49_tool_offset_parameter_before = saw_g49_tool_offset_parameter_before ||
(event.type == CNC_SIM_EVENT_LINEAR_FEED &&
event.line == 4 &&
near(event.end.x, 1.0));
saw_g49_tool_offset_parameter_after = saw_g49_tool_offset_parameter_after ||
(event.type == CNC_SIM_EVENT_LINEAR_FEED &&
event.line == 8 &&
near(event.end.x, 2.0));
}
ok &= expect(saw_g49_tool_offset_parameter_before && saw_g49_tool_offset_parameter_after,
"expected LinuxCNC G49 to clear the applied tool offset parameter before the next motion");
const char spindle_program[] =
"G21 G90 G17\n"
"S1200 M3\n"

View File

@@ -1384,6 +1384,33 @@ int main() {
ok &= expect(saw_immediate_g49_named_restore,
"expected G49 to restore readonly position named parameters before the next motion");
const char g49_tool_offset_parameter_program[] =
"G21 G90 G17\n"
"G43.2 H1\n"
"O10 if [#<_tool_offset> EQ 1]\n"
"G1 X1 F100\n"
"O10 endif\n"
"G49\n"
"O10 if [#<_tool_offset> EQ 0]\n"
"G1 X2 F100\n"
"O10 endif\n"
"M30\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
g49_tool_offset_parameter_program,
sizeof(g49_tool_offset_parameter_program) - 1) == 0,
cnc_sim_last_error(sim));
bool saw_g49_tool_offset_parameter = false;
for (const auto &event : events) {
saw_g49_tool_offset_parameter = saw_g49_tool_offset_parameter ||
(event.type == CNC_SIM_EVENT_LINEAR_FEED &&
near(event.end.x, 1.0)) ||
(event.type == CNC_SIM_EVENT_LINEAR_FEED &&
near(event.end.x, 2.0));
}
ok &= expect(saw_g49_tool_offset_parameter,
"expected G49 to clear the applied tool offset parameter before the next motion");
const char g43_tool_length_program[] =
"G21 G90 G17\n"
"G43 H1\n"
@@ -1718,6 +1745,8 @@ int main() {
missing_g43_h_tool_program,
sizeof(missing_g43_h_tool_program) - 1) != 0,
"expected LinuxCNC G43 H to reject tool numbers missing from the tool table");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Requested tool 3 not found in the tool table",
"expected LinuxCNC missing-G43-H-tool error text");
const char invalid_h_word_program[] =
"G21 G90 G17\n"
@@ -1826,6 +1855,8 @@ int main() {
invalid_cutter_g53_program,
sizeof(invalid_cutter_g53_program) - 1) != 0,
"expected G53 to reject cutter compensation");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Cannot use g53 with cutter radius comp",
"expected LinuxCNC G53 cutter-comp error text");
const char invalid_cutter_g28_program[] =
"G21 G90 G17\n"
@@ -1836,6 +1867,8 @@ int main() {
invalid_cutter_g28_program,
sizeof(invalid_cutter_g28_program) - 1) != 0,
"expected G28/G30 to reject cutter compensation");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Cannot use g28 or g30 with cutter radius comp",
"expected LinuxCNC G28 cutter-comp error text");
const char invalid_cutter_g281_program[] =
"G21 G90 G17\n"
@@ -1846,6 +1879,8 @@ int main() {
invalid_cutter_g281_program,
sizeof(invalid_cutter_g281_program) - 1) != 0,
"expected G28.1/G30.1 to reject cutter compensation");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Cannot set reference point with cutter compensation in effect",
"expected LinuxCNC G28.1 cutter-comp error text");
const char invalid_cutter_g92_program[] =
"G21 G90 G17\n"
@@ -1856,6 +1891,8 @@ int main() {
invalid_cutter_g92_program,
sizeof(invalid_cutter_g92_program) - 1) != 0,
"expected G92 to reject cutter compensation");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Cannot change axis offsets with cutter radius comp",
"expected LinuxCNC G92 cutter-comp error text");
const char invalid_cutter_g64_program[] =
"G21 G90 G17\n"
@@ -1866,6 +1903,8 @@ int main() {
invalid_cutter_g64_program,
sizeof(invalid_cutter_g64_program) - 1) != 0,
"expected G64 to reject cutter compensation");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Cannot change control mode with cutter radius compensation on",
"expected LinuxCNC G64 cutter-comp error text");
const char invalid_cutter_override_program[] =
"G21 G90 G17\n"
@@ -1876,6 +1915,8 @@ int main() {
invalid_cutter_override_program,
sizeof(invalid_cutter_override_program) - 1) != 0,
"expected override controls to reject cutter compensation");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Cannot disable overrides with cutter radius compensation on",
"expected LinuxCNC M50 cutter-comp error text");
const char invalid_cutter_digital_output_program[] =
"G21 G90 G17\n"
@@ -1886,6 +1927,8 @@ int main() {
invalid_cutter_digital_output_program,
sizeof(invalid_cutter_digital_output_program) - 1) != 0,
"expected digital outputs to reject cutter compensation");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Cannot set motion output with cutter radius compensation on",
"expected LinuxCNC M62 cutter-comp error text");
const char invalid_cutter_motion_digital_output_program[] =
"G21 G90 G17\n"
@@ -1909,6 +1952,8 @@ int main() {
invalid_cutter_analog_output_program,
sizeof(invalid_cutter_analog_output_program) - 1) != 0,
"expected analog outputs to reject cutter compensation");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Cannot set motion analog output with cutter radius compensation on",
"expected LinuxCNC M67 cutter-comp error text");
const char invalid_cutter_g76_program[] =
"G21 G90 G17\n"
@@ -1919,6 +1964,8 @@ int main() {
invalid_cutter_g76_program,
sizeof(invalid_cutter_g76_program) - 1) != 0,
"expected G76 to reject cutter compensation");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Cannot use G76 threading cycle with cutter radius compensation on",
"expected LinuxCNC G76 cutter-comp error text");
const char invalid_cutter_g98_program[] =
"G21 G90 G17\n"
@@ -1929,6 +1976,9 @@ int main() {
invalid_cutter_g98_program,
sizeof(invalid_cutter_g98_program) - 1) != 0,
"expected G98/G99 to reject cutter compensation");
ok &= expect(std::string(cnc_sim_last_error(sim)) ==
"Cannot change retract mode with cutter radius compensation on",
"expected LinuxCNC G98 cutter-comp error text");
const char invalid_cutter_tool_change_program[] =
"G21 G90 G17\n"
@@ -1940,6 +1990,8 @@ int main() {
invalid_cutter_tool_change_program,
sizeof(invalid_cutter_tool_change_program) - 1) != 0,
"expected M6 to reject cutter compensation");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Cannot change tools with cutter radius compensation on",
"expected LinuxCNC M6 cutter-comp error text");
const char missing_t_for_m6_program[] =
"G21 G90 G17\n"
@@ -1961,6 +2013,8 @@ int main() {
invalid_cutter_wait_input_program,
sizeof(invalid_cutter_wait_input_program) - 1) != 0,
"expected M66 to reject cutter compensation");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Cannot wait for digital input with cutter radius compensation on",
"expected LinuxCNC M66 cutter-comp error text");
const char invalid_g431_motion_program[] =
"G21 G90 G17\n"
@@ -1970,6 +2024,8 @@ int main() {
invalid_g431_motion_program,
sizeof(invalid_g431_motion_program) - 1) != 0,
"expected G43.1 to reject motion on the same line");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Cannot command motion on the same line as G43.1",
"expected LinuxCNC G43.1 same-line-motion error text");
const char mixed_g432_h_axis_program[] =
"G21 G90 G17\n"
@@ -1979,6 +2035,8 @@ int main() {
mixed_g432_h_axis_program,
sizeof(mixed_g432_h_axis_program) - 1) != 0,
"expected G43.2 to reject mixed H and axis words");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "G43.2: Can not have both H and axis words",
"expected LinuxCNC G43.2 mixed-H-axis error text");
const char missing_g432_h_tool_program[] =
"G21 G90 G17\n"
@@ -1988,6 +2046,8 @@ int main() {
missing_g432_h_tool_program,
sizeof(missing_g432_h_tool_program) - 1) != 0,
"expected LinuxCNC G43.2 H to reject tool numbers missing from the tool table");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Requested tool 3 not found in the tool table",
"expected LinuxCNC missing-G43.2-H-tool error text");
const char invalid_g432_program[] =
"G21 G90 G17\n"
@@ -1997,6 +2057,8 @@ int main() {
invalid_g432_program,
sizeof(invalid_g432_program) - 1) != 0,
"expected G43.2 to require H or axis words");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "G43.2: No axes specified and H word missing",
"expected LinuxCNC G43.2 missing-H-axis error text");
const char spindle_program[] =
"G21\n"
@@ -3769,6 +3831,9 @@ int main() {
events.clear();
ok &= expect(cnc_sim_parse_program(sim, cutter_comp_cycle_program, sizeof(cutter_comp_cycle_program) - 1) != 0,
"expected canned cycle with cutter compensation on to fail");
ok &= expect(std::string(cnc_sim_last_error(sim)) ==
"Cannot use canned cycles with cutter compensation on",
"expected LinuxCNC canned-cycle cutter-comp error text");
const char missing_g73_q_program[] =
"G21 G90 G17\n"
@@ -4202,6 +4267,8 @@ int main() {
events.clear();
ok &= expect(cnc_sim_parse_program(sim, recursive_subprogram, sizeof(recursive_subprogram) - 1) != 0,
"expected recursive M98 nesting limit to fail");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Too many subroutine levels",
"expected LinuxCNC recursive-M98 nesting-limit error text");
const char fanuc_subprogram_endsub_program[] =
"G21\n"
@@ -4650,6 +4717,24 @@ int main() {
sizeof(out_of_range_numbered_parameter_reference) - 1) != 0,
"expected out-of-range numbered parameter reference to fail");
const char zero_numbered_parameter_assignment[] =
"#0 = 1\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
zero_numbered_parameter_assignment,
sizeof(zero_numbered_parameter_assignment) - 1) != 0,
"expected #0 numbered parameter assignment to fail");
const char zero_numbered_parameter_reference[] =
"G21 G90\n"
"F100\n"
"G1 X#0\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
zero_numbered_parameter_reference,
sizeof(zero_numbered_parameter_reference) - 1) != 0,
"expected #0 numbered parameter reference to fail");
const char named_oword_subprogram[] =
"G21 G90\n"
"G0 X0 Y0 Z0\n"
@@ -4792,6 +4877,72 @@ int main() {
ok &= expect(saw_named_parameter_local, "expected local named parameter assignment in O-word call");
ok &= expect(saw_named_parameter_global_after_call, "expected global named parameter after O-word return");
const char too_many_oword_call_parameters_program[] =
"O<too_many> sub\n"
"O<too_many> endsub\n"
"O<too_many> call "
"[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] "
"[11] [12] [13] [14] [15] [16] [17] [18] [19] [20] "
"[21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31]\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
too_many_oword_call_parameters_program,
sizeof(too_many_oword_call_parameters_program) - 1) != 0,
"expected LinuxCNC to reject more than 30 O-word call parameters");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Too many subroutine parameters",
"expected LinuxCNC too-many-O-word-call-parameters error text");
const char empty_oword_call_parameter_program[] =
"O<empty_arg> sub\n"
"O<empty_arg> endsub\n"
"O<empty_arg> call []\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
empty_oword_call_parameter_program,
sizeof(empty_oword_call_parameter_program) - 1) != 0,
"expected LinuxCNC to reject an empty O-word call parameter expression");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "No characters found in reading real value",
"expected LinuxCNC empty-O-word-call-parameter error text");
const char too_many_oword_call_levels_program[] =
"O<n1> sub\n"
"O<n2> call\n"
"O<n1> endsub\n"
"O<n2> sub\n"
"O<n3> call\n"
"O<n2> endsub\n"
"O<n3> sub\n"
"O<n4> call\n"
"O<n3> endsub\n"
"O<n4> sub\n"
"O<n5> call\n"
"O<n4> endsub\n"
"O<n5> sub\n"
"O<n6> call\n"
"O<n5> endsub\n"
"O<n6> sub\n"
"O<n7> call\n"
"O<n6> endsub\n"
"O<n7> sub\n"
"O<n8> call\n"
"O<n7> endsub\n"
"O<n8> sub\n"
"O<n9> call\n"
"O<n8> endsub\n"
"O<n9> sub\n"
"O<n10> call\n"
"O<n9> endsub\n"
"O<n10> sub\n"
"O<n10> endsub\n"
"O<n1> call\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
too_many_oword_call_levels_program,
sizeof(too_many_oword_call_levels_program) - 1) != 0,
"expected LinuxCNC to reject the tenth nested O-word call level");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Too many subroutine levels",
"expected LinuxCNC too-many-subroutine-levels error text");
const char parameter_expression_assignment_program[] =
"G20\n"
"#<a> = 2\n"
@@ -4939,6 +5090,9 @@ int main() {
cutter_comp_arc_exit_program,
sizeof(cutter_comp_arc_exit_program) - 1) != 0,
"expected LinuxCNC to reject arc move immediately after exiting cutter compensation");
ok &= expect(std::string(cnc_sim_last_error(sim)) ==
"The move just after exiting cutter compensation mode must be straight, not an arc",
"expected LinuxCNC cutter-comp arc-exit error text");
const char abort_hot_comment_program[] =
"#42 = 0\n"
@@ -4970,6 +5124,9 @@ int main() {
cutter_comp_gouging_program,
sizeof(cutter_comp_gouging_program) - 1) != 0,
"expected LinuxCNC to reject straight-feed concave cutter-comp gouging");
ok &= expect(std::string(cnc_sim_last_error(sim)) ==
"Straight feed in concave corner cannot be reached by the tool without gouging",
"expected LinuxCNC cutter-comp gouging error text");
const char readonly_numbered_parameter_program[] =
"G21 G90 G17\n"
@@ -6218,6 +6375,8 @@ int main() {
malformed_number_program,
sizeof(malformed_number_program) - 1) != 0,
"expected LinuxCNC bad number format to reject malformed real values");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "bad number format (conversion failed) parsing '1.2.3'",
"expected LinuxCNC malformed-real-value error text");
const char unused_p_word_program[] =
"G21 G90\n"
@@ -6417,6 +6576,9 @@ int main() {
g71_rejects_cutter_comp_program,
sizeof(g71_rejects_cutter_comp_program) - 1) != 0,
"expected LinuxCNC to reject G71/G72 with cutter compensation enabled");
ok &= expect(std::string(cnc_sim_last_error(sim)) ==
"G71.0 cannot be used with cutter compensation enabled",
"expected LinuxCNC G71 cutter-comp error text");
const char negative_l_word_program[] =
"G21 G90\n"
@@ -7594,6 +7756,17 @@ int main() {
sizeof(invalid_g62_code_program) - 1) != 0,
"expected LinuxCNC to reject G62 as an unknown G code");
const char mixed_g434_motion_program[] =
"G21 G90\n"
"G43.4 H7 X10\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
mixed_g434_motion_program,
sizeof(mixed_g434_motion_program) - 1) != 0,
"expected LinuxCNC to reject mixed G43.4 motion as an unknown G code");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Unknown g code used",
"expected mixed G43.4 motion to use LinuxCNC unknown-G error text");
const char invalid_character_program[] =
"G21 G90\n"
"?\n";
@@ -8685,6 +8858,64 @@ int main() {
missing_function_brackets_program,
sizeof(missing_function_brackets_program) - 1) != 0,
"expected LinuxCNC function syntax to require bracketed arguments");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Left bracket missing after unary operation name",
"expected LinuxCNC missing-function-left-bracket error text");
const char missing_word_function_brackets_program[] =
"G21 G90\n"
"F100\n"
"G1 XSIN30\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
missing_word_function_brackets_program,
sizeof(missing_word_function_brackets_program) - 1) != 0,
"expected LinuxCNC word function syntax to require bracketed arguments");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Left bracket missing after unary operation name",
"expected LinuxCNC word missing-function-left-bracket error text");
const char unknown_function_word_program[] =
"G21 G90\n"
"F100\n"
"G1 XFOO[1]\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
unknown_function_word_program,
sizeof(unknown_function_word_program) - 1) != 0,
"expected LinuxCNC to reject unknown unary word values");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Unknown word starting with f",
"expected LinuxCNC unknown-unary-word error text");
const char unknown_function_word_without_brackets_program[] =
"G21 G90\n"
"F100\n"
"G1 XFOO\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
unknown_function_word_without_brackets_program,
sizeof(unknown_function_word_without_brackets_program) - 1) != 0,
"expected LinuxCNC to reject unknown unbracketed unary word values");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Unknown word starting with f",
"expected LinuxCNC unknown-unbracketed-unary-word error text");
const char atan_missing_slash_program[] =
"#1 = ATAN[1]\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
atan_missing_slash_program,
sizeof(atan_missing_slash_program) - 1) != 0,
"expected LinuxCNC ATAN syntax to require a slash before the second argument");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Slash missing after first atan argument",
"expected LinuxCNC missing-ATAN-slash error text");
const char atan_missing_second_bracket_program[] =
"#1 = ATAN[1]/1\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
atan_missing_second_bracket_program,
sizeof(atan_missing_second_bracket_program) - 1) != 0,
"expected LinuxCNC ATAN syntax to require a bracketed second argument");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Left bracket missing after slash with atan",
"expected LinuxCNC missing-ATAN-second-left-bracket error text");
const char negative_sqrt_program[] =
"#1 = SQRT[-1]\n"
@@ -8694,6 +8925,102 @@ int main() {
negative_sqrt_program,
sizeof(negative_sqrt_program) - 1) != 0,
"expected LinuxCNC to reject negative SQRT arguments");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Negative argument to sqrt",
"expected LinuxCNC negative-SQRT error text");
const char zero_ln_program[] =
"#1 = LN[0]\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
zero_ln_program,
sizeof(zero_ln_program) - 1) != 0,
"expected LinuxCNC to reject zero LN arguments");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Zero or negative argument to ln",
"expected LinuxCNC zero-LN error text");
const char out_of_range_acos_program[] =
"#1 = ACOS[2]\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
out_of_range_acos_program,
sizeof(out_of_range_acos_program) - 1) != 0,
"expected LinuxCNC to reject ACOS arguments outside [-1, 1]");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Argument to acos out of range",
"expected LinuxCNC out-of-range-ACOS error text");
const char out_of_range_asin_program[] =
"#1 = ASIN[2]\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
out_of_range_asin_program,
sizeof(out_of_range_asin_program) - 1) != 0,
"expected LinuxCNC to reject ASIN arguments outside [-1, 1]");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Argument to asin out of range",
"expected LinuxCNC out-of-range-ASIN error text");
const char negative_fractional_power_program[] =
"#1 = [-2 ** 0.5]\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
negative_fractional_power_program,
sizeof(negative_fractional_power_program) - 1) != 0,
"expected LinuxCNC to reject a negative base raised to a non-integer power");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Attempt to raise negative to non integer power",
"expected LinuxCNC negative-fractional-power error text");
const char divide_by_zero_program[] =
"#1 = [1 / 0]\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
divide_by_zero_program,
sizeof(divide_by_zero_program) - 1) != 0,
"expected LinuxCNC to reject division by zero");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Attempt to divide by zero",
"expected LinuxCNC divide-by-zero error text");
const char modulo_by_zero_program[] =
"#1 = [1 MOD 0]\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
modulo_by_zero_program,
sizeof(modulo_by_zero_program) - 1) != 0,
"expected LinuxCNC to reject modulo by zero");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Calculation resulted in 'not a number'",
"expected LinuxCNC modulo-by-zero error text");
const char unknown_n_operation_program[] =
"#1 = [1 NAND 1]\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
unknown_n_operation_program,
sizeof(unknown_n_operation_program) - 1) != 0,
"expected LinuxCNC to reject unknown n-starting binary operation names");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Unknown operation name starting with n",
"expected LinuxCNC unknown-n-operation error text");
const char unknown_word_bracket_operation_program[] =
"G21 G90\n"
"F100\n"
"G1 X[1 AXX 1]\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
unknown_word_bracket_operation_program,
sizeof(unknown_word_bracket_operation_program) - 1) != 0,
"expected LinuxCNC to reject unknown word bracket binary operation names");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Unknown operation name starting with a",
"expected LinuxCNC unknown-word-bracket-operation error text");
const char unknown_symbol_word_bracket_operation_program[] =
"G21 G90\n"
"F100\n"
"G1 X[1 ? 2]\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
unknown_symbol_word_bracket_operation_program,
sizeof(unknown_symbol_word_bracket_operation_program) - 1) != 0,
"expected LinuxCNC to reject unknown symbolic word bracket operations");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Unknown operation",
"expected LinuxCNC unknown-symbol-word-bracket-operation error text");
const char infinite_expression_program[] =
"#1 = EXP[1000]\n"
@@ -8703,6 +9030,8 @@ int main() {
infinite_expression_program,
sizeof(infinite_expression_program) - 1) != 0,
"expected LinuxCNC to reject infinite expression results");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Calculation resulted in 'infinity'",
"expected LinuxCNC infinite-expression error text");
const char hidden_infinite_expression_program[] =
"O10 if [EXP[1000] EQ EXP[1000]]\n"
@@ -8723,6 +9052,8 @@ int main() {
hidden_infinite_bracket_expression_program,
sizeof(hidden_infinite_bracket_expression_program) - 1) != 0,
"expected LinuxCNC to reject infinite bracket expression values before comparison");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Calculation resulted in 'infinity'",
"expected LinuxCNC infinite-bracket-expression error text");
const char spaced_function_bracket_program[] =
"G21 G90\n"
@@ -9714,6 +10045,56 @@ int main() {
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Unknown m code used: M98",
"expected smoke comment-prefixed M98 error text");
const char oword_if_missing_bracket_program[] =
"O100 if\n"
"G1 X1\n"
"O100 endif\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
oword_if_missing_bracket_program,
sizeof(oword_if_missing_bracket_program) - 1) != 0,
"expected LinuxCNC O-word if without a bracketed condition to fail");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Left bracket missing after 'if'",
"expected LinuxCNC missing-O-word-if-left-bracket error text");
const char oword_while_missing_bracket_program[] =
"O100 while\n"
"G1 X1\n"
"O100 endwhile\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
oword_while_missing_bracket_program,
sizeof(oword_while_missing_bracket_program) - 1) != 0,
"expected LinuxCNC O-word while without a bracketed condition to fail");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Left bracket missing after 'while'",
"expected LinuxCNC missing-O-word-while-left-bracket error text");
const char oword_repeat_missing_bracket_program[] =
"O100 repeat\n"
"G1 X1\n"
"O100 endrepeat\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
oword_repeat_missing_bracket_program,
sizeof(oword_repeat_missing_bracket_program) - 1) != 0,
"expected LinuxCNC O-word repeat without a bracketed count to fail");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Left bracket missing after 'repeat'",
"expected LinuxCNC missing-O-word-repeat-left-bracket error text");
const char oword_elseif_missing_bracket_program[] =
"O100 if [0]\n"
"G1 X1\n"
"O100 elseif\n"
"G1 X2\n"
"O100 endif\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
oword_elseif_missing_bracket_program,
sizeof(oword_elseif_missing_bracket_program) - 1) != 0,
"expected LinuxCNC O-word elseif without a bracketed condition to fail");
ok &= expect(std::string(cnc_sim_last_error(sim)) == "Left bracket missing after 'elseif'",
"expected LinuxCNC missing-O-word-elseif-left-bracket error text");
const char oword_if_extra_gcode_program[] =
"O100 if [1] G1 X1\n"
"O100 endif\n"

File diff suppressed because it is too large Load Diff

View File

@@ -63,5 +63,13 @@ int main() {
const CncSimPose roundtrip = rtcp_tool_tip_from_pivot(pivot, 123.4);
ok &= expect_pose_near(roundtrip, tip, "RTCP pivot/tool-tip roundtrip");
tip = {};
tip.a = 90.0;
tip.b = 90.0;
const RtcpVector vector = rtcp_tool_vector_from_pose(tip, 10.0);
ok &= expect_near(vector.x, 0.0, "A90 B90 tool vector x");
ok &= expect_near(vector.y, 10.0, "A90 B90 tool vector y");
ok &= expect_near(vector.z, 0.0, "A90 B90 tool vector z");
return ok ? 0 : 1;
}

44
list-cnc-sim-core-sources.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
filter=${1:-}
awk '
/set\(cnc_sim_core_sources/ {
in_list = 1
next
}
in_list && /^[[:space:]]*\)/ {
exit
}
in_list {
line = $0
sub(/^[[:space:]]*/, "", line)
sub(/[[:space:]]*$/, "", line)
if (line == "") {
next
}
print "core/" line
}
' core/CMakeLists.txt | while IFS= read -r source; do
if [[ ! -f "$source" ]]; then
echo "missing cnc sim core source: $source" >&2
exit 1
fi
if [[ -n "$filter" && "$(basename "$source")" != "$filter" ]]; then
continue
fi
printf '%s\n' "$source"
done | {
found=0
while IFS= read -r source; do
found=1
printf '%s\n' "$source"
done
if [[ -n "$filter" && "$found" -eq 0 ]]; then
echo "missing cnc sim core source in CMake list: $filter" >&2
exit 1
fi
}

View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
filter=${1:-}
sources=(
core/src/canon_event_sink.cpp
core/src/linuxcnc_canon_bridge.cpp
core/src/rtcp_kinematics.cpp
)
found=0
for source in "${sources[@]}"; do
if [[ ! -f "$source" ]]; then
echo "missing LinuxCNC bridge smoke project source: $source" >&2
exit 1
fi
if [[ -n "$filter" && "$(basename "$source")" != "$filter" ]]; then
continue
fi
found=1
printf '%s\n' "$source"
done
if [[ -n "$filter" && "$found" -eq 0 ]]; then
echo "missing LinuxCNC bridge smoke project source in list: $filter" >&2
exit 1
fi

View File

@@ -0,0 +1,53 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
filter=${1:-}
awk '
/set\(cnc_sim_core_sources/ {
in_core = 1
next
}
in_core && /^[[:space:]]*\)/ {
in_core = 0
next
}
/list\(APPEND cnc_sim_core_sources/ {
in_backend_sources = 1
next
}
in_backend_sources && /^[[:space:]]*\)/ {
in_backend_sources = 0
next
}
in_core || in_backend_sources {
line = $0
sub(/^[[:space:]]*/, "", line)
sub(/[[:space:]]*$/, "", line)
if (line == "") {
next
}
print "core/" line
}
' core/CMakeLists.txt | while IFS= read -r source; do
if [[ ! -f "$source" ]]; then
echo "missing LinuxCNC rs274 API project source: $source" >&2
exit 1
fi
if [[ -n "$filter" && "$(basename "$source")" != "$filter" ]]; then
continue
fi
printf '%s\n' "$source"
done | {
found=0
while IFS= read -r source; do
found=1
printf '%s\n' "$source"
done
if [[ -n "$filter" && "$found" -eq 0 ]]; then
echo "missing LinuxCNC rs274 API project source in CMake list: $filter" >&2
exit 1
fi
}

View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
filter=${1:-}
sources=(
core/src/canon_event_sink.cpp
core/src/linuxcnc_canon_bridge.cpp
core/src/linuxcnc_tooldata_fixture.cpp
core/src/rtcp_kinematics.cpp
core/src/simulator_gcode_controls.cpp
core/tools/linuxcnc_rs274_dump.cpp
)
found=0
for source in "${sources[@]}"; do
if [[ ! -f "$source" ]]; then
echo "missing LinuxCNC rs274 dump project source: $source" >&2
exit 1
fi
if [[ -n "$filter" && "$(basename "$source")" != "$filter" ]]; then
continue
fi
found=1
printf '%s\n' "$source"
done
if [[ -n "$filter" && "$found" -eq 0 ]]; then
echo "missing LinuxCNC rs274 dump project source in list: $filter" >&2
exit 1
fi

25
list-linuxcnc-source-files.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
if [[ ! -d "$linuxcnc_root" ]]; then
echo "missing LinuxCNC root: $linuxcnc_root" >&2
exit 1
fi
if [[ "$#" -eq 0 ]]; then
echo "usage: $0 <linuxcnc-relative-source>..." >&2
exit 1
fi
for source in "$@"; do
full_source="$linuxcnc_root/$source"
if [[ ! -f "$full_source" ]]; then
echo "missing LinuxCNC source: $source" >&2
exit 1
fi
printf '%s\n' "$full_source"
done

View File

@@ -0,0 +1,72 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
manifest=${1:-linuxcnc-rs274-source-files.txt}
filter_group=${2:-core}
output_mode=${3:-relative}
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
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
case "$filter_group" in
core|binding|tooldata|all)
;;
*)
echo "unknown manifest source filter: $filter_group" >&2
exit 1
;;
esac
case "$output_mode" in
relative|full)
;;
*)
echo "unknown manifest source output mode: $output_mode" >&2
exit 1
;;
esac
seen_sources=()
while IFS=: read -r group path note; do
case "$group" in
""|\#*)
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
if [[ "$group" == "core" ]]; then
if printf '%s\n' "${seen_sources[@]}" | grep -Fx -- "$path" >/dev/null; then
echo "duplicate manifest source: $path" >&2
exit 1
fi
seen_sources+=("$path")
fi
if [[ "$filter_group" == "all" || "$filter_group" == "$group" ]]; then
if [[ "$output_mode" == "full" ]]; then
printf '%s\n' "$linuxcnc_root/$path"
else
printf '%s\n' "$path"
fi
fi
done < "$manifest"

View File

@@ -0,0 +1,45 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
filter=${1:-}
if [[ ! -d "$linuxcnc_root" ]]; then
echo "missing LinuxCNC root: $linuxcnc_root" >&2
exit 1
fi
objects=(
src/objects/emc/rs274ngc/interpmodule.o
src/objects/emc/rs274ngc/canonmodule.o
src/objects/emc/rs274ngc/pyarrays.o
src/objects/emc/rs274ngc/pyblock.o
src/objects/emc/rs274ngc/pyemctypes.o
src/objects/emc/rs274ngc/pyinterp1.o
src/objects/emc/rs274ngc/pyparamclass.o
src/objects/emc/nml_intf/emcops.o
src/objects/emc/sai/dummyemcstat.o
src/objects/libnml/nml/stat_msg.o
)
found=0
for object in "${objects[@]}"; do
full_object="$linuxcnc_root/$object"
if [[ ! -f "$full_object" ]]; then
echo "missing LinuxCNC support object: $full_object" >&2
echo "build LinuxCNC first or set LINUXCNC_ROOT to a built tree" >&2
exit 1
fi
if [[ -n "$filter" && "$(basename "$object")" != "$filter" ]]; then
continue
fi
found=1
printf '%s\n' "$full_object"
done
if [[ -n "$filter" && "$found" -eq 0 ]]; then
echo "missing LinuxCNC support object in list: $filter" >&2
exit 1
fi

View File

@@ -0,0 +1,70 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
manifest=${1:-linuxcnc-rs274-wasm-source-files.txt}
filter_group=${2:-core}
output_mode=${3:-relative}
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
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
case "$filter_group" in
core|blocked|all)
;;
*)
echo "unknown manifest source filter: $filter_group" >&2
exit 1
;;
esac
case "$output_mode" in
relative|full)
;;
*)
echo "unknown manifest source output mode: $output_mode" >&2
exit 1
;;
esac
seen_sources=()
while IFS=: read -r group path note; do
case "$group" in
""|\#*)
continue
;;
core|blocked)
;;
*)
echo "unknown manifest group: $group" >&2
exit 1
;;
esac
if [[ ! -f "$linuxcnc_root/$path" ]]; then
echo "missing manifest source: $path" >&2
exit 1
fi
if printf '%s\n' "${seen_sources[@]}" | grep -Fx -- "$path" >/dev/null; then
echo "duplicate manifest source: $path" >&2
exit 1
fi
seen_sources+=("$path")
if [[ "$filter_group" == "all" || "$filter_group" == "$group" ]]; then
if [[ "$output_mode" == "full" ]]; then
printf '%s\n' "$linuxcnc_root/$path"
else
printf '%s\n' "$path"
fi
fi
done < "$manifest"

View File

@@ -0,0 +1,45 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
filter=${1:-}
awk '
/set\(linuxcnc_rs274_wasm_safe_probe_project_sources/ {
in_list = 1
next
}
in_list && /^[[:space:]]*\)/ {
exit
}
in_list {
line = $0
sub(/^[[:space:]]*/, "", line)
sub(/[[:space:]]*$/, "", line)
if (line == "") {
next
}
sub(/^\$\{CMAKE_CURRENT_SOURCE_DIR\}\//, "core/", line)
print line
}
' core/CMakeLists.txt | while IFS= read -r source; do
if [[ ! -f "$source" ]]; then
echo "missing wasm-safe project source: $source" >&2
exit 1
fi
if [[ -n "$filter" && "$(basename "$source")" != "$filter" ]]; then
continue
fi
printf '%s\n' "$source"
done | {
found=0
while IFS= read -r source; do
found=1
printf '%s\n' "$source"
done
if [[ -n "$filter" && "$found" -eq 0 ]]; then
echo "missing wasm-safe project source in CMake list: $filter" >&2
exit 1
fi
}

View File

@@ -0,0 +1,45 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
filter=${1:-}
awk '
/set\(linuxcnc_wasm_safe_probe_shims/ {
in_list = 1
next
}
in_list && /^[[:space:]]*\)/ {
exit
}
in_list {
line = $0
sub(/^[[:space:]]*/, "", line)
sub(/[[:space:]]*$/, "", line)
if (line == "") {
next
}
sub(/^\$\{CMAKE_CURRENT_SOURCE_DIR\}\//, "core/", line)
print line
}
' core/CMakeLists.txt | while IFS= read -r source; do
if [[ ! -f "$source" ]]; then
echo "missing wasm-safe shim source: $source" >&2
exit 1
fi
if [[ -n "$filter" && "$(basename "$source")" != "$filter" ]]; then
continue
fi
printf '%s\n' "$source"
done | {
found=0
while IFS= read -r source; do
found=1
printf '%s\n' "$source"
done
if [[ -n "$filter" && "$found" -eq 0 ]]; then
echo "missing wasm-safe shim in CMake list: $filter" >&2
exit 1
fi
}

View File

@@ -3,13 +3,41 @@ set -euo pipefail
cd "$(dirname "$0")"
manifest=${1:-linuxcnc-rs274-source-files.txt}
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
missing_root=/tmp/does-not-exist-linuxcnc
missing_root_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_native_missing_root.XXXXXX.log")
grep -F 'exec 9>"${TMPDIR:-/tmp}/cnc_sim_rs274_source_link.lock"' test-linuxcnc-source-link.sh >/dev/null
grep -F "flock 9" test-linuxcnc-source-link.sh >/dev/null
grep -F "missing LinuxCNC support object:" list-linuxcnc-source-support-objects.sh >/dev/null
grep -F "build LinuxCNC first or set LINUXCNC_ROOT to a built tree" list-linuxcnc-source-support-objects.sh >/dev/null
grep -F 'exec 9>"${TMPDIR:-/tmp}/cnc_sim_linuxcnc_rs274_native.lock"' test-linuxcnc-rs274-native.sh >/dev/null
grep -F "flock 9" test-linuxcnc-rs274-native.sh >/dev/null
grep -F "CNC_SIM_ENABLE_LINUXCNC_RS274_BACKEND is native-only; it links LinuxCNC librs274" core/CMakeLists.txt >/dev/null
grep -F "Set CNC_SIM_LINUXCNC_ROOT to the LinuxCNC source root" core/CMakeLists.txt >/dev/null
grep -F "find_package(Python3 REQUIRED COMPONENTS Development)" core/CMakeLists.txt >/dev/null
grep -F "target_compile_definitions(cnc_sim_objects" core/CMakeLists.txt >/dev/null
grep -F "CNC_SIM_ENABLE_LINUXCNC_RS274_BACKEND" core/CMakeLists.txt >/dev/null
grep -F 'target_link_directories(cnc_sim_core' core/CMakeLists.txt >/dev/null
grep -F "add_executable(cnc_sim_api_linuxcnc_rs274_smoke" core/CMakeLists.txt >/dev/null
grep -F "target_link_libraries(cnc_sim_core" core/CMakeLists.txt >/dev/null
grep -F "rs274" core/CMakeLists.txt >/dev/null
grep -F "tooldata" core/CMakeLists.txt >/dev/null
grep -F "Python3::Python" core/CMakeLists.txt >/dev/null
grep -F '"-Wl,-rpath,${CNC_SIM_LINUXCNC_ROOT}/lib"' core/CMakeLists.txt >/dev/null
grep -F "add_library(cnc_sim_linuxcnc_canon_bridge STATIC" core/CMakeLists.txt >/dev/null
grep -F "target_link_libraries(cnc_sim_linuxcnc_canon_bridge PRIVATE cnc_sim_core tooldata)" core/CMakeLists.txt >/dev/null
grep -F './list-linuxcnc-rs274-dump-project-sources.sh > "$project_source_list"' test-linuxcnc-source-link.sh >/dev/null
grep -F './list-linuxcnc-rs274-dump-project-sources.sh > "$project_source_list"' test-linuxcnc-rs274-native.sh >/dev/null
grep -F './list-linuxcnc-rs274-api-project-sources.sh > "$project_source_list"' test-linuxcnc-api-native.sh >/dev/null
grep -F './list-cnc-sim-core-sources.sh > "$core_source_list"' test-native.sh >/dev/null
grep -F './list-linuxcnc-bridge-smoke-project-sources.sh > "$project_source_list"' test-linuxcnc-bridge-native.sh >/dev/null
grep -F 'LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-support-objects.sh > "$support_object_list"' test-linuxcnc-source-link.sh >/dev/null
for script in \
test-linuxcnc-source-syntax.sh \
test-linuxcnc-source-objects.sh \
test-linuxcnc-source-link.sh \
test-linuxcnc-bridge-native.sh \
test-linuxcnc-rs274-native.sh \
test-linuxcnc-api-native.sh; do
@@ -25,10 +53,31 @@ for script in \
done
rm -f "$missing_root_log"
missing_manifest=${TMPDIR:-/tmp}/cnc_sim_missing_native_manifest.txt
missing_manifest_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_native_manifest.XXXXXX.log")
rm -f "$missing_manifest"
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" "$missing_manifest" >"$missing_manifest_log" 2>&1; then
echo "$script accepted missing manifest: $missing_manifest" >&2
exit 1
fi
if ! grep -F "missing manifest: $missing_manifest" "$missing_manifest_log" >/dev/null; then
echo "$script did not report missing manifest clearly" >&2
sed -n '1,20p' "$missing_manifest_log" >&2
exit 1
fi
done
rm -f "$missing_manifest_log"
unknown_group_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_native_unknown_manifest_group.XXXXXX.txt")
unknown_group_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_native_unknown_manifest_group.XXXXXX.log")
printf 'bogus:src/emc/rs274ngc/interp_arc.cc:test unknown group\n' >"$unknown_group_manifest"
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
@@ -44,6 +93,142 @@ for script in \
done
rm -f "$unknown_group_manifest" "$unknown_group_log"
duplicate_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_native_duplicate_manifest.XXXXXX.txt")
duplicate_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_native_duplicate_manifest.XXXXXX.log")
printf 'core:src/emc/rs274ngc/interp_arc.cc:test duplicate source\ncore:src/emc/rs274ngc/interp_arc.cc:test duplicate source\n' >"$duplicate_manifest"
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" "$duplicate_manifest" >"$duplicate_log" 2>&1; then
echo "$script accepted duplicate manifest source" >&2
exit 1
fi
if ! grep -F "duplicate manifest source: src/emc/rs274ngc/interp_arc.cc" "$duplicate_log" >/dev/null; then
echo "$script did not report duplicate manifest source clearly" >&2
sed -n '1,20p' "$duplicate_log" >&2
exit 1
fi
done
rm -f "$duplicate_manifest" "$duplicate_log"
./list-linuxcnc-source-manifest-sources.sh "$manifest" core >/dev/null
grep -Fx "src/emc/rs274ngc/interp_arc.cc" \
< <(./list-linuxcnc-source-manifest-sources.sh "$manifest" core) >/dev/null
grep -Fx "src/emc/rs274ngc/interpmodule.cc" \
< <(./list-linuxcnc-source-manifest-sources.sh "$manifest" binding) >/dev/null
grep -Fx "src/emc/tooldata/tooldata_common.cc" \
< <(./list-linuxcnc-source-manifest-sources.sh "$manifest" tooldata) >/dev/null
unknown_filter_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_native_unknown_manifest_filter.XXXXXX.log")
if ./list-linuxcnc-source-manifest-sources.sh "$manifest" bogus >"$unknown_filter_log" 2>&1; then
echo "native manifest source lister accepted unknown filter" >&2
exit 1
fi
if ! grep -F "unknown manifest source filter: bogus" "$unknown_filter_log" >/dev/null; then
echo "native manifest source lister did not report unknown filter clearly" >&2
sed -n '1,20p' "$unknown_filter_log" >&2
exit 1
fi
rm -f "$unknown_filter_log"
unknown_output_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_native_unknown_manifest_output.XXXXXX.log")
if ./list-linuxcnc-source-manifest-sources.sh "$manifest" core bogus >"$unknown_output_log" 2>&1; then
echo "native manifest source lister accepted unknown output mode" >&2
exit 1
fi
if ! grep -F "unknown manifest source output mode: bogus" "$unknown_output_log" >/dev/null; then
echo "native manifest source lister did not report unknown output mode clearly" >&2
sed -n '1,20p' "$unknown_output_log" >&2
exit 1
fi
rm -f "$unknown_output_log"
grep -Fx "$linuxcnc_root/src/emc/rs274ngc/interp_arc.cc" \
< <(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-manifest-sources.sh "$manifest" core full) >/dev/null
./list-linuxcnc-rs274-dump-project-sources.sh >/dev/null
grep -Fx "core/tools/linuxcnc_rs274_dump.cpp" \
< <(./list-linuxcnc-rs274-dump-project-sources.sh linuxcnc_rs274_dump.cpp) >/dev/null
missing_dump_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_rs274_dump_project_source.XXXXXX.log")
if ./list-linuxcnc-rs274-dump-project-sources.sh does_not_exist.cc >"$missing_dump_source_log" 2>&1; then
echo "rs274 dump project source lister accepted missing source filter" >&2
exit 1
fi
if ! grep -F "missing LinuxCNC rs274 dump project source in list: does_not_exist.cc" "$missing_dump_source_log" >/dev/null; then
echo "rs274 dump project source lister did not report missing source filter clearly" >&2
sed -n '1,20p' "$missing_dump_source_log" >&2
exit 1
fi
rm -f "$missing_dump_source_log"
./list-linuxcnc-rs274-api-project-sources.sh >/dev/null
grep -Fx "core/src/linuxcnc_rs274_backend.cpp" \
< <(./list-linuxcnc-rs274-api-project-sources.sh linuxcnc_rs274_backend.cpp) >/dev/null
missing_api_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_rs274_api_project_source.XXXXXX.log")
if ./list-linuxcnc-rs274-api-project-sources.sh does_not_exist.cc >"$missing_api_source_log" 2>&1; then
echo "rs274 API project source lister accepted missing source filter" >&2
exit 1
fi
if ! grep -F "missing LinuxCNC rs274 API project source in CMake list: does_not_exist.cc" "$missing_api_source_log" >/dev/null; then
echo "rs274 API project source lister did not report missing source filter clearly" >&2
sed -n '1,20p' "$missing_api_source_log" >&2
exit 1
fi
rm -f "$missing_api_source_log"
./list-cnc-sim-core-sources.sh >/dev/null
grep -Fx "core/src/smoke_gcode_parser.cpp" \
< <(./list-cnc-sim-core-sources.sh smoke_gcode_parser.cpp) >/dev/null
missing_core_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_core_source.XXXXXX.log")
if ./list-cnc-sim-core-sources.sh does_not_exist.cc >"$missing_core_source_log" 2>&1; then
echo "cnc sim core source lister accepted missing source filter" >&2
exit 1
fi
if ! grep -F "missing cnc sim core source in CMake list: does_not_exist.cc" "$missing_core_source_log" >/dev/null; then
echo "cnc sim core source lister did not report missing source filter clearly" >&2
sed -n '1,20p' "$missing_core_source_log" >&2
exit 1
fi
rm -f "$missing_core_source_log"
./list-linuxcnc-bridge-smoke-project-sources.sh >/dev/null
grep -Fx "core/src/linuxcnc_canon_bridge.cpp" \
< <(./list-linuxcnc-bridge-smoke-project-sources.sh linuxcnc_canon_bridge.cpp) >/dev/null
missing_bridge_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_bridge_smoke_project_source.XXXXXX.log")
if ./list-linuxcnc-bridge-smoke-project-sources.sh does_not_exist.cc >"$missing_bridge_source_log" 2>&1; then
echo "LinuxCNC bridge smoke project source lister accepted missing source filter" >&2
exit 1
fi
if ! grep -F "missing LinuxCNC bridge smoke project source in list: does_not_exist.cc" "$missing_bridge_source_log" >/dev/null; then
echo "LinuxCNC bridge smoke project source lister did not report missing source filter clearly" >&2
sed -n '1,20p' "$missing_bridge_source_log" >&2
exit 1
fi
rm -f "$missing_bridge_source_log"
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-support-objects.sh >/dev/null
grep -F "/src/objects/emc/rs274ngc/interpmodule.o" \
< <(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-support-objects.sh interpmodule.o) >/dev/null
missing_support_object_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_linuxcnc_support_object.XXXXXX.log")
if LINUXCNC_ROOT="$missing_root" ./list-linuxcnc-source-support-objects.sh >"$missing_support_object_log" 2>&1; then
echo "LinuxCNC support object lister accepted missing LinuxCNC root: $missing_root" >&2
exit 1
fi
if ! grep -F "missing LinuxCNC root: $missing_root" "$missing_support_object_log" >/dev/null; then
echo "LinuxCNC support object lister did not report missing LinuxCNC root clearly" >&2
sed -n '1,20p' "$missing_support_object_log" >&2
exit 1
fi
if LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-support-objects.sh does_not_exist.o >"$missing_support_object_log" 2>&1; then
echo "LinuxCNC support object lister accepted missing object filter" >&2
exit 1
fi
if ! grep -F "missing LinuxCNC support object in list: does_not_exist.o" "$missing_support_object_log" >/dev/null; then
echo "LinuxCNC support object lister did not report missing object filter clearly" >&2
sed -n '1,20p' "$missing_support_object_log" >&2
exit 1
fi
rm -f "$missing_support_object_log"
missing_source_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_native_syntax_missing_source_manifest.XXXXXX.txt")
missing_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_native_syntax_missing_source.XXXXXX.log")
printf 'core:src/emc/rs274ngc/does_not_exist.cc:test missing source\n' >"$missing_source_manifest"
@@ -59,9 +244,9 @@ fi
rm -f "$missing_source_manifest" "$missing_source_log"
./test-native.sh
./test-linuxcnc-source-syntax.sh
./test-linuxcnc-source-objects.sh
./test-linuxcnc-source-link.sh
./test-linuxcnc-source-syntax.sh "$manifest"
./test-linuxcnc-source-objects.sh "$manifest"
./test-linuxcnc-source-link.sh "$manifest"
./test-linuxcnc-bridge-native.sh
./test-linuxcnc-rs274-native.sh
./test-linuxcnc-api-native.sh

View File

@@ -16,6 +16,10 @@ trap 'rm -rf "$build_dir"' EXIT
var_file="$build_dir/rs274ngc-api.var"
cp "$linuxcnc_root/tests/halui/jogging/sim.var" "$var_file"
project_source_list="$build_dir/linuxcnc_rs274_api_project_sources.txt"
./list-linuxcnc-rs274-api-project-sources.sh > "$project_source_list"
mapfile -t project_sources < "$project_source_list"
"$cxx" -std=c++17 \
-DCNC_SIM_ENABLE_LINUXCNC_RS274_BACKEND \
$(python3.13-config --includes 2>/dev/null || python3-config --includes) \
@@ -27,15 +31,7 @@ cp "$linuxcnc_root/tests/halui/jogging/sim.var" "$var_file"
-I "$linuxcnc_root/src/emc/rs274ngc" \
-I "$linuxcnc_root/src/emc/motion" \
-I "$linuxcnc_root/include" \
core/src/canon_event_sink.cpp \
core/src/cnc_sim_api.cpp \
core/src/gcode_backend.cpp \
core/src/linuxcnc_canon_bridge.cpp \
core/src/linuxcnc_rs274_backend.cpp \
core/src/linuxcnc_tooldata_fixture.cpp \
core/src/rtcp_kinematics.cpp \
core/src/simulator_gcode_controls.cpp \
core/src/smoke_gcode_parser.cpp \
"${project_sources[@]}" \
core/tests/cnc_sim_api_linuxcnc_rs274_smoke.cpp \
-L "$linuxcnc_root/lib" \
-Wl,-rpath,"$linuxcnc_root/lib" \

View File

@@ -13,6 +13,9 @@ if [[ ! -d "$linuxcnc_root" ]]; then
fi
trap 'rm -rf "$build_dir"' EXIT
project_source_list="$build_dir/linuxcnc_bridge_smoke_project_sources.txt"
./list-linuxcnc-bridge-smoke-project-sources.sh > "$project_source_list"
mapfile -t project_sources < "$project_source_list"
"$cxx" -std=c++17 \
-I core/include \
@@ -23,9 +26,7 @@ trap 'rm -rf "$build_dir"' EXIT
-I "$linuxcnc_root/src/emc/motion" \
-I "$linuxcnc_root/src" \
-I "$linuxcnc_root/include" \
core/src/canon_event_sink.cpp \
core/src/linuxcnc_canon_bridge.cpp \
core/src/rtcp_kinematics.cpp \
"${project_sources[@]}" \
core/tests/linuxcnc_canon_bridge_smoke.cpp \
-L "$linuxcnc_root/lib" \
-Wl,-rpath,"$linuxcnc_root/lib" \

View File

@@ -25,6 +25,10 @@ mkdir -p "$output_dir"
cp "$linuxcnc_root/tests/halui/jogging/sim.var" "$base_var_file"
cp "$base_var_file" "$var_file"
project_source_list="$build_dir/linuxcnc_rs274_dump_project_sources.txt"
./list-linuxcnc-rs274-dump-project-sources.sh > "$project_source_list"
mapfile -t project_sources < "$project_source_list"
"$cxx" -std=c++17 \
$(python3.13-config --includes 2>/dev/null || python3-config --includes) \
-I core/include \
@@ -35,12 +39,7 @@ cp "$base_var_file" "$var_file"
-I "$linuxcnc_root/src/emc/rs274ngc" \
-I "$linuxcnc_root/src/emc/motion" \
-I "$linuxcnc_root/include" \
core/src/canon_event_sink.cpp \
core/src/linuxcnc_canon_bridge.cpp \
core/src/linuxcnc_tooldata_fixture.cpp \
core/src/rtcp_kinematics.cpp \
core/src/simulator_gcode_controls.cpp \
core/tools/linuxcnc_rs274_dump.cpp \
"${project_sources[@]}" \
-L "$linuxcnc_root/lib" \
-Wl,-rpath,"$linuxcnc_root/lib" \
-lrs274 \

View File

@@ -40,67 +40,37 @@ common_flags=(
)
linuxcnc_sources=()
while IFS=: read -r group path note; do
case "$group" in
core)
if [[ ! -f "$linuxcnc_root/$path" ]]; then
echo "missing manifest file: $path" >&2
exit 1
fi
linuxcnc_sources+=("$path")
;;
""|\#*|binding|tooldata)
;;
*)
echo "unknown manifest group: $group" >&2
exit 1
;;
esac
done < "$manifest"
source_list="$build_dir/linuxcnc_core_sources.txt"
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-manifest-sources.sh "$manifest" core full > "$source_list"
mapfile -t linuxcnc_sources < "$source_list"
objects=()
linuxcnc_index=0
for source in "${linuxcnc_sources[@]}"; do
obj="$build_dir/linuxcnc_${linuxcnc_index}.o"
"$cxx" "${common_flags[@]}" -c "$linuxcnc_root/$source" -o "$obj"
"$cxx" "${common_flags[@]}" -c "$source" -o "$obj"
objects+=("$obj")
linuxcnc_index=$((linuxcnc_index + 1))
done
project_index=0
for source in \
core/src/canon_event_sink.cpp \
core/src/linuxcnc_canon_bridge.cpp \
core/src/linuxcnc_tooldata_fixture.cpp \
core/src/rtcp_kinematics.cpp \
core/src/simulator_gcode_controls.cpp \
core/tools/linuxcnc_rs274_dump.cpp; do
project_source_list="$build_dir/linuxcnc_rs274_dump_project_sources.txt"
./list-linuxcnc-rs274-dump-project-sources.sh > "$project_source_list"
mapfile -t project_sources < "$project_source_list"
for source in "${project_sources[@]}"; do
obj="$build_dir/project_${project_index}.o"
"$cxx" "${common_flags[@]}" -c "$source" -o "$obj"
objects+=("$obj")
project_index=$((project_index + 1))
done
support_objects=(
"$linuxcnc_root/src/objects/emc/rs274ngc/interpmodule.o"
"$linuxcnc_root/src/objects/emc/rs274ngc/canonmodule.o"
"$linuxcnc_root/src/objects/emc/rs274ngc/pyarrays.o"
"$linuxcnc_root/src/objects/emc/rs274ngc/pyblock.o"
"$linuxcnc_root/src/objects/emc/rs274ngc/pyemctypes.o"
"$linuxcnc_root/src/objects/emc/rs274ngc/pyinterp1.o"
"$linuxcnc_root/src/objects/emc/rs274ngc/pyparamclass.o"
"$linuxcnc_root/src/objects/emc/nml_intf/emcops.o"
"$linuxcnc_root/src/objects/emc/sai/dummyemcstat.o"
"$linuxcnc_root/src/objects/libnml/nml/stat_msg.o"
)
"$cxx" -std=c++17 -I core/include -I core/src \
core/tests/linuxcnc_gees_table_smoke.cpp \
-o "$build_dir/linuxcnc_gees_table_smoke"
for obj in "${support_objects[@]}"; do
if [[ ! -f "$obj" ]]; then
echo "missing LinuxCNC support object: $obj" >&2
echo "build LinuxCNC first or set LINUXCNC_ROOT to a built tree" >&2
exit 1
fi
done
support_object_list="$build_dir/linuxcnc_support_objects.txt"
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-support-objects.sh > "$support_object_list"
mapfile -t support_objects < "$support_object_list"
"$cxx" "${objects[@]}" "${support_objects[@]}" \
-L "$linuxcnc_root/lib" \
@@ -126,6 +96,8 @@ mkdir -p "$output_dir"
cp "$linuxcnc_root/tests/halui/jogging/sim.var" "$base_var_file"
cp "$base_var_file" "$var_file"
LINUXCNC_ROOT="$linuxcnc_root" "$build_dir/linuxcnc_gees_table_smoke"
CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/basic_mill.ngc \
>"$output_dir/cnc_sim_linuxcnc_source_basic_mill.json"
@@ -543,6 +515,38 @@ if CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
echo "expected linuxcnc_canned_cycle_reject_rotary_followup.ngc to fail" >&2
exit 1
fi
if CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_cutter_comp_tool_change_error.ngc \
>"$output_dir/cnc_sim_linuxcnc_source_cutter_comp_tool_change_error.json" 2>"$output_dir/cnc_sim_linuxcnc_source_cutter_comp_tool_change_error.err"; then
echo "expected linuxcnc_cutter_comp_tool_change_error.ngc to fail" >&2
exit 1
fi
grep -q "Cannot change tools with cutter radius compensation on" \
"$output_dir/cnc_sim_linuxcnc_source_cutter_comp_tool_change_error.err"
if CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_cutter_comp_wait_input_error.ngc \
>"$output_dir/cnc_sim_linuxcnc_source_cutter_comp_wait_input_error.json" 2>"$output_dir/cnc_sim_linuxcnc_source_cutter_comp_wait_input_error.err"; then
echo "expected linuxcnc_cutter_comp_wait_input_error.ngc to fail" >&2
exit 1
fi
grep -q "Cannot wait for digital input with cutter radius compensation on" \
"$output_dir/cnc_sim_linuxcnc_source_cutter_comp_wait_input_error.err"
if CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_cutter_comp_g71_error.ngc \
>"$output_dir/cnc_sim_linuxcnc_source_cutter_comp_g71_error.json" 2>"$output_dir/cnc_sim_linuxcnc_source_cutter_comp_g71_error.err"; then
echo "expected linuxcnc_cutter_comp_g71_error.ngc to fail" >&2
exit 1
fi
grep -q "G71.0 cannot be used with cutter compensation enabled" \
"$output_dir/cnc_sim_linuxcnc_source_cutter_comp_g71_error.err"
if CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_canned_cycle_g98_retract_error.ngc \
>"$output_dir/cnc_sim_linuxcnc_source_canned_cycle_g98_retract_error.json" 2>"$output_dir/cnc_sim_linuxcnc_source_canned_cycle_g98_retract_error.err"; then
echo "expected linuxcnc_canned_cycle_g98_retract_error.ngc to fail" >&2
exit 1
fi
grep -q "Cannot change retract mode with cutter radius compensation on" \
"$output_dir/cnc_sim_linuxcnc_source_canned_cycle_g98_retract_error.err"
if CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_nested_subroutine_definition_error.ngc \
>"$output_dir/cnc_sim_linuxcnc_source_nested_subroutine_definition_error.json" 2>"$output_dir/cnc_sim_linuxcnc_source_nested_subroutine_definition_error.err"; then
@@ -555,6 +559,8 @@ if CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
echo "expected linuxcnc_ccomp_arcexit_error.ngc to fail" >&2
exit 1
fi
grep -q "The move just after exiting cutter compensation mode must be straight, not an arc" \
"$output_dir/cnc_sim_linuxcnc_source_ccomp_arcexit_error.err"
if CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_abort_hot_comment.ngc \
>"$output_dir/cnc_sim_linuxcnc_source_abort_hot_comment.json" 2>"$output_dir/cnc_sim_linuxcnc_source_abort_hot_comment.err"; then
@@ -567,6 +573,8 @@ if CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
echo "expected linuxcnc_ccomp_gouging_error.ngc to fail" >&2
exit 1
fi
grep -q "Straight feed in concave corner cannot be reached by the tool without gouging" \
"$output_dir/cnc_sim_linuxcnc_source_ccomp_gouging_error.err"
cp "$base_var_file" "$var_file"
CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_numbered_parameters.ngc \

View File

@@ -34,29 +34,15 @@ common_flags=(
)
sources=()
while IFS=: read -r group path note; do
case "$group" in
core)
if [[ ! -f "$linuxcnc_root/$path" ]]; then
echo "missing manifest file: $path" >&2
exit 1
fi
sources+=("$path")
;;
""|\#*|binding|tooldata)
;;
*)
echo "unknown manifest group: $group" >&2
exit 1
;;
esac
done < "$manifest"
source_list="$build_dir/linuxcnc_core_sources.txt"
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-manifest-sources.sh "$manifest" core full > "$source_list"
mapfile -t sources < "$source_list"
source_index=0
for source in "${sources[@]}"; do
obj="$build_dir/linuxcnc_${source_index}.o"
# shellcheck disable=SC2086
"$cxx" "${common_flags[@]}" $python_includes -c "$linuxcnc_root/$source" -o "$obj"
"$cxx" "${common_flags[@]}" $python_includes -c "$source" -o "$obj"
source_index=$((source_index + 1))
done

View File

@@ -18,23 +18,9 @@ if [[ ! -d "$linuxcnc_root" ]]; then
exit 1
fi
while IFS=: read -r group path note; do
case "$group" in
""|\#*)
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 < "$manifest"
source_list=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_linuxcnc_source_syntax_sources.XXXXXX.txt")
trap 'rm -f "$source_list"' EXIT
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-manifest-sources.sh "$manifest" all full > "$source_list"
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")
@@ -72,18 +58,10 @@ common_flags=(
-I "$linuxcnc_root/include"
)
probe_sources=(
src/emc/rs274ngc/interp_base.cc
src/emc/rs274ngc/modal_state.cc
src/emc/rs274ngc/interp_arc.cc
src/emc/rs274ngc/interp_find.cc
src/emc/rs274ngc/interp_read.cc
src/emc/rs274ngc/nurbs_additional_functions.cc
)
for source in "${probe_sources[@]}"; do
while IFS= read -r source; do
[[ -z "$source" ]] && continue
# shellcheck disable=SC2086
"$cxx" "${common_flags[@]}" $python_includes "$linuxcnc_root/$source"
done
"$cxx" "${common_flags[@]}" $python_includes "$source"
done < "$source_list"
echo "linuxcnc rs274 source syntax probe passed"

View File

@@ -5,6 +5,20 @@ cd "$(dirname "$0")"
manifest=${1:-linuxcnc-rs274-wasm-source-files.txt}
missing_manifest=${TMPDIR:-/tmp}/cnc_sim_missing_wasm_blocker_manifest.txt
missing_manifest_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_wasm_blocker_manifest.XXXXXX.log")
rm -f "$missing_manifest"
if ./analyze-linuxcnc-wasm-blockers.sh "$missing_manifest" >"$missing_manifest_log" 2>&1; then
echo "wasm blocker analyzer accepted missing manifest: $missing_manifest" >&2
exit 1
fi
if ! grep -F "missing manifest: $missing_manifest" "$missing_manifest_log" >/dev/null; then
echo "wasm blocker analyzer did not report missing manifest clearly" >&2
sed -n '1,20p' "$missing_manifest_log" >&2
exit 1
fi
rm -f "$missing_manifest_log"
missing_root=/tmp/does-not-exist-linuxcnc
missing_root_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_wasm_blocker_missing_root.XXXXXX.log")
if LINUXCNC_ROOT="$missing_root" ./analyze-linuxcnc-wasm-blockers.sh "$manifest" >"$missing_root_log" 2>&1; then
@@ -34,6 +48,44 @@ if ! grep -F "missing manifest source: src/emc/tooldata/does_not_exist.cc" "$mis
fi
rm -f "$missing_source_manifest" "$missing_source_log"
duplicate_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_duplicate_wasm_blocker_manifest.XXXXXX.txt")
duplicate_manifest_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_duplicate_wasm_blocker_manifest.XXXXXX.log")
cat >"$duplicate_manifest" <<'EOF'
core:src/emc/rs274ngc/interp_arc.cc:duplicate core entry
core:src/emc/rs274ngc/interp_arc.cc:duplicate core entry
blocked:src/emc/tooldata/tooldata_mmap.cc:blocked entry
EOF
if ./analyze-linuxcnc-wasm-blockers.sh "$duplicate_manifest" >"$duplicate_manifest_log" 2>&1; then
echo "wasm blocker analyzer accepted duplicate manifest source" >&2
exit 1
fi
if ! grep -F "duplicate manifest source: src/emc/rs274ngc/interp_arc.cc" "$duplicate_manifest_log" >/dev/null; then
echo "wasm blocker analyzer did not report duplicate manifest source clearly" >&2
sed -n '1,20p' "$duplicate_manifest_log" >&2
exit 1
fi
rm -f "$duplicate_manifest" "$duplicate_manifest_log"
missing_replacement_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_wasm_blocked_replacement.XXXXXX.txt")
missing_replacement_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_wasm_blocked_replacement.XXXXXX.log")
cat >"$missing_replacement_manifest" <<'EOF'
core:src/emc/rs274ngc/interp_arc.cc:core entry
blocked:src/emc/tooldata/tooldata_db.cc:blocked entry without wasm replacement
EOF
if ./analyze-linuxcnc-wasm-blockers.sh "$missing_replacement_manifest" >"$missing_replacement_log" 2>&1; then
echo "wasm blocker analyzer accepted blocked source without replacement mapping" >&2
exit 1
fi
if ! grep -F "missing blocked replacement mapping: src/emc/tooldata/tooldata_db.cc" "$missing_replacement_log" >/dev/null; then
echo "wasm blocker analyzer did not report missing replacement mapping clearly" >&2
sed -n '1,20p' "$missing_replacement_log" >&2
exit 1
fi
rm -f "$missing_replacement_manifest" "$missing_replacement_log"
grep -F "[manifest]" <<<"$output" >/dev/null
grep -F "core=25" <<<"$(sed -n '/^\[manifest\]/,/^$/p' <<<"$output")" >/dev/null
grep -F "blocked=1" <<<"$(sed -n '/^\[manifest\]/,/^$/p' <<<"$output")" >/dev/null
grep -F "[python]" <<<"$output" >/dev/null
grep -F "(none)" <<<"$(sed -n '/^\[python\]/,/^$/p' <<<"$output")" >/dev/null
grep -F "[dlopen]" <<<"$output" >/dev/null
@@ -46,5 +98,19 @@ grep -F "[native-backend]" <<<"$output" >/dev/null
grep -F "src/emc/tooldata/tooldata_mmap.cc" <<<"$(sed -n '/^\[native-backend\]/,/^$/p' <<<"$output")" >/dev/null
grep -F "[native-fs]" <<<"$output" >/dev/null
grep -F "src/emc/tooldata/tooldata_mmap.cc" <<<"$(sed -n '/^\[native-fs\]/,/^$/p' <<<"$output")" >/dev/null
grep -F "[blocked-replacements]" <<<"$output" >/dev/null
grep -F "src/emc/tooldata/tooldata_mmap.cc -> core/wasm_shims/tooldata/tooldata_mmap_backend.cc" \
<<<"$(sed -n '/^\[blocked-replacements\]/,/^$/p' <<<"$output")" >/dev/null
grep -F "[core-python-shimmed]" <<<"$output" >/dev/null
grep -F "src/emc/rs274ngc/interp_python.cc" <<<"$(sed -n '/^\[core-python-shimmed\]/,/^$/p' <<<"$output")" >/dev/null
grep -F "src/emc/rs274ngc/rs274ngc_pre.cc" <<<"$(sed -n '/^\[core-python-shimmed\]/,/^$/p' <<<"$output")" >/dev/null
grep -F "[core-dlopen-shimmed]" <<<"$output" >/dev/null
grep -F "src/emc/rs274ngc/interp_base.cc" <<<"$(sed -n '/^\[core-dlopen-shimmed\]/,/^$/p' <<<"$output")" >/dev/null
grep -F "[core-tooldata-shimmed]" <<<"$output" >/dev/null
grep -F "src/emc/tooldata/tooldata_common.cc" <<<"$(sed -n '/^\[core-tooldata-shimmed\]/,/^$/p' <<<"$output")" >/dev/null
grep -F "[core-tooldata-users-shimmed]" <<<"$output" >/dev/null
grep -F "src/emc/rs274ngc/interp_find.cc" <<<"$(sed -n '/^\[core-tooldata-users-shimmed\]/,/^$/p' <<<"$output")" >/dev/null
grep -F "[core-native-fs-shimmed]" <<<"$output" >/dev/null
grep -F "src/emc/rs274ngc/interp_o_word.cc" <<<"$(sed -n '/^\[core-native-fs-shimmed\]/,/^$/p' <<<"$output")" >/dev/null
echo "linuxcnc wasm blocker scan passed"

View File

@@ -18,6 +18,20 @@ if [[ ! -d "$linuxcnc_root" ]]; then
fi
trap 'rm -rf "$build_dir"' EXIT
missing_manifest=${TMPDIR:-/tmp}/cnc_sim_missing_build_wasm_manifest.txt
missing_manifest_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_build_wasm_manifest.XXXXXX.log")
rm -f "$missing_manifest"
if ./build-wasm.sh "$missing_manifest" >"$missing_manifest_log" 2>&1; then
echo "build-wasm accepted missing manifest: $missing_manifest" >&2
exit 1
fi
if ! grep -F "missing manifest: $missing_manifest" "$missing_manifest_log" >/dev/null; then
echo "build-wasm did not report missing manifest clearly" >&2
sed -n '1,20p' "$missing_manifest_log" >&2
exit 1
fi
rm -f "$missing_manifest_log"
missing_root=/tmp/does-not-exist-linuxcnc
missing_root_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_build_wasm_missing_root.XXXXXX.log")
if LINUXCNC_ROOT="$missing_root" ./build-wasm.sh >"$missing_root_log" 2>&1; then
@@ -31,13 +45,124 @@ if ! grep -F "missing LinuxCNC root: $missing_root" "$missing_root_log" >/dev/nu
fi
grep -F 'exec 9>"${TMPDIR:-/tmp}/cnc_sim_build_wasm.lock"' build-wasm.sh >/dev/null
grep -F "flock 9" build-wasm.sh >/dev/null
grep -F -- './test-linuxcnc-wasm-blockers.sh "$manifest"' build-wasm.sh >/dev/null
grep -F -- './test-linuxcnc-wasm-source-syntax.sh "$manifest"' build-wasm.sh >/dev/null
grep -F -- './test-linuxcnc-wasm-source-objects.sh "$manifest"' build-wasm.sh >/dev/null
grep -F -- './test-linuxcnc-wasm-cmake-safe-probe.sh "$manifest"' build-wasm.sh >/dev/null
grep -F -- './test-linuxcnc-wasm-tooldata-link.sh' build-wasm.sh >/dev/null
grep -F -- './test-linuxcnc-wasm-tooldata-common-link.sh' build-wasm.sh >/dev/null
grep -F -- './test-linuxcnc-wasm-tooldata-mmap-symbols.sh' build-wasm.sh >/dev/null
grep -F -- './test-linuxcnc-wasm-tooldata-runtime-symbols.sh' build-wasm.sh >/dev/null
grep -F -- './test-linuxcnc-wasm-interp-base-link.sh' build-wasm.sh >/dev/null
grep -F -- './test-linuxcnc-wasm-interp-find-link.sh' build-wasm.sh >/dev/null
grep -F -- './test-linuxcnc-wasm-python-plugin-link.sh' build-wasm.sh >/dev/null
grep -F -- './test-linuxcnc-wasm-rs274ngc-pre-object.sh' build-wasm.sh >/dev/null
grep -F -- './test-linuxcnc-wasm-rs274ngc-pre-link-blockers.sh "$manifest"' build-wasm.sh >/dev/null
grep -F -- './test-linuxcnc-wasm-rs274ngc-pre-link.sh "$manifest"' build-wasm.sh >/dev/null
grep -F -- '-DCNC_SIM_LINUXCNC_WASM_SOURCE_MANIFEST="$manifest"' build-wasm.sh >/dev/null
grep -F -- 'if ! command -v emcmake >/dev/null 2>&1; then' build-wasm.sh >/dev/null
grep -F "Emscripten is required. Install/activate emsdk so emcmake and emcc are in PATH." build-wasm.sh >/dev/null
grep -F -- 'emcmake cmake -S core -B build/wasm \' build-wasm.sh >/dev/null
grep -F -- 'default_manifest="$PWD/linuxcnc-rs274-wasm-source-files.txt"' build-wasm.sh >/dev/null
grep -F -- 'LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" core > "$manifest_core_sources"' build-wasm.sh >/dev/null
grep -F -- 'LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" blocked > "$manifest_blocked_sources"' build-wasm.sh >/dev/null
grep -F -- 'if [[ "$manifest" == "$default_manifest" ]] && [[ "$manifest_core_count" -ne 25 || "$manifest_blocked_count" -ne 1 ]]; then' build-wasm.sh >/dev/null
./list-linuxcnc-wasm-safe-shims.sh >/dev/null
./list-linuxcnc-wasm-safe-project-sources.sh >/dev/null
./list-linuxcnc-wasm-manifest-sources.sh "$manifest" core >/dev/null
grep -Fx "src/emc/rs274ngc/interp_arc.cc" \
< <(./list-linuxcnc-wasm-manifest-sources.sh "$manifest" core) >/dev/null
grep -Fx "src/emc/tooldata/tooldata_mmap.cc" \
< <(./list-linuxcnc-wasm-manifest-sources.sh "$manifest" blocked) >/dev/null
unknown_manifest_filter_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_unknown_wasm_manifest_filter.XXXXXX.log")
if ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" bogus >"$unknown_manifest_filter_log" 2>&1; then
echo "wasm manifest source lister accepted unknown filter" >&2
exit 1
fi
if ! grep -F "unknown manifest source filter: bogus" "$unknown_manifest_filter_log" >/dev/null; then
echo "wasm manifest source lister did not report unknown filter clearly" >&2
sed -n '1,20p' "$unknown_manifest_filter_log" >&2
exit 1
fi
rm -f "$unknown_manifest_filter_log"
unknown_manifest_output_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_unknown_wasm_manifest_output.XXXXXX.log")
if ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" core bogus >"$unknown_manifest_output_log" 2>&1; then
echo "wasm manifest source lister accepted unknown output mode" >&2
exit 1
fi
if ! grep -F "unknown manifest source output mode: bogus" "$unknown_manifest_output_log" >/dev/null; then
echo "wasm manifest source lister did not report unknown output mode clearly" >&2
sed -n '1,20p' "$unknown_manifest_output_log" >&2
exit 1
fi
rm -f "$unknown_manifest_output_log"
grep -Fx "$linuxcnc_root/src/emc/rs274ngc/interp_arc.cc" \
< <(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" core full) >/dev/null
grep -Fx "core/wasm_shims/dlfcn.cc" < <(./list-linuxcnc-wasm-safe-shims.sh dlfcn.cc) >/dev/null
grep -Fx "core/wasm_shims/pythonplugin/python_plugin.cc" \
< <(./list-linuxcnc-wasm-safe-shims.sh python_plugin.cc) >/dev/null
grep -Fx "core/wasm_shims/rtapi_compat.cc" \
< <(./list-linuxcnc-wasm-safe-shims.sh rtapi_compat.cc) >/dev/null
grep -Fx "core/wasm_shims/tooldata/tooldata_mmap_backend.cc" \
< <(./list-linuxcnc-wasm-safe-shims.sh tooldata_mmap_backend.cc) >/dev/null
grep -Fx "core/wasm_shims/tooldata/tooldata_runtime_stubs.cc" \
< <(./list-linuxcnc-wasm-safe-shims.sh tooldata_runtime_stubs.cc) >/dev/null
grep -Fx "core/src/linuxcnc_canon_bridge.cpp" \
< <(./list-linuxcnc-wasm-safe-project-sources.sh linuxcnc_canon_bridge.cpp) >/dev/null
missing_shim_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_wasm_safe_shim.XXXXXX.log")
if ./list-linuxcnc-wasm-safe-shims.sh does_not_exist.cc >"$missing_shim_log" 2>&1; then
echo "wasm-safe shim lister accepted missing shim filter" >&2
exit 1
fi
if ! grep -F "missing wasm-safe shim in CMake list: does_not_exist.cc" "$missing_shim_log" >/dev/null; then
echo "wasm-safe shim lister did not report missing shim filter clearly" >&2
sed -n '1,20p' "$missing_shim_log" >&2
exit 1
fi
rm -f "$missing_shim_log"
missing_project_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_wasm_safe_project_source.XXXXXX.log")
if ./list-linuxcnc-wasm-safe-project-sources.sh does_not_exist.cc >"$missing_project_source_log" 2>&1; then
echo "wasm-safe project source lister accepted missing source filter" >&2
exit 1
fi
if ! grep -F "missing wasm-safe project source in CMake list: does_not_exist.cc" "$missing_project_source_log" >/dev/null; then
echo "wasm-safe project source lister did not report missing source filter clearly" >&2
sed -n '1,20p' "$missing_project_source_log" >&2
exit 1
fi
rm -f "$missing_project_source_log"
rm -f "$missing_root_log"
missing_wasm_script_manifest=${TMPDIR:-/tmp}/cnc_sim_missing_wasm_script_manifest.txt
missing_wasm_script_manifest_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_wasm_script_manifest.XXXXXX.log")
rm -f "$missing_wasm_script_manifest"
for script in \
list-linuxcnc-wasm-manifest-sources.sh \
test-linuxcnc-wasm-source-syntax.sh \
test-linuxcnc-wasm-source-objects.sh \
test-linuxcnc-wasm-rs274ngc-pre-link-blockers.sh \
test-linuxcnc-wasm-rs274ngc-pre-link.sh; do
if "./$script" "$missing_wasm_script_manifest" >"$missing_wasm_script_manifest_log" 2>&1; then
echo "$script accepted missing manifest: $missing_wasm_script_manifest" >&2
exit 1
fi
if ! grep -F "missing manifest: $missing_wasm_script_manifest" "$missing_wasm_script_manifest_log" >/dev/null; then
echo "$script did not report missing manifest clearly" >&2
sed -n '1,20p' "$missing_wasm_script_manifest_log" >&2
exit 1
fi
done
rm -f "$missing_wasm_script_manifest_log"
missing_root_scripts=(
test-linuxcnc-wasm-interp-base-link.sh
test-linuxcnc-wasm-interp-find-link.sh
test-linuxcnc-wasm-python-plugin-link.sh
test-linuxcnc-wasm-rs274ngc-pre-object.sh
test-linuxcnc-wasm-rs274ngc-pre-link-blockers.sh
test-linuxcnc-wasm-rs274ngc-pre-link.sh
test-linuxcnc-wasm-source-objects.sh
test-linuxcnc-wasm-source-syntax.sh
test-linuxcnc-wasm-tooldata-common-link.sh
test-linuxcnc-wasm-tooldata-link.sh
test-linuxcnc-wasm-tooldata-mmap-symbols.sh
@@ -66,6 +191,8 @@ fixed_source_scripts=(
"test-linuxcnc-wasm-rs274ngc-pre-object.sh:src/emc/rs274ngc/rs274ngc_pre.cc"
"test-linuxcnc-wasm-tooldata-common-link.sh:src/emc/tooldata/tooldata_common.cc"
"test-linuxcnc-wasm-tooldata-link.sh:src/emc/tooldata/tooldata_common.cc"
"test-linuxcnc-wasm-tooldata-mmap-symbols.sh:src/emc/tooldata/tooldata_mmap.cc"
"test-linuxcnc-wasm-tooldata-runtime-symbols.sh:src/emc/tooldata/tooldata_db.cc"
)
for script_and_path in "${fixed_source_scripts[@]}"; do
script=${script_and_path%%:*}
@@ -83,9 +210,50 @@ done
rm -rf "$missing_source_root"
rm -f "$missing_source_log"
missing_interp_find_root=$(mktemp -d "${TMPDIR:-/tmp}/cnc_sim_missing_interp_find_source_root.XXXXXX")
missing_interp_find_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_interp_find_source.XXXXXX.log")
mkdir -p "$missing_interp_find_root/src/emc/tooldata" "$missing_interp_find_root/src/emc/rs274ngc" "$missing_interp_find_root/include"
touch "$missing_interp_find_root/src/emc/tooldata/tooldata_common.cc"
if LINUXCNC_ROOT="$missing_interp_find_root" ./test-linuxcnc-wasm-interp-find-link.sh >"$missing_interp_find_log" 2>&1; then
echo "test-linuxcnc-wasm-interp-find-link.sh accepted missing LinuxCNC source: src/emc/rs274ngc/interp_find.cc" >&2
exit 1
fi
if ! grep -F "missing LinuxCNC source: src/emc/rs274ngc/interp_find.cc" "$missing_interp_find_log" >/dev/null; then
echo "test-linuxcnc-wasm-interp-find-link.sh did not report missing interp_find source clearly" >&2
sed -n '1,20p' "$missing_interp_find_log" >&2
exit 1
fi
rm -rf "$missing_interp_find_root"
rm -f "$missing_interp_find_log"
missing_tooldata_runtime_root=$(mktemp -d "${TMPDIR:-/tmp}/cnc_sim_missing_tooldata_runtime_source_root.XXXXXX")
missing_tooldata_runtime_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_tooldata_runtime_source.XXXXXX.log")
mkdir -p "$missing_tooldata_runtime_root/src/emc/tooldata" "$missing_tooldata_runtime_root/include"
touch "$missing_tooldata_runtime_root/src/emc/tooldata/tooldata_db.cc"
if LINUXCNC_ROOT="$missing_tooldata_runtime_root" ./test-linuxcnc-wasm-tooldata-runtime-symbols.sh >"$missing_tooldata_runtime_log" 2>&1; then
echo "test-linuxcnc-wasm-tooldata-runtime-symbols.sh accepted missing LinuxCNC source: src/emc/tooldata/tooldata_nml.cc" >&2
exit 1
fi
if ! grep -F "missing LinuxCNC source: src/emc/tooldata/tooldata_nml.cc" "$missing_tooldata_runtime_log" >/dev/null; then
echo "test-linuxcnc-wasm-tooldata-runtime-symbols.sh did not report missing tooldata_nml source clearly" >&2
sed -n '1,20p' "$missing_tooldata_runtime_log" >&2
exit 1
fi
rm -rf "$missing_tooldata_runtime_root"
rm -f "$missing_tooldata_runtime_log"
unknown_group_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_unknown_wasm_manifest_group.XXXXXX.txt")
unknown_group_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_unknown_wasm_manifest_group.XXXXXX.log")
printf 'bogus:src/emc/rs274ngc/interp_arc.cc:test unknown group\n' >"$unknown_group_manifest"
if ./build-wasm.sh "$unknown_group_manifest" >"$unknown_group_log" 2>&1; then
echo "build-wasm accepted unknown manifest group" >&2
exit 1
fi
if ! grep -F "unknown manifest group: bogus" "$unknown_group_log" >/dev/null; then
echo "build-wasm did not report unknown manifest group clearly" >&2
sed -n '1,20p' "$unknown_group_log" >&2
exit 1
fi
for script in \
analyze-linuxcnc-wasm-blockers.sh \
test-linuxcnc-wasm-source-syntax.sh \
@@ -117,6 +285,15 @@ rm -f "$blocker_report_file" "$blocker_scan_log"
missing_source_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_wasm_manifest_source.XXXXXX.txt")
missing_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_missing_wasm_manifest_source.XXXXXX.log")
printf 'core:src/emc/rs274ngc/does_not_exist.cc:test missing source\n' >"$missing_source_manifest"
if ./build-wasm.sh "$missing_source_manifest" >"$missing_source_log" 2>&1; then
echo "build-wasm accepted missing manifest source" >&2
exit 1
fi
if ! grep -F "missing manifest source: src/emc/rs274ngc/does_not_exist.cc" "$missing_source_log" >/dev/null; then
echo "build-wasm did not report missing manifest source clearly" >&2
sed -n '1,20p' "$missing_source_log" >&2
exit 1
fi
if ./test-linuxcnc-wasm-source-syntax.sh "$missing_source_manifest" >"$missing_source_log" 2>&1; then
echo "wasm source syntax probe accepted missing manifest source" >&2
exit 1
@@ -155,50 +332,174 @@ if ! grep -F "missing manifest source: src/emc/rs274ngc/does_not_exist.cc" "$mis
fi
rm -f "$missing_source_manifest" "$missing_source_log"
empty_partition_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_empty_wasm_manifest_partition.XXXXXX.log")
empty_core_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_empty_wasm_manifest_core.XXXXXX.txt")
empty_blocked_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_empty_wasm_manifest_blocked.XXXXXX.txt")
printf 'blocked:src/emc/tooldata/tooldata_mmap.cc:test empty core partition\n' >"$empty_core_manifest"
if ./build-wasm.sh "$empty_core_manifest" >"$empty_partition_log" 2>&1; then
echo "build-wasm accepted empty core manifest partition" >&2
exit 1
fi
if ! grep -F "unexpected wasm manifest partition: core=0 blocked=1" "$empty_partition_log" >/dev/null; then
echo "build-wasm did not report empty core manifest partition clearly" >&2
sed -n '1,20p' "$empty_partition_log" >&2
exit 1
fi
printf 'core:src/emc/rs274ngc/interp_arc.cc:test empty blocked partition\n' >"$empty_blocked_manifest"
if ./build-wasm.sh "$empty_blocked_manifest" >"$empty_partition_log" 2>&1; then
echo "build-wasm accepted empty blocked manifest partition" >&2
exit 1
fi
if ! grep -F "unexpected wasm manifest partition: core=1 blocked=0" "$empty_partition_log" >/dev/null; then
echo "build-wasm did not report empty blocked manifest partition clearly" >&2
sed -n '1,20p' "$empty_partition_log" >&2
exit 1
fi
rm -f "$empty_core_manifest" "$empty_blocked_manifest" "$empty_partition_log"
bad_default_manifest_dir=$(mktemp -d "${TMPDIR:-/tmp}/cnc_sim_bad_default_wasm_manifest.XXXXXX")
bad_default_manifest_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_bad_default_wasm_manifest.XXXXXX.log")
linuxcnc_root_abs=$(cd "$linuxcnc_root" && pwd)
cp build-wasm.sh "$bad_default_manifest_dir/build-wasm.sh"
cp list-linuxcnc-wasm-manifest-sources.sh "$bad_default_manifest_dir/list-linuxcnc-wasm-manifest-sources.sh"
printf 'core:src/emc/rs274ngc/interp_arc.cc:test bad default core count\nblocked:src/emc/tooldata/tooldata_mmap.cc:test bad default blocked count\n' \
>"$bad_default_manifest_dir/linuxcnc-rs274-wasm-source-files.txt"
if LINUXCNC_ROOT="$linuxcnc_root_abs" "$bad_default_manifest_dir/build-wasm.sh" >"$bad_default_manifest_log" 2>&1; then
echo "build-wasm accepted bad default wasm manifest partition" >&2
exit 1
fi
if ! grep -F "unexpected wasm manifest partition: core=1 blocked=1" "$bad_default_manifest_log" >/dev/null; then
echo "build-wasm did not enforce default wasm manifest partition for no-arg entry" >&2
sed -n '1,20p' "$bad_default_manifest_log" >&2
exit 1
fi
rm -rf "$bad_default_manifest_dir"
rm -f "$bad_default_manifest_log"
duplicate_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_duplicate_wasm_manifest.XXXXXX.txt")
duplicate_manifest_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_duplicate_wasm_manifest.XXXXXX.log")
cat >"$duplicate_manifest" <<'EOF'
core:src/emc/rs274ngc/interp_arc.cc:duplicate core entry
core:src/emc/rs274ngc/interp_arc.cc:duplicate core entry
blocked:src/emc/tooldata/tooldata_mmap.cc:blocked entry
EOF
if ./build-wasm.sh "$duplicate_manifest" >"$duplicate_manifest_log" 2>&1; then
echo "build-wasm accepted duplicate manifest source" >&2
exit 1
fi
if ! grep -F "duplicate manifest source: src/emc/rs274ngc/interp_arc.cc" "$duplicate_manifest_log" >/dev/null; then
echo "build-wasm did not report duplicate manifest source clearly" >&2
sed -n '1,20p' "$duplicate_manifest_log" >&2
exit 1
fi
rm -f "$duplicate_manifest" "$duplicate_manifest_log"
comment_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_comment_wasm_manifest.XXXXXX.txt")
comment_manifest_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_comment_wasm_manifest.XXXXXX.log")
cat >"$comment_manifest" <<'EOF'
# LinuxCNC rs274 source subset for browser-safe source-link probing.
# Format: group:path:note
core:src/emc/rs274ngc/interp_arc.cc:commented core entry
blocked:src/emc/tooldata/tooldata_mmap.cc:commented blocked entry
EOF
if ./build-wasm.sh "$comment_manifest" >"$comment_manifest_log" 2>&1; then
:
fi
if grep -F "duplicate manifest source" "$comment_manifest_log" >/dev/null; then
echo "build-wasm rejected commented manifest lines as duplicates" >&2
sed -n '1,20p' "$comment_manifest_log" >&2
exit 1
fi
rm -f "$comment_manifest" "$comment_manifest_log"
duplicate_source_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_duplicate_wasm_source_manifest.XXXXXX.txt")
duplicate_source_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_duplicate_wasm_source_manifest.XXXXXX.log")
cat >"$duplicate_source_manifest" <<'EOF'
core:src/emc/rs274ngc/interp_arc.cc:duplicate core entry
core:src/emc/rs274ngc/interp_arc.cc:duplicate core entry
blocked:src/emc/tooldata/tooldata_mmap.cc:blocked entry
EOF
if ./test-linuxcnc-wasm-source-objects.sh "$duplicate_source_manifest" >"$duplicate_source_log" 2>&1; then
echo "source object probe accepted duplicate manifest source" >&2
exit 1
fi
if ! grep -F "duplicate manifest source: src/emc/rs274ngc/interp_arc.cc" "$duplicate_source_log" >/dev/null; then
echo "source object probe did not report duplicate manifest source clearly" >&2
sed -n '1,20p' "$duplicate_source_log" >&2
exit 1
fi
rm -f "$duplicate_source_manifest" "$duplicate_source_log"
duplicate_syntax_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_duplicate_wasm_syntax_manifest.XXXXXX.txt")
duplicate_syntax_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_duplicate_wasm_syntax_manifest.XXXXXX.log")
cat >"$duplicate_syntax_manifest" <<'EOF'
core:src/emc/rs274ngc/interp_arc.cc:duplicate core entry
core:src/emc/rs274ngc/interp_arc.cc:duplicate core entry
blocked:src/emc/tooldata/tooldata_mmap.cc:blocked entry
EOF
if ./test-linuxcnc-wasm-source-syntax.sh "$duplicate_syntax_manifest" >"$duplicate_syntax_log" 2>&1; then
echo "syntax probe accepted duplicate manifest source" >&2
exit 1
fi
if ! grep -F "duplicate manifest source: src/emc/rs274ngc/interp_arc.cc" "$duplicate_syntax_log" >/dev/null; then
echo "syntax probe did not report duplicate manifest source clearly" >&2
sed -n '1,20p' "$duplicate_syntax_log" >&2
exit 1
fi
rm -f "$duplicate_syntax_manifest" "$duplicate_syntax_log"
duplicate_pre_blocker_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_duplicate_wasm_pre_blocker_manifest.XXXXXX.txt")
duplicate_pre_blocker_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_duplicate_wasm_pre_blocker_manifest.XXXXXX.log")
cat >"$duplicate_pre_blocker_manifest" <<'EOF'
core:src/emc/rs274ngc/interp_arc.cc:duplicate core entry
core:src/emc/rs274ngc/interp_arc.cc:duplicate core entry
blocked:src/emc/tooldata/tooldata_mmap.cc:blocked entry
EOF
if ./test-linuxcnc-wasm-rs274ngc-pre-link-blockers.sh "$duplicate_pre_blocker_manifest" >"$duplicate_pre_blocker_log" 2>&1; then
echo "rs274ngc_pre blocker scan accepted duplicate manifest source" >&2
exit 1
fi
if ! grep -F "duplicate manifest source: src/emc/rs274ngc/interp_arc.cc" "$duplicate_pre_blocker_log" >/dev/null; then
echo "rs274ngc_pre blocker scan did not report duplicate manifest source clearly" >&2
sed -n '1,20p' "$duplicate_pre_blocker_log" >&2
exit 1
fi
rm -f "$duplicate_pre_blocker_manifest" "$duplicate_pre_blocker_log"
duplicate_pre_link_manifest=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_duplicate_wasm_pre_link_manifest.XXXXXX.txt")
duplicate_pre_link_log=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_duplicate_wasm_pre_link_manifest.XXXXXX.log")
cat >"$duplicate_pre_link_manifest" <<'EOF'
core:src/emc/rs274ngc/interp_arc.cc:duplicate core entry
core:src/emc/rs274ngc/interp_arc.cc:duplicate core entry
blocked:src/emc/tooldata/tooldata_mmap.cc:blocked entry
EOF
if ./test-linuxcnc-wasm-rs274ngc-pre-link.sh "$duplicate_pre_link_manifest" >"$duplicate_pre_link_log" 2>&1; then
echo "rs274ngc_pre link probe accepted duplicate manifest source" >&2
exit 1
fi
if ! grep -F "duplicate manifest source: src/emc/rs274ngc/interp_arc.cc" "$duplicate_pre_link_log" >/dev/null; then
echo "rs274ngc_pre link probe did not report duplicate manifest source clearly" >&2
sed -n '1,20p' "$duplicate_pre_link_log" >&2
exit 1
fi
rm -f "$duplicate_pre_link_manifest" "$duplicate_pre_link_log"
linuxcnc_root=$(cd "$linuxcnc_root" && pwd)
default_manifest="$PWD/linuxcnc-rs274-wasm-source-files.txt"
manifest_core_count=0
manifest_blocked_count=0
while IFS=: read -r group path note; do
case "$group" in
core)
manifest_core_count=$((manifest_core_count + 1))
;;
blocked)
manifest_blocked_count=$((manifest_blocked_count + 1))
;;
""|\#*)
continue
;;
*)
echo "unknown manifest group: $group" >&2
exit 1
;;
esac
if [[ ! -f "$linuxcnc_root/$path" ]]; then
echo "missing manifest source: $path" >&2
exit 1
fi
done < "$manifest"
manifest_core_sources="$build_dir/wasm_core_sources.txt"
manifest_blocked_sources="$build_dir/wasm_blocked_sources.txt"
./list-linuxcnc-wasm-manifest-sources.sh "$manifest" core > "$manifest_core_sources"
./list-linuxcnc-wasm-manifest-sources.sh "$manifest" blocked > "$manifest_blocked_sources"
manifest_core_count=$(wc -l < "$manifest_core_sources")
manifest_blocked_count=$(wc -l < "$manifest_blocked_sources")
required_shims=(
wasm_shims/dlfcn.cc
wasm_shims/emc_status_shim.cc
wasm_shims/gettext_shim.cc
wasm_shims/linuxcnc_runtime_shim.cc
wasm_shims/python_c_api_shim.cc
wasm_shims/rtapi_compat.cc
wasm_shims/tooldata/tooldata_mmap_backend.cc
wasm_shims/tooldata/tooldata_runtime_stubs.cc
wasm_shims/pythonplugin/python_plugin.cc
)
required_project_sources=(
src/canon_event_sink.cpp
src/linuxcnc_canon_bridge.cpp
src/linuxcnc_tooldata_fixture.cpp
src/rtcp_kinematics.cpp
)
required_shim_sources="$build_dir/wasm_safe_shim_sources.txt"
./list-linuxcnc-wasm-safe-shims.sh > "$required_shim_sources"
required_project_sources="$build_dir/wasm_safe_project_sources.txt"
./list-linuxcnc-wasm-safe-project-sources.sh > "$required_project_sources"
if [[ "$manifest" == "$default_manifest" ]] && [[ "$manifest_core_count" -ne 25 || "$manifest_blocked_count" -ne 1 ]]; then
echo "unexpected wasm manifest partition: core=$manifest_core_count blocked=$manifest_blocked_count" >&2
@@ -209,19 +510,23 @@ if [[ "$manifest_core_count" -eq 0 || "$manifest_blocked_count" -eq 0 ]]; then
exit 1
fi
for shim in "${required_shims[@]}"; do
if ! grep -F "$shim" core/CMakeLists.txt >/dev/null; then
echo "missing CMake wasm-safe shim: $shim" >&2
while IFS= read -r shim; do
[[ -z "$shim" ]] && continue
cmake_shim=${shim#core/}
if ! grep -F "$cmake_shim" core/CMakeLists.txt >/dev/null; then
echo "missing CMake wasm-safe shim: $cmake_shim" >&2
exit 1
fi
done
done < "$required_shim_sources"
for source in "${required_project_sources[@]}"; do
if ! grep -F "$source" core/CMakeLists.txt >/dev/null; then
echo "missing CMake wasm-safe project source: $source" >&2
while IFS= read -r source; do
[[ -z "$source" ]] && continue
cmake_source=${source#core/}
if ! grep -F "$cmake_source" core/CMakeLists.txt >/dev/null; then
echo "missing CMake wasm-safe project source: $cmake_source" >&2
exit 1
fi
done
done < "$required_project_sources"
grep -F "add_executable(linuxcnc_rs274_wasm_safe_probe EXCLUDE_FROM_ALL" core/CMakeLists.txt >/dev/null
grep -F "wasm_shims/rs274ngc_pre_probe_main.cc" core/CMakeLists.txt >/dev/null
@@ -229,8 +534,11 @@ grep -F "target_link_libraries(linuxcnc_rs274_wasm_safe_probe PRIVATE fmt)" core
grep -F "add_custom_target(linuxcnc_rs274_wasm_blocked_sources" core/CMakeLists.txt >/dev/null
grep -F "LinuxCNC source root does not exist" core/CMakeLists.txt >/dev/null
grep -F 'if(NOT IS_DIRECTORY "${CNC_SIM_LINUXCNC_ROOT_ABS}")' core/CMakeLists.txt >/dev/null
grep -F "Missing LinuxCNC wasm source manifest" core/CMakeLists.txt >/dev/null
grep -F 'if(NOT EXISTS "${CNC_SIM_LINUXCNC_WASM_SOURCE_MANIFEST}")' core/CMakeLists.txt >/dev/null
grep -F "LinuxCNC wasm source manifest is not a file" core/CMakeLists.txt >/dev/null
grep -F 'if(IS_DIRECTORY "${CNC_SIM_LINUXCNC_WASM_SOURCE_MANIFEST}")' core/CMakeLists.txt >/dev/null
grep -F "Bad LinuxCNC wasm source manifest line" core/CMakeLists.txt >/dev/null
grep -F "LinuxCNC wasm manifest source does not exist" core/CMakeLists.txt >/dev/null
grep -F 'if(NOT EXISTS "${manifest_source}")' core/CMakeLists.txt >/dev/null
grep -F "LinuxCNC wasm manifest source is not a file" core/CMakeLists.txt >/dev/null
@@ -240,6 +548,7 @@ awk '
/Unknown LinuxCNC wasm source manifest group/ { unknown_group = NR }
END { exit !(unknown_group && manifest_source && unknown_group < manifest_source) }
' core/CMakeLists.txt
grep -F "LinuxCNC wasm source manifest has no core entries" core/CMakeLists.txt >/dev/null
grep -F "LinuxCNC wasm source manifest has no blocked entries" core/CMakeLists.txt >/dev/null
if ! command -v cmake >/dev/null 2>&1; then

View File

@@ -11,12 +11,11 @@ if [[ ! -d "$linuxcnc_root" ]]; then
echo "missing LinuxCNC root: $linuxcnc_root" >&2
exit 1
fi
if [[ ! -f "$linuxcnc_root/src/emc/rs274ngc/interp_base.cc" ]]; then
echo "missing LinuxCNC source: src/emc/rs274ngc/interp_base.cc" >&2
exit 1
fi
trap 'rm -rf "$build_dir"' EXIT
dlfcn_shim=$(./list-linuxcnc-wasm-safe-shims.sh dlfcn.cc)
interp_base_source=$(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-files.sh src/emc/rs274ngc/interp_base.cc)
common_flags=(
-std=c++17
-DULAPI
@@ -30,8 +29,8 @@ common_flags=(
)
"$cxx" "${common_flags[@]}" \
core/wasm_shims/dlfcn.cc \
"$linuxcnc_root/src/emc/rs274ngc/interp_base.cc" \
"$dlfcn_shim" \
"$interp_base_source" \
core/wasm_shims/interp_base_probe_main.cc \
-o "$build_dir/interp_base_probe"

View File

@@ -11,16 +11,17 @@ if [[ ! -d "$linuxcnc_root" ]]; then
echo "missing LinuxCNC root: $linuxcnc_root" >&2
exit 1
fi
for required_source in \
src/emc/tooldata/tooldata_common.cc \
src/emc/rs274ngc/interp_find.cc; do
if [[ ! -f "$linuxcnc_root/$required_source" ]]; then
echo "missing LinuxCNC source: $required_source" >&2
exit 1
fi
done
trap 'rm -rf "$build_dir"' EXIT
tooldata_mmap_backend_shim=$(./list-linuxcnc-wasm-safe-shims.sh tooldata_mmap_backend.cc)
tooldata_runtime_stubs_shim=$(./list-linuxcnc-wasm-safe-shims.sh tooldata_runtime_stubs.cc)
rtapi_compat_shim=$(./list-linuxcnc-wasm-safe-shims.sh rtapi_compat.cc)
readarray -t linuxcnc_sources < <(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-files.sh \
src/emc/tooldata/tooldata_common.cc \
src/emc/rs274ngc/interp_find.cc)
tooldata_common_source=${linuxcnc_sources[0]}
interp_find_source=${linuxcnc_sources[1]}
common_flags=(
-std=c++17
-DULAPI
@@ -36,22 +37,22 @@ common_flags=(
)
"$cxx" "${common_flags[@]}" \
-c "$linuxcnc_root/src/emc/tooldata/tooldata_common.cc" \
-c "$tooldata_common_source" \
-o "$build_dir/tooldata_common.o"
"$cxx" "${common_flags[@]}" \
-c core/wasm_shims/tooldata/tooldata_mmap_backend.cc \
-c "$tooldata_mmap_backend_shim" \
-o "$build_dir/tooldata_mmap_backend.o"
"$cxx" "${common_flags[@]}" \
-c core/wasm_shims/tooldata/tooldata_runtime_stubs.cc \
-c "$tooldata_runtime_stubs_shim" \
-o "$build_dir/tooldata_runtime_stubs.o"
"$cxx" "${common_flags[@]}" \
-c core/wasm_shims/rtapi_compat.cc \
-c "$rtapi_compat_shim" \
-o "$build_dir/rtapi_compat.o"
"$cxx" "${common_flags[@]}" \
-c core/wasm_shims/interp_find_probe_stubs.cc \
-o "$build_dir/interp_find_probe_stubs.o"
"$cxx" "${common_flags[@]}" \
-c "$linuxcnc_root/src/emc/rs274ngc/interp_find.cc" \
-c "$interp_find_source" \
-o "$build_dir/interp_find.o"
"$cxx" "${common_flags[@]}" \
-c core/wasm_shims/interp_find_probe_main.cc \

View File

@@ -13,6 +13,8 @@ if [[ ! -d "$linuxcnc_root" ]]; then
fi
trap 'rm -rf "$build_dir"' EXIT
python_plugin_shim=$(./list-linuxcnc-wasm-safe-shims.sh python_plugin.cc)
common_flags=(
-std=c++17
-DULAPI
@@ -26,7 +28,7 @@ common_flags=(
)
"$cxx" "${common_flags[@]}" \
core/wasm_shims/pythonplugin/python_plugin.cc \
"$python_plugin_shim" \
core/wasm_shims/pythonplugin/python_plugin_probe_main.cc \
-o "$build_dir/python_plugin_probe"

View File

@@ -36,43 +36,18 @@ common_flags=(
-I "$linuxcnc_root/include"
)
shim_sources=(
core/wasm_shims/dlfcn.cc
core/wasm_shims/emc_status_shim.cc
core/wasm_shims/gettext_shim.cc
core/wasm_shims/linuxcnc_runtime_shim.cc
core/wasm_shims/python_c_api_shim.cc
core/wasm_shims/rtapi_compat.cc
core/wasm_shims/tooldata/tooldata_mmap_backend.cc
core/wasm_shims/tooldata/tooldata_runtime_stubs.cc
core/wasm_shims/pythonplugin/python_plugin.cc
)
shim_list="$build_dir/wasm_safe_shims.txt"
./list-linuxcnc-wasm-safe-shims.sh > "$shim_list"
mapfile -t shim_sources < "$shim_list"
project_sources=(
core/src/canon_event_sink.cpp
core/src/linuxcnc_canon_bridge.cpp
core/src/linuxcnc_tooldata_fixture.cpp
core/src/rtcp_kinematics.cpp
)
project_source_list="$build_dir/wasm_safe_project_sources.txt"
./list-linuxcnc-wasm-safe-project-sources.sh > "$project_source_list"
mapfile -t project_sources < "$project_source_list"
linuxcnc_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
linuxcnc_sources+=("$linuxcnc_root/$path")
;;
""|\#*|blocked)
;;
*)
echo "unknown manifest group: $group" >&2
exit 1
;;
esac
done < "$manifest"
source_list="$build_dir/wasm_core_sources.txt"
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" core full > "$source_list"
mapfile -t linuxcnc_sources < "$source_list"
shim_index=0
for source in "${shim_sources[@]}"; do

View File

@@ -36,39 +36,20 @@ common_flags=(
-I "$linuxcnc_root/include"
)
sources=(
core/wasm_shims/dlfcn.cc
core/wasm_shims/emc_status_shim.cc
core/wasm_shims/gettext_shim.cc
core/wasm_shims/linuxcnc_runtime_shim.cc
core/wasm_shims/python_c_api_shim.cc
core/wasm_shims/rtapi_compat.cc
core/wasm_shims/tooldata/tooldata_mmap_backend.cc
core/wasm_shims/tooldata/tooldata_runtime_stubs.cc
core/wasm_shims/pythonplugin/python_plugin.cc
core/src/canon_event_sink.cpp
core/src/linuxcnc_canon_bridge.cpp
core/src/linuxcnc_tooldata_fixture.cpp
core/src/rtcp_kinematics.cpp
)
shim_list="$build_dir/wasm_safe_shims.txt"
./list-linuxcnc-wasm-safe-shims.sh > "$shim_list"
mapfile -t sources < "$shim_list"
project_source_list="$build_dir/wasm_safe_project_sources.txt"
./list-linuxcnc-wasm-safe-project-sources.sh > "$project_source_list"
mapfile -t project_sources < "$project_source_list"
sources+=("${project_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+=("$linuxcnc_root/$path")
;;
""|\#*|blocked)
;;
*)
echo "unknown manifest group: $group" >&2
exit 1
;;
esac
done < "$manifest"
source_list="$build_dir/wasm_core_sources.txt"
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" core full > "$source_list"
mapfile -t linuxcnc_sources < "$source_list"
for source in "${linuxcnc_sources[@]}"; do
sources+=("$source")
done
sources+=(core/wasm_shims/rs274ngc_pre_probe_main.cc)

View File

@@ -11,11 +11,8 @@ if [[ ! -d "$linuxcnc_root" ]]; then
echo "missing LinuxCNC root: $linuxcnc_root" >&2
exit 1
fi
if [[ ! -f "$linuxcnc_root/src/emc/rs274ngc/rs274ngc_pre.cc" ]]; then
echo "missing LinuxCNC source: src/emc/rs274ngc/rs274ngc_pre.cc" >&2
exit 1
fi
trap 'rm -rf "$build_dir"' EXIT
rs274ngc_pre_source=$(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-files.sh src/emc/rs274ngc/rs274ngc_pre.cc)
common_flags=(
-std=c++17
@@ -30,7 +27,7 @@ common_flags=(
)
"$cxx" "${common_flags[@]}" \
-c "$linuxcnc_root/src/emc/rs274ngc/rs274ngc_pre.cc" \
-c "$rs274ngc_pre_source" \
-o "$build_dir/rs274ngc_pre.o"
echo "linuxcnc wasm rs274ngc_pre object probe passed"

View File

@@ -7,17 +7,6 @@ linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
manifest=${1:-linuxcnc-rs274-wasm-source-files.txt}
cxx=${CXX:-g++}
build_dir=$(mktemp -d "${TMPDIR:-/tmp}/cnc_sim_linuxcnc_wasm_safe_probe.XXXXXX")
shim_sources=(
core/wasm_shims/dlfcn.cc
core/wasm_shims/emc_status_shim.cc
core/wasm_shims/gettext_shim.cc
core/wasm_shims/linuxcnc_runtime_shim.cc
core/wasm_shims/python_c_api_shim.cc
core/wasm_shims/rtapi_compat.cc
core/wasm_shims/tooldata/tooldata_mmap_backend.cc
core/wasm_shims/tooldata/tooldata_runtime_stubs.cc
core/wasm_shims/pythonplugin/python_plugin.cc
)
if [[ ! -f "$manifest" ]]; then
echo "missing manifest: $manifest" >&2
@@ -30,6 +19,10 @@ if [[ ! -d "$linuxcnc_root" ]]; then
fi
trap 'rm -rf "$build_dir"' EXIT
shim_list="$build_dir/wasm_safe_shims.txt"
./list-linuxcnc-wasm-safe-shims.sh > "$shim_list"
mapfile -t shim_sources < "$shim_list"
common_flags=(
-std=c++20
-DULAPI
@@ -45,24 +38,9 @@ common_flags=(
-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"
source_list="$build_dir/wasm_core_sources.txt"
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" core full > "$source_list"
mapfile -t sources < "$source_list"
shim_index=0
for source in "${shim_sources[@]}"; do
@@ -74,7 +52,7 @@ done
source_index=0
for source in "${sources[@]}"; do
obj="$build_dir/linuxcnc_${source_index}.o"
"$cxx" "${common_flags[@]}" -c "$linuxcnc_root/$source" -o "$obj"
"$cxx" "${common_flags[@]}" -c "$source" -o "$obj"
source_index=$((source_index + 1))
done

View File

@@ -33,27 +33,13 @@ common_flags=(
-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"
source_list=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_linuxcnc_wasm_source_syntax_sources.XXXXXX.txt")
trap 'rm -f "$source_list"' EXIT
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" core full > "$source_list"
mapfile -t sources < "$source_list"
for source in "${sources[@]}"; do
"$cxx" "${common_flags[@]}" "$linuxcnc_root/$source"
"$cxx" "${common_flags[@]}" "$source"
done
echo "linuxcnc wasm-safe source syntax probe passed (${#sources[@]} files)"

View File

@@ -11,12 +11,12 @@ if [[ ! -d "$linuxcnc_root" ]]; then
echo "missing LinuxCNC root: $linuxcnc_root" >&2
exit 1
fi
if [[ ! -f "$linuxcnc_root/src/emc/tooldata/tooldata_common.cc" ]]; then
echo "missing LinuxCNC source: src/emc/tooldata/tooldata_common.cc" >&2
exit 1
fi
trap 'rm -rf "$build_dir"' EXIT
tooldata_mmap_backend_shim=$(./list-linuxcnc-wasm-safe-shims.sh tooldata_mmap_backend.cc)
tooldata_runtime_stubs_shim=$(./list-linuxcnc-wasm-safe-shims.sh tooldata_runtime_stubs.cc)
tooldata_common_source=$(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-files.sh src/emc/tooldata/tooldata_common.cc)
common_flags=(
-std=c++17
-DULAPI
@@ -30,9 +30,9 @@ common_flags=(
)
"$cxx" "${common_flags[@]}" \
"$linuxcnc_root/src/emc/tooldata/tooldata_common.cc" \
core/wasm_shims/tooldata/tooldata_mmap_backend.cc \
core/wasm_shims/tooldata/tooldata_runtime_stubs.cc \
"$tooldata_common_source" \
"$tooldata_mmap_backend_shim" \
"$tooldata_runtime_stubs_shim" \
core/wasm_shims/tooldata/tooldata_common_probe_main.cc \
-o "$build_dir/tooldata_common_probe"

View File

@@ -11,12 +11,12 @@ if [[ ! -d "$linuxcnc_root" ]]; then
echo "missing LinuxCNC root: $linuxcnc_root" >&2
exit 1
fi
if [[ ! -f "$linuxcnc_root/src/emc/tooldata/tooldata_common.cc" ]]; then
echo "missing LinuxCNC source: src/emc/tooldata/tooldata_common.cc" >&2
exit 1
fi
trap 'rm -rf "$build_dir"' EXIT
tooldata_mmap_backend_shim=$(./list-linuxcnc-wasm-safe-shims.sh tooldata_mmap_backend.cc)
tooldata_runtime_stubs_shim=$(./list-linuxcnc-wasm-safe-shims.sh tooldata_runtime_stubs.cc)
tooldata_common_source=$(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-files.sh src/emc/tooldata/tooldata_common.cc)
common_flags=(
-std=c++17
-DULAPI
@@ -30,9 +30,9 @@ common_flags=(
)
"$cxx" "${common_flags[@]}" \
"$linuxcnc_root/src/emc/tooldata/tooldata_common.cc" \
core/wasm_shims/tooldata/tooldata_mmap_backend.cc \
core/wasm_shims/tooldata/tooldata_runtime_stubs.cc \
"$tooldata_common_source" \
"$tooldata_mmap_backend_shim" \
"$tooldata_runtime_stubs_shim" \
core/wasm_shims/tooldata/tooldata_probe_main.cc \
-o "$build_dir/tooldata_probe"

View File

@@ -13,6 +13,9 @@ if [[ ! -d "$linuxcnc_root" ]]; then
fi
trap 'rm -rf "$build_dir"' EXIT
tooldata_mmap_backend_shim=$(./list-linuxcnc-wasm-safe-shims.sh tooldata_mmap_backend.cc)
tooldata_mmap_source=$(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-files.sh src/emc/tooldata/tooldata_mmap.cc)
common_flags=(
-std=c++17
-DULAPI
@@ -26,42 +29,36 @@ common_flags=(
)
"$cxx" "${common_flags[@]}" \
-c core/wasm_shims/tooldata/tooldata_mmap_backend.cc \
-c "$tooldata_mmap_backend_shim" \
-o "$build_dir/tooldata_mmap_backend.o"
"$cxx" "${common_flags[@]}" \
-c "$tooldata_mmap_source" \
-o "$build_dir/linuxcnc_tooldata_mmap.o"
nm --defined-only "$build_dir/tooldata_mmap_backend.o" \
| awk '$2 ~ /^[A-Z]$/ {print $3}' \
| LC_ALL=C sort -u \
> "$build_dir/backend.exports"
expected_exports=(
tool_mmap_close
tool_mmap_creator
tool_mmap_is_random_toolchanger
tool_mmap_user
tooldata_find_index_for_tool
tooldata_get
tooldata_last_index_get
tooldata_last_index_set
tooldata_put
tooldata_reset
)
nm --defined-only "$build_dir/linuxcnc_tooldata_mmap.o" \
| awk '$2 ~ /^[A-Z]$/ {print $3}' \
| LC_ALL=C sort -u \
> "$build_dir/linuxcnc.exports"
printf '%s\n' "${expected_exports[@]}" | LC_ALL=C sort -u > "$build_dir/expected.exports"
if ! comm -23 "$build_dir/expected.exports" "$build_dir/backend.exports" > "$build_dir/missing.exports"; then
if ! comm -23 "$build_dir/linuxcnc.exports" "$build_dir/backend.exports" > "$build_dir/missing.exports"; then
exit 1
fi
if [[ -s "$build_dir/missing.exports" ]]; then
echo "missing wasm tooldata mmap backend exports:" >&2
echo "missing wasm tooldata mmap backend exports from LinuxCNC tooldata_mmap.cc:" >&2
cat "$build_dir/missing.exports" >&2
exit 1
fi
comm -13 "$build_dir/expected.exports" "$build_dir/backend.exports" > "$build_dir/unexpected.exports"
comm -13 "$build_dir/linuxcnc.exports" "$build_dir/backend.exports" > "$build_dir/unexpected.exports"
if [[ -s "$build_dir/unexpected.exports" ]]; then
echo "unexpected wasm tooldata mmap backend exports:" >&2
echo "unexpected wasm tooldata mmap backend exports beyond LinuxCNC tooldata_mmap.cc:" >&2
cat "$build_dir/unexpected.exports" >&2
exit 1
fi

View File

@@ -13,6 +13,14 @@ if [[ ! -d "$linuxcnc_root" ]]; then
fi
trap 'rm -rf "$build_dir"' EXIT
tooldata_mmap_backend_shim=$(./list-linuxcnc-wasm-safe-shims.sh tooldata_mmap_backend.cc)
tooldata_runtime_stubs_shim=$(./list-linuxcnc-wasm-safe-shims.sh tooldata_runtime_stubs.cc)
readarray -t linuxcnc_sources < <(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-files.sh \
src/emc/tooldata/tooldata_db.cc \
src/emc/tooldata/tooldata_nml.cc)
tooldata_db_source=${linuxcnc_sources[0]}
tooldata_nml_source=${linuxcnc_sources[1]}
common_flags=(
-std=c++17
-DULAPI
@@ -26,33 +34,49 @@ common_flags=(
)
"$cxx" "${common_flags[@]}" \
-c core/wasm_shims/tooldata/tooldata_runtime_stubs.cc \
-c "$tooldata_runtime_stubs_shim" \
-o "$build_dir/tooldata_runtime_stubs.o"
"$cxx" "${common_flags[@]}" \
-c "$tooldata_mmap_backend_shim" \
-o "$build_dir/tooldata_mmap_backend.o"
"$cxx" "${common_flags[@]}" \
-c "$tooldata_db_source" \
-o "$build_dir/linuxcnc_tooldata_db.o"
"$cxx" "${common_flags[@]}" \
-c "$tooldata_nml_source" \
-o "$build_dir/linuxcnc_tooldata_nml.o"
nm --defined-only "$build_dir/tooldata_runtime_stubs.o" \
| awk '$2 ~ /^[A-Z]$/ {print $3}' \
| LC_ALL=C sort -u \
> "$build_dir/runtime.exports"
expected_exports=(
tool_nml_register
tooldata_db_getall
tooldata_db_init
tooldata_db_notify
)
nm --defined-only "$build_dir/tooldata_mmap_backend.o" \
| awk '$2 ~ /^[A-Z]$/ {print $3}' \
| LC_ALL=C sort -u \
> "$build_dir/backend.exports"
printf '%s\n' "${expected_exports[@]}" | LC_ALL=C sort -u > "$build_dir/expected.exports"
nm --defined-only "$build_dir"/linuxcnc_tooldata_*.o \
| awk '$2 ~ /^[A-Z]$/ {print $3}' \
| LC_ALL=C sort -u \
> "$build_dir/linuxcnc-runtime.exports"
comm -23 "$build_dir/linuxcnc-runtime.exports" "$build_dir/backend.exports" \
> "$build_dir/expected.exports"
comm -23 "$build_dir/expected.exports" "$build_dir/runtime.exports" > "$build_dir/missing.exports"
if [[ -s "$build_dir/missing.exports" ]]; then
echo "missing wasm tooldata runtime stub exports:" >&2
echo "missing wasm tooldata runtime stub exports from LinuxCNC runtime sources:" >&2
cat "$build_dir/missing.exports" >&2
exit 1
fi
comm -13 "$build_dir/expected.exports" "$build_dir/runtime.exports" > "$build_dir/unexpected.exports"
if [[ -s "$build_dir/unexpected.exports" ]]; then
echo "unexpected wasm tooldata runtime stub exports:" >&2
echo "unexpected wasm tooldata runtime stub exports beyond LinuxCNC runtime sources:" >&2
cat "$build_dir/unexpected.exports" >&2
exit 1
fi

View File

@@ -6,47 +6,42 @@ cd "$(dirname "$0")"
cxx=${CXX:-g++}
build_dir=$(mktemp -d "${TMPDIR:-/tmp}/cnc_sim_native.XXXXXX")
trap 'rm -rf "$build_dir"' EXIT
core_source_list="$build_dir/cnc_sim_core_sources.txt"
./list-cnc-sim-core-sources.sh > "$core_source_list"
mapfile -t core_sources < "$core_source_list"
"$cxx" -std=c++17 -I core/include -I core/src \
core/src/canon_event_sink.cpp \
core/src/rtcp_kinematics.cpp \
"${core_sources[@]}" \
core/tests/canon_event_sink_smoke.cpp \
-o "$build_dir/canon_event_sink_smoke"
"$cxx" -std=c++17 -I core/include -I core/src \
core/src/rtcp_kinematics.cpp \
"${core_sources[@]}" \
core/tests/rtcp_kinematics_smoke.cpp \
-o "$build_dir/rtcp_kinematics_smoke"
"$cxx" -std=c++17 -I core/include -I core/src \
core/src/canon_event_sink.cpp \
core/src/rtcp_kinematics.cpp \
core/src/simulator_gcode_controls.cpp \
core/tests/linuxcnc_gees_table_smoke.cpp \
-o "$build_dir/linuxcnc_gees_table_smoke"
"$cxx" -std=c++17 -I core/include -I core/src \
"${core_sources[@]}" \
core/tests/simulator_gcode_controls_smoke.cpp \
-o "$build_dir/simulator_gcode_controls_smoke"
"$cxx" -std=c++17 -I core/include -I core/src \
core/src/canon_event_sink.cpp \
core/src/cnc_sim_api.cpp \
core/src/gcode_backend.cpp \
core/src/rtcp_kinematics.cpp \
core/src/simulator_gcode_controls.cpp \
core/src/smoke_gcode_parser.cpp \
"${core_sources[@]}" \
core/tests/cnc_sim_api_smoke.cpp \
-o "$build_dir/cnc_sim_api_smoke"
"$cxx" -std=c++17 -I core/include -I core/src \
core/src/canon_event_sink.cpp \
core/src/cnc_sim_api.cpp \
core/src/gcode_backend.cpp \
core/src/rtcp_kinematics.cpp \
core/src/simulator_gcode_controls.cpp \
core/src/smoke_gcode_parser.cpp \
"${core_sources[@]}" \
core/tools/cnc_sim_dump.cpp \
-o "$build_dir/cnc_sim_dump"
"$build_dir/canon_event_sink_smoke"
"$build_dir/rtcp_kinematics_smoke"
"$build_dir/linuxcnc_gees_table_smoke"
"$build_dir/simulator_gcode_controls_smoke"
"$build_dir/cnc_sim_api_smoke"
basic_mill_json="$build_dir/cnc_sim_basic_mill.json"

View File

@@ -0,0 +1,3 @@
G21 G90 G17
G41 D1
G98

View File

@@ -0,0 +1,3 @@
G21 G90 G18
G41.1 D1
G71 Q1

View File

@@ -0,0 +1,4 @@
G21 G90 G17
T1
G41 D1
M6

View File

@@ -0,0 +1,3 @@
G21 G90 G17
G41 D1
M66 P0 L0