按建议,继续完成后续工作

结论:已新增 host/WASM/browser 聚合 smoke 验证入口,一次构建 INI WASM 后串行覆盖 Node WASM、OPFS mock 和 Chromium browser smoke,并同步更新验证与漂移文档。
This commit is contained in:
2026-06-08 03:21:53 +08:00
parent cb1901d4c4
commit 1f6d5a8e8b
6 changed files with 31 additions and 3 deletions

View File

@@ -30,6 +30,12 @@ The current browser smoke validation command is:
wasm-port/tests/browser/verify_ini_panel_browser.sh wasm-port/tests/browser/verify_ini_panel_browser.sh
``` ```
The current aggregate host/WASM/browser smoke command is:
```bash
wasm-port/tests/host/verify_host_smokes.sh
```
## Validation Chain ## Validation Chain
The native validation script runs these checks in order: The native validation script runs these checks in order:
@@ -68,6 +74,9 @@ headless against a test page that imports the JS SDK, loads the INI WASM
module, queries vendored LinuxCNC INI parsing through the SDK, and performs an module, queries vendored LinuxCNC INI parsing through the SDK, and performs an
OPFS text-file round trip. OPFS text-file round trip.
The aggregate host smoke script builds the INI WASM artifact once, then runs
the Node WASM smoke, the Node OPFS mock smoke, and the Chromium browser smoke.
## Source Coverage ## Source Coverage
Every `.c` and `.cc` entry in `tools/source-manifest.txt` must have a Every `.c` and `.cc` entry in `tools/source-manifest.txt` must have a
@@ -117,6 +126,7 @@ The validation fails if:
| `tests/wasm/node/verify_ini_wasm.sh` | Validates the browser-facing INI WASM module can be built from vendored LinuxCNC `inifile.cc`, loaded through the JS SDK in Node, and queried through the exported C ABI. | | `tests/wasm/node/verify_ini_wasm.sh` | Validates the browser-facing INI WASM module can be built from vendored LinuxCNC `inifile.cc`, loaded through the JS SDK in Node, and queried through the exported C ABI. |
| `tests/opfs/node/verify_file_service.sh` | Validates the host-owned OPFS text-file adapter used by the browser INI panel without moving file persistence into the WASM core. | | `tests/opfs/node/verify_file_service.sh` | Validates the host-owned OPFS text-file adapter used by the browser INI panel without moving file persistence into the WASM core. |
| `tests/browser/verify_ini_panel_browser.sh` | Validates the INI SDK, WASM module loading, and OPFS text-file round trip in a real browser runtime. | | `tests/browser/verify_ini_panel_browser.sh` | Validates the INI SDK, WASM module loading, and OPFS text-file round trip in a real browser runtime. |
| `tests/host/verify_host_smokes.sh` | Runs the current host-side Node, WASM, OPFS, and browser smoke validation with a single INI WASM build. |
## Fixture Coverage ## Fixture Coverage

View File

@@ -62,6 +62,9 @@ semantic rewrites:
vendored LinuxCNC `inifile.cc`. vendored LinuxCNC `inifile.cc`.
- OPFS validation covers a Node mock of the file-service adapter and a - OPFS validation covers a Node mock of the file-service adapter and a
Chromium localhost round trip for INI text-file persistence. Chromium localhost round trip for INI text-file persistence.
- Host-side smoke validation is aggregated by
`tests/host/verify_host_smokes.sh` so Node, WASM, OPFS, and browser checks
run from one command.
- Identity/trivial, `5axiskins`, TRT `xyzac`/`xyzbc`, delta, SCARA, PUMA, - Identity/trivial, `5axiskins`, TRT `xyzac`/`xyzbc`, delta, SCARA, PUMA,
serial, hexapod, pentapod, and related kinematics sources now have native serial, hexapod, pentapod, and related kinematics sources now have native
source-probe coverage. source-probe coverage.

View File

@@ -31,7 +31,7 @@ Current validation is intentionally mechanical:
| Capability | LinuxCNC source files | Port classification | Standalone boundary | Current validation | | Capability | LinuxCNC source files | Port classification | Standalone boundary | Current validation |
| --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- |
| INI parsing | `src/emc/ini/inifile.cc`, `inifile.h`, `inifile.hh` | Copy unchanged | Native file IO remains LinuxCNC-style in the vendored parser; browser OPFS integration remains outside this layer; `runtime/sdk/src/linuxcnc-ini.js` only wraps the exported WASM C ABI | Vendor byte sync, `linuxcnc_ini_probe`, `linuxcnc_inifile_source_probe`, `tests/wasm/node/verify_ini_wasm.sh`, `tests/browser/verify_ini_panel_browser.sh` | | INI parsing | `src/emc/ini/inifile.cc`, `inifile.h`, `inifile.hh` | Copy unchanged | Native file IO remains LinuxCNC-style in the vendored parser; browser OPFS integration remains outside this layer; `runtime/sdk/src/linuxcnc-ini.js` only wraps the exported WASM C ABI | Vendor byte sync, `linuxcnc_ini_probe`, `linuxcnc_inifile_source_probe`, `tests/wasm/node/verify_ini_wasm.sh`, `tests/browser/verify_ini_panel_browser.sh`, `tests/host/verify_host_smokes.sh` |
| RTAPI compatibility headers | `src/rtapi/rtapi_*.h` in the manifest | Copy unchanged plus standalone shim include path | `runtime/core/shims/rtapi.h` supplies the minimal standalone RTAPI surface needed by vendored code | Vendor byte sync, compile coverage through dependent source probes | | RTAPI compatibility headers | `src/rtapi/rtapi_*.h` in the manifest | Copy unchanged plus standalone shim include path | `runtime/core/shims/rtapi.h` supplies the minimal standalone RTAPI surface needed by vendored code | Vendor byte sync, compile coverage through dependent source probes |
| Canon/NML-facing interpreter types | `src/emc/nml_intf/canon*.hh`, `emctool.h`, `interp_return.hh`, `motion_types.h`, `emcpose.*`, `emcpos.h`, `debugflags.h`, `src/emc/linuxcnc.h` | Copy unchanged plus narrow standalone status shim | NML transport is not ported; `runtime/core/shims/nml_intf/emc.hh` exposes only the `emcStatus` machine-units status edge currently needed by vendored interpreter conversion and initialization code | Vendor byte sync, dependent source probes, `linuxcnc_emc_status_probe`, `linuxcnc_tp_api_probe`, interpreter harnesses | | Canon/NML-facing interpreter types | `src/emc/nml_intf/canon*.hh`, `emctool.h`, `interp_return.hh`, `motion_types.h`, `emcpose.*`, `emcpos.h`, `debugflags.h`, `src/emc/linuxcnc.h` | Copy unchanged plus narrow standalone status shim | NML transport is not ported; `runtime/core/shims/nml_intf/emc.hh` exposes only the `emcStatus` machine-units status edge currently needed by vendored interpreter conversion and initialization code | Vendor byte sync, dependent source probes, `linuxcnc_emc_status_probe`, `linuxcnc_tp_api_probe`, interpreter harnesses |
| Motion state headers | `src/emc/motion/state_tag.h`, `emcmotcfg.h`, `simple_tp.h`, `motion.h`, `mot_priv.h`, `axis.h` | Copy unchanged | Realtime motion process is not ported; standalone probes seed the small motion status/config state required by TP calls | Vendor byte sync, `linuxcnc_tp_api_probe` | | Motion state headers | `src/emc/motion/state_tag.h`, `emcmotcfg.h`, `simple_tp.h`, `motion.h`, `mot_priv.h`, `axis.h` | Copy unchanged | Realtime motion process is not ported; standalone probes seed the small motion status/config state required by TP calls | Vendor byte sync, `linuxcnc_tp_api_probe` |

View File

@@ -9,7 +9,9 @@ if [[ -z "$CHROMIUM" ]]; then
exit 1 exit 1
fi fi
if [[ "${SKIP_INI_BUILD:-0}" != "1" ]]; then
"$ROOT_DIR/tools/build_ini_panel.sh" "$ROOT_DIR/tools/build_ini_panel.sh"
fi
TMP_DIR="$(mktemp -d)" TMP_DIR="$(mktemp -d)"
PORT_FILE="$TMP_DIR/port" PORT_FILE="$TMP_DIR/port"

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "$0")/../.." && pwd)"
"$ROOT_DIR/tools/build_ini_panel.sh"
SKIP_INI_BUILD=1 "$ROOT_DIR/tests/wasm/node/verify_ini_wasm.sh"
"$ROOT_DIR/tests/opfs/node/verify_file_service.sh"
SKIP_INI_BUILD=1 "$ROOT_DIR/tests/browser/verify_ini_panel_browser.sh"
echo "host_wasm_opfs_browser_smokes=ok"

View File

@@ -3,5 +3,7 @@ set -euo pipefail
ROOT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)" ROOT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)"
if [[ "${SKIP_INI_BUILD:-0}" != "1" ]]; then
"$ROOT_DIR/tools/build_ini_panel.sh" "$ROOT_DIR/tools/build_ini_panel.sh"
fi
node "$ROOT_DIR/tests/wasm/node/verify_ini_wasm.mjs" node "$ROOT_DIR/tests/wasm/node/verify_ini_wasm.mjs"