summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_cmdline_tool.py2
-rwxr-xr-xtests/test_pretty_print.py14
2 files changed, 9 insertions, 7 deletions
diff --git a/tests/test_cmdline_tool.py b/tests/test_cmdline_tool.py
index 848a6eb..967e334 100755
--- a/tests/test_cmdline_tool.py
+++ b/tests/test_cmdline_tool.py
@@ -93,7 +93,7 @@ def compare_png(resultfilename):
compare_method = 'NCC'
msg = 'ImageMagick image comparison: ' + options.convert_exec + ' '+ ' '.join(args[2:])
- msg += '\nexpected image: ' + expectedfilename + '\n'
+ msg += '\n expected image: ' + expectedfilename + '\n'
print >> sys.stderr, msg
if not resultfilename:
print >> sys.stderr, "Error: OpenSCAD did not generate an image to test"
diff --git a/tests/test_pretty_print.py b/tests/test_pretty_print.py
index 7407b15..87ac3df 100755
--- a/tests/test_pretty_print.py
+++ b/tests/test_pretty_print.py
@@ -151,14 +151,14 @@ def parsetest(teststring):
"Test time.*?Test (Passed)", # pass/fail
"Output:(.*?)<end of output>",
'Command:.*?-s" "(.*?)"', # type
- "actual .*?:(.*?)\n",
- "expected .*?:(.*?)\n",
+ "^ actual .*?:(.*?)\n",
+ "^ expected .*?:(.*?)\n",
'Command:.*?(testdata.*?)"' # scadfile
]
hits = map( lambda pattern: ezsearch(pattern,teststring), patterns )
test = Test(hits[0],hits[1],hits[2]=='Passed',hits[3],hits[4],hits[5],hits[6],hits[7],teststring)
- test.actualfile_data = tryread(test.actualfile)
- test.expectedfile_data = tryread(test.expectedfile)
+ if len(test.actualfile) > 0: test.actualfile_data = tryread(test.actualfile)
+ if len(test.actualfile) > 0: test.expectedfile_data = tryread(test.expectedfile)
return test
def parselog(data):
@@ -274,10 +274,12 @@ TESTLOG
wikiname_a = wikify_filename(tmp,wiki_rootpath,sysid)
tmp = t.expectedfile.replace(os.path.dirname(builddir),'')
wikiname_e = wikify_filename(tmp,wiki_rootpath,sysid)
- imgs[wikiname_e] = t.expectedfile_data
+ if hasattr(t, 'expectedfile_data'):
+ imgs[wikiname_e] = t.expectedfile_data
if t.actualfile:
actualfile_wiki = '[[File:'+wikiname_a+'|250px]]'
- imgs[wikiname_a] = t.actualfile_data
+ if hasattr(t, 'actualfile_data'):
+ imgs[wikiname_a] = t.actualfile_data
else:
actualfile_wiki = 'No image generated.'
newchunk = re.sub('FTESTNAME',t.fullname,repeat1)
contact: Jan Huwald // Impressum