参考所有分组,完成尽量多的内容。禁止顺手扩功能 smoke:锁定浏览器OPFS段名守卫
This commit is contained in:
@@ -160,6 +160,32 @@ for imported_module in (
|
||||
if f'from "{imported_module}"' not in opfs_workspace:
|
||||
print(f"browser smoke OPFS workspace module must import {imported_module}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
required_browser_sections = {
|
||||
"web/test-browser-wasm-smoke-linuxcnc-sections.js": (
|
||||
'runSection("linuxcnc browser basic parse"',
|
||||
'runSection("linuxcnc generated switchkins cases load"',
|
||||
'runSection("linuxcnc browser parse parameter scratch cleanup"',
|
||||
),
|
||||
"web/test-browser-wasm-smoke-opfs-basic-sections.js": (
|
||||
'runSection("opfs program parse and restore"',
|
||||
),
|
||||
"web/test-browser-wasm-smoke-opfs-parameter-sections.js": (
|
||||
'runSection("opfs parameter restore in new instance"',
|
||||
'runSection("opfs default parameter backup"',
|
||||
'runSection("opfs invalid parameter restore failures"',
|
||||
'runSection("opfs stale parameter state cleanup"',
|
||||
),
|
||||
"web/test-browser-wasm-smoke-app-sections.js": (
|
||||
'runSection("browser app opfs save"',
|
||||
'runSection("browser app opfs restore"',
|
||||
),
|
||||
}
|
||||
for section_module, required_sections in required_browser_sections.items():
|
||||
section_text = Path(section_module).read_text(encoding="utf-8")
|
||||
for required_section in required_sections:
|
||||
if required_section not in section_text:
|
||||
print(f"browser smoke module {section_module} missing required section {required_section}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
app_html = Path("web/index.html").read_text(encoding="utf-8")
|
||||
if '<link rel="stylesheet" href="/styles.css" />' not in app_html:
|
||||
print("browser app HTML must load /styles.css", file=sys.stderr)
|
||||
|
||||
Reference in New Issue
Block a user