diff options
author | chrysn <chrysn@fsfe.org> | 2013-06-28 08:50:48 (GMT) |
---|---|---|
committer | chrysn <chrysn@fsfe.org> | 2013-06-28 08:50:48 (GMT) |
commit | 28e420d8712a73e66db328cdb80a8b09f6f9a0b4 (patch) | |
tree | 0945dd904b915407f46be6b53d99ec6561566af2 /tests/echotest | |
parent | ad1a11a28edd85354c3ef5386961d5cee6a19185 (diff) |
replace echotest and dumptest with python scripts
this solves problems of sed compatibility on different platoforms.
also, the openscad binary to use is now passed in from the ctest script.
Diffstat (limited to 'tests/echotest')
-rwxr-xr-x | tests/echotest | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/echotest b/tests/echotest index 9e29878..bad382c 100755 --- a/tests/echotest +++ b/tests/echotest @@ -1,5 +1,9 @@ -#!/bin/sh +#!/usr/bin/env python -openscad $1 -o null 2> $2 +import re, sys, subprocess -sed 's/-\?[0-9].[0-9]*e-[0-9]\{2,\}/0/g' -i $2 +result = subprocess.check_output([sys.argv[2], sys.argv[1], '-o', 'null'], stderr=subprocess.STDOUT) + +result = re.sub(r'-?[0-9].[0-9]*e-[0-9]{2,}', '0', result) + +open(sys.argv[3], 'w').write(result) |