diff: remove /tmp/test_mercury$$ after testing.

Tyson Dowd trd at cs.mu.OZ.AU
Thu Jun 4 13:37:33 AEST 1998


Hi,

I got sick of /tmp/test_mercury$$ clogging up /tmp for no good reason.

===================================================================


Estimated hours taken: 0.5

Remove temporary files after running tests.

tools/run_all_tests_from_cron:
	Remove /tmp/test_mercury$$ after testing is finished.


Index: tools/run_all_tests_from_cron
===================================================================
RCS file: /home/staff/zs/imp/mercury/tools/run_all_tests_from_cron,v
retrieving revision 1.11
diff -u -t -r1.11 run_all_tests_from_cron
--- run_all_tests_from_cron	1998/05/27 23:33:46	1.11
+++ run_all_tests_from_cron	1998/06/04 03:33:32
@@ -57,9 +57,10 @@
 CVSROOT=/home/staff/zs/imp
 export CVSROOT
 
+tmpscript=/tmp/test_mercury$$
 cd /home/mercury/public/test_mercury/scripts;
 cvs checkout mercury/tools/test_mercury
-cp mercury/tools/test_mercury /tmp/test_mercury$$
+cp mercury/tools/test_mercury $tmpscript
 
 #-----------------------------------------------------------------------------#
 
@@ -68,13 +69,13 @@
 mv -f $tm_dir/logs/test_mercury_$HOST.out $tm_dir/logs/old 2>/dev/null
 
 tmpfile=/tmp/run_test$$
-trap 'rm -f $tmpfile; exit 1' 1 2 3 13 15
+trap 'rm -f $tmpfile $tmpscript; exit 1' 1 2 3 13 15
 {
 echo Subject: Mercury auto-test on $HOST
 echo
 logfile=$tm_dir/logs/test_mercury_$HOST.out
 
-if nice -5 sh /tmp/test_mercury$$ $HOST $ARCH $FULLARCH \
+if nice -5 sh $tmpscript $HOST $ARCH $FULLARCH \
                 > $logfile 2>&1
 then
         echo test passed
@@ -102,20 +103,21 @@
 # NB we can't just pipe into $mail, because $mail times out while
 # waiting for the message.  So we need to use a temp file.
 $mail fjh < $tmpfile
-rm -f $tmpfile
+rm -f $tmpfile $tmpscript
 
 #-----------------------------------------------------------------------------#
 
 case $HOST in murlibobo)
+        tmpscript=/tmp/install_webpage$$
+
         cd /home/mercury/public/test_mercury/scripts;
         cvs checkout mercury/tools/install_webpage
-        cp mercury/tools/install_webpage /tmp/install_webpage$$
+        cp mercury/tools/install_webpage $tmpscript
 
-        tmpfile=/tmp/install_webpage$$
-        trap 'rm -f $tmpfile; exit 1' 1 2 3 13 15
+        trap 'rm -f $tmpscript; exit 1' 1 2 3 13 15
 
-        /tmp/install_webpage$$
-        rm -f $tmpfile
+        $tmpscript
+        rm -f $tmpscript
         ;;
 esac
 


-- 
       Tyson Dowd           # There isn't any reason why Linux can't be
                            # implemented as an enterprise computing solution.
     trd at cs.mu.oz.au        # Find out what you've been missing while you've
http://www.cs.mu.oz.au/~trd # been rebooting Windows NT. -- InfoWorld, 1998.



More information about the developers mailing list