shibosoftwaredev/f1c100s-linux-nema17-stepper-controller
A four-layer NEMA 17 motor-controller PCB combining an Allwinner F1C100S Linux computer, USB‑PD/buck power system, W5500 Ethernet, STM32 real-time motion control, DRV8825 stepper driver, protection/temperature/current telemetry, USB interfaces, and local LED/buzzer diagnostics.
- Version
- 0.4.56
- License
- unset
- Stars
- 0
scripts/test-round3-copper-gate.mjs
import fs from "node:fs"
import assert from "node:assert/strict"
import {spawnSync} from "node:child_process"
const path="reports/coil-all-copper-preflight-meta.json"
const original=fs.readFileSync(path),meta=JSON.parse(original)
assert.equal(meta.failureCount,0)
const run=()=>spawnSync(process.execPath,["scripts/verify.mjs"],{encoding:"utf8"})
const results=[]
try {
for(const [name,change,message] of [
["independent copper failure",{failureCount:1},"independent copper clearance must pass"],
["stale circuit audit",{circuitSha256:"invalid"},"independent copper preflight matches this emitted circuit"],
["stale copper geometry",{physicalCopperSha256:"invalid"},"AssertionError"],
]) {
fs.writeFileSync(path,JSON.stringify({...meta,...change},null,2)+"\n")
const test=run()
assert.notEqual(test.status,0,`${name} must fail closed`)
assert.ok((test.stdout+test.stderr).includes(message),`${name} failed for the intended reason`)
results.push({name,failedClosed:true})
}
} finally {fs.writeFileSync(path,original)}
const valid=run()
assert.equal(valid.status,0,valid.stderr)
results.push({name:"actual validated circuit",passes:true})
fs.writeFileSync("reports/round3-copper-gate-tests.json",JSON.stringify(results,null,2)+"\n")
console.log(JSON.stringify(results))