def fail(msg):
SYS.stderr.write("%s: FAILED: %s\n" % (PROG, msg))
- SYS.stderr.write("%s: step = %d\n" % (PROG, STEP))
+ SYS.stderr.write("%s: step = %d\n" % (PROG, CSTEP))
KID.stdin.close()
KID.stdout.close()
rc = KID.wait()
put("= %s\n" % ST.cur.tree)
dump_tree()
-STEP = 0; nsteps = OPTS.nsteps
+STEP = CSTEP = 0; nsteps = OPTS.nsteps
ch = choices()
while nsteps is None or STEP < nsteps:
- if OPTS.sync: SYS.stdout.write("\n;; step %d\n" % STEP)
+ if OPTS.sync: SYS.stdout.write("\n;; step %d\n" % CSTEP)
op = ch.choose(ST.rand)
if op == "addrm1":
else:
raise ValueError("unexpected operation `%s'" % op)
- STEP += 1
+ STEP += 1; CSTEP += 1
dump_tree()
- if OPTS.sync or STEP == OPTS.ckpt_steps: check_tree()
- if STEP == OPTS.ckpt_steps:
+ if OPTS.sync or CSTEP == OPTS.ckpt_steps: check_tree()
+ if CSTEP == OPTS.ckpt_steps:
snapshot()
ST.write_ckpt()
- STEP = 0; OPTS.sync = False
- if nsteps is not None: nsteps -= OPTS.ckpt_steps
+ CSTEP = 0; OPTS.sync = False
while True:
check_tree()