pass explicit temp directory to test suites
This commit is contained in:
14
test.py
14
test.py
@@ -616,6 +616,7 @@ class Job:
|
||||
self.shell_command = ""
|
||||
self.display_name = ""
|
||||
self.basedir = ""
|
||||
self.tempdir = ""
|
||||
self.cwd = ""
|
||||
self.tmp_file_name = ""
|
||||
self.returncode = False
|
||||
@@ -673,6 +674,13 @@ class Job:
|
||||
def set_basedir(self, basedir):
|
||||
self.basedir = basedir
|
||||
|
||||
#
|
||||
# This is the directory to which a running test suite should write any
|
||||
# temporary files.
|
||||
#
|
||||
def set_tempdir(self, tempdir):
|
||||
self.tempdir = tempdir
|
||||
|
||||
#
|
||||
# This is the current working directory that will be given to an executing
|
||||
# test as it is being run. It will be used for examples to tell them where
|
||||
@@ -766,7 +774,8 @@ class worker_thread(threading.Thread):
|
||||
# file name
|
||||
#
|
||||
(job.returncode, standard_out, standard_err, et) = run_job_synchronously(job.shell_command +
|
||||
" --basedir=%s --out=%s" % (job.basedir, job.tmp_file_name), job.cwd, options.valgrind)
|
||||
" --basedir=%s --tempdir=%s --out=%s" % (job.basedir, job.tempdir, job.tmp_file_name),
|
||||
job.cwd, options.valgrind)
|
||||
|
||||
job.set_elapsed_time(et)
|
||||
|
||||
@@ -1004,6 +1013,7 @@ def run_tests():
|
||||
job.set_tmp_file_name(os.path.join(testpy_output_dir, "%s.xml" % test))
|
||||
job.set_cwd(os.getcwd())
|
||||
job.set_basedir(os.getcwd())
|
||||
job.set_tempdir(testpy_output_dir)
|
||||
if (options.multiple):
|
||||
multiple = " --multiple"
|
||||
else:
|
||||
@@ -1074,6 +1084,7 @@ def run_tests():
|
||||
job.set_tmp_file_name("")
|
||||
job.set_cwd(testpy_output_dir)
|
||||
job.set_basedir(os.getcwd())
|
||||
job.set_tempdir(testpy_output_dir)
|
||||
job.set_shell_command("examples/%s" % test)
|
||||
|
||||
if options.valgrind and not eval(do_valgrind_run):
|
||||
@@ -1097,6 +1108,7 @@ def run_tests():
|
||||
job.set_tmp_file_name("")
|
||||
job.set_cwd(testpy_output_dir)
|
||||
job.set_basedir(os.getcwd())
|
||||
job.set_tempdir(testpy_output_dir)
|
||||
job.set_shell_command("examples/%s" % options.example)
|
||||
|
||||
if options.verbose:
|
||||
|
||||
Reference in New Issue
Block a user