openscad/tests/cgalstlsanitytest
chrysn 4d18db65e3 python validation for cgal stl sanity test
this drops another static binary and replaces it with a very small
shell^Wpython script (again, python used to avoid sed / grep
implementation differences)
2013-06-28 11:47:17 +02:00

16 lines
334 B
Python
Executable file

#!/usr/bin/env python
import re, sys, subprocess, os
stlfile = sys.argv[3] + '.stl'
subprocess.check_call([sys.argv[2], sys.argv[1], '-o', stlfile])
result = open(stlfile).read()
os.unlink(stlfile)
if 'nan' in result or 'inf' in result:
sys.exit(1)
open(sys.argv[3], 'w').write('') # this check only works on return values