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/dumptest | |
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/dumptest')
-rwxr-xr-x | tests/dumptest | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/dumptest b/tests/dumptest index 0c60099..f9247c7 100755 --- a/tests/dumptest +++ b/tests/dumptest @@ -1,7 +1,12 @@ -#!/bin/sh +#!/usr/bin/env python -openscad $1 -o $2 +import re, sys, subprocess -sed 's/, timestamp = [0-9]*//' -i $2 +subprocess.check_call([sys.argv[2], sys.argv[1], '-o', sys.argv[3]]) -sed 's/-\?[0-9].[0-9]*e-[0-9]\{2,\}/0/g' -i $2 +result = open(sys.argv[3]).read() + +result = re.sub(r', timestamp = [0-9]*', '', result) +result = re.sub(r'-?[0-9].[0-9]*e-[0-9]{2,}', '0', result) + +open(sys.argv[3], 'w').write(result) |