Commit 8c4c2998 authored by Matthieu Cattin's avatar Matthieu Cattin

pts: remove spec test_path

parent 454f5147
...@@ -44,7 +44,7 @@ def make_zip(zipname, ziplist): ...@@ -44,7 +44,7 @@ def make_zip(zipname, ziplist):
for f in ziplist: for f in ziplist:
z.write(f) z.write(f)
def run_test(testname, logname, yes=False): def run_test(testname, logname, test_path, yes=False):
"""run test testname with output redirected to logname """run test testname with output redirected to logname
If yes is true, assume affirmative answers from the user If yes is true, assume affirmative answers from the user
...@@ -57,7 +57,7 @@ def run_test(testname, logname, yes=False): ...@@ -57,7 +57,7 @@ def run_test(testname, logname, yes=False):
sys.stdin = open('/dev/null') sys.stdin = open('/dev/null')
__builtins__.raw_input = pts_raw_input __builtins__.raw_input = pts_raw_input
mod = __import__(testname, globals(), locals(), []) mod = __import__(testname, globals(), locals(), [])
mod.main(default_directory='./test/spec/python') mod.main(default_directory=test_path)
finally: finally:
sys.stdout.close() sys.stdout.close()
sys.stdout = tmpout sys.stdout = tmpout
...@@ -251,7 +251,7 @@ class Suite(object): ...@@ -251,7 +251,7 @@ class Suite(object):
log.write('------------------------\n') log.write('------------------------\n')
log.write('running test {0} = {1}\n'.format(shortname, test)) log.write('running test {0} = {1}\n'.format(shortname, test))
print 'running test ' + shortname print 'running test ' + shortname
run_test(testname, logname, yes=self.yes) run_test(testname, logname, test_path=self.test_path, yes=self.yes)
except PtsCritical, e: except PtsCritical, e:
print 'test [%s]: critical error, aborting: [%s]' % (shortname, e) print 'test [%s]: critical error, aborting: [%s]' % (shortname, e)
log.write(' critical error in test {0}, exception [{1}]\n'.format(shortname, e)) log.write(' critical error in test {0}, exception [{1}]\n'.format(shortname, e))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment