/usr/lib/openscad/testprograms/cgalstlsanitytest is in openscad-testing 2015.03-1+dfsg-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #!/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
|