test.py
changeset 5481 de01c67af975
parent 5470 d3aabb63dd12
child 5483 ad83d869c08c
--- a/test.py	Wed Nov 04 21:08:32 2009 -0800
+++ b/test.py	Thu Nov 05 19:14:37 2009 -0800
@@ -616,6 +616,7 @@
         self.shell_command = ""
         self.display_name = ""
         self.basedir = ""
+        self.tempdir = ""
         self.cwd = ""
         self.tmp_file_name = ""
         self.returncode = False
@@ -674,6 +675,13 @@
         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
     # to write all of the pcap files that we will be carefully ignoring.  For
@@ -766,7 +774,8 @@
                     # 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 @@
             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 @@
                         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 @@
         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: