File: test

package info (click to toggle)
linuxcnc 1%3A2.9.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 285,604 kB
  • sloc: python: 202,568; ansic: 109,036; cpp: 99,239; tcl: 16,054; xml: 10,631; sh: 10,303; makefile: 1,255; javascript: 138; sql: 72; asm: 15
file content (24 lines) | stat: -rwxr-xr-x 703 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python3
import glob, os, sys, filecmp

fail = 0
for t in sorted(glob.glob('*.ngc')):
    sys.stderr.write("#".format(t))
    p = os.popen("rs274 -g %s 2>&1 > %s.out " % (t, t))
    output = p.readlines()
    r = p.close()
    out_file = t + ".out"
    expected_file = t + ".expected"
    if r != None:
        print("%s: Interpreter reported an error with the gcode" % t)
        print(output)
        fail += 1
        continue
    if not filecmp.cmp(out_file, expected_file):
        print("%s: Interpreter output is unexpected:" % t)
        os.system('diff -u %s %s' % (expected_file, out_file))
        fail += 1
        continue

if fail:
    raise SystemExit("%d failures" % fail)