Skip to content
Snippets Groups Projects
Commit 259e627b authored by Craig Tiller's avatar Craig Tiller
Browse files

Fix sanity

parent 01413564
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
import glob import glob
import os import os
import shutil
import sys import sys
import tempfile import tempfile
sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '..', 'run_tests')) sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '..', 'run_tests'))
...@@ -76,5 +77,9 @@ jobset.run(jobs) ...@@ -76,5 +77,9 @@ jobset.run(jobs)
if test is not None: if test is not None:
for s, g in test.iteritems(): for s, g in test.iteritems():
assert(0 == os.system('diff %s %s' % (s, g))) if os.path.isfile(g):
os.unlink(g) assert(0 == os.system('diff %s %s' % (s, g)))
os.unlink(g)
else:
assert(0 == os.system('diff -r %s %s' % (s, g)))
shutil.rmtree(g, ignore_errors=True)
...@@ -135,7 +135,12 @@ def main(argv): ...@@ -135,7 +135,12 @@ def main(argv):
# we have optional control data: this template represents # we have optional control data: this template represents
# a directory # a directory
if not cleared_dir: if not cleared_dir:
shutil.rmtree(output_name, ignore_errors=True) if not os.path.exists(output_name):
pass
elif os.path.isfile(output_name):
os.unlink(output_name)
else:
shutil.rmtree(output_name, ignore_errors=True)
cleared_dir = True cleared_dir = True
items = [] items = []
if 'foreach' in src: if 'foreach' in src:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment