code wiki / (root) / nx_wflow_evidence_canonical_gate_t230.nx

nx_wflow_evidence_canonical_gate_t230.nx source

↩ module page · 25 lines · 1200 B

1import "nx_wflow_engine.nx" 2func main() -> i64 { 3 let cx: *i64=sys_mmap(64) as *i64 4 let steps: *i64=sys_mmap(16) as *i64 5 let flows: *i64=sys_mmap(8) as *i64 6 flows[0]="release|event|-" as *u8 as i64 7 steps[0]="release|1|probe-fail|-|1|3" as *u8 as i64 8 steps[1]="release|2|probe-fail|-|1|1" as *u8 as i64 9 cx[0]=steps as i64;cx[1]=2;cx[2]="/tmp" as *u8 as i64;cx[3]=0;cx[4]=1 10 var bad: i64=0 11 if wf_run_from(cx,"fail","release",0)!=WF_EVIDENCE_ERROR {bad=bad+1} 12 if wf_fire(cx,flows,1,"event~id=fail")>=0 {bad=bad+1} 13 if wf_resume(cx)>=0 {bad=bad+1} 14 if wf_bind_event(cx,"fail","event~id=fail")!=WF_EVIDENCE_ERROR {bad=bad+1} 15 if wf_run_from(cx,"fail","release",2)!=WF_EVIDENCE_ERROR {bad=bad+1} 16 steps[0]="release|1|set-var|-|x=yes|1" as *u8 as i64 17 if wf_run_from(cx,"fail","release",0)!=WF_EVIDENCE_ERROR {bad=bad+1} 18 steps[0]="release|1|approve|reviewer|inspection|1" as *u8 as i64 19 if wf_run_from(cx,"fail","release",0)!=WF_EVIDENCE_ERROR {bad=bad+1} 20 if wf_append("/dev/full","WFTEST\n")!=WF_EVIDENCE_ERROR {bad=bad+1} 21 if wf_append("/dev/null","WFTEST\n")!=WF_EVIDENCE_ERROR {bad=bad+1} 22 p("EVIDENCE-FAILURE checks=9 failures=");pn(bad);p("\n") 23 if bad!=0 {return 1} 24 return wf_selftest() 25}