changeset 3898:498652ebb0df

[project @ 2002-04-12 16:10:13 by jwe]
author jwe
date Fri, 12 Apr 2002 16:10:13 +0000
parents efa508da7d5c
children 8fe3fdf1fa42
files test/ChangeLog test/config/unix.exp
diffstat 2 files changed, 32 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/test/ChangeLog	Thu Apr 11 21:24:49 2002 +0000
+++ b/test/ChangeLog	Fri Apr 12 16:10:13 2002 +0000
@@ -1,3 +1,8 @@
+2002-04-12  Kienzle <pkienzle@jazz.ncnr.nist.gov>
+
+	* config/unix.exp: Allow running of individual tests with
+	"runtest *.exp" from any of the directories under test/octave.test.
+
 2002-04-02  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* octave.test/linalg/qr-7.m: New test.
--- a/test/config/unix.exp	Thu Apr 11 21:24:49 2002 +0000
+++ b/test/config/unix.exp	Fri Apr 12 16:10:13 2002 +0000
@@ -1,5 +1,27 @@
 # Some global definitions.
 
+if ![info exists OCTAVE ] then {
+  set OCTAVE [pwd]
+  set tail [string last /test/ $OCTAVE]
+  if { $tail < 0 } {
+    error "run test from in the test directory"
+    exit 1;  
+  }
+  set OCTAVE [string replace $OCTAVE $tail end /src/octave]
+}
+
+if ![info exists OCTAVE_SCRIPT_PATH ] then {
+  set OSPATH "[pwd]"
+  set tail [string last /test/ $OSPATH]
+  if { $tail < 0 } {
+    error "run test from in the test directory"
+    exit 1;
+  }
+  set OSPATH "-p '[string replace $OSPATH $tail end /scripts//]:[string replace $OSPATH $tail end /src]'"
+} else {
+  set OSPATH "-p $OCTAVE_SCRIPT_PATH"
+}
+
 if ![info exists prompt] then {
   set prompt "octave:\[0-9\]*> "
 }
@@ -43,7 +65,7 @@
 
 proc octave_interactive_start { } {
   global OCTAVE
-  global OCTAVE_SCRIPT_PATH
+  global OSPATH
   global prompt
   global nl
   global resync
@@ -59,11 +81,7 @@
 # the timeout period at a minute for the real tests.
 
   set timeout 60
-  if [ llength $OCTAVE_SCRIPT_PATH ] {
-    spawn $OCTAVE -f -q -p $OCTAVE_SCRIPT_PATH
-  } else {
-    spawn $OCTAVE -f -q
-  }
+  spawn $OCTAVE -f -q $OSPATH
 
   set timeout 5
   expect {
@@ -109,26 +127,19 @@
 
 proc octave_start { src_file } {
   global OCTAVE
-  global OCTAVE_SCRIPT_PATH
+  global OSPATH
   global oct_output
 
-  set OSPATH $OCTAVE_SCRIPT_PATH
-
-  if ![info exists OSPATH] then {
-    set OSPATH ""
-  }
-
 # Can't seem to get 2>&1 to work without using /bin/sh -c ""...
 
-  send_log "EXEC: $OCTAVE -f -q -p $OSPATH $src_file\n"
-  catch "exec /bin/sh -c \"$OCTAVE -f -q -p $OSPATH $src_file 2>&1\"" oct_output
+  send_log "EXEC: $OCTAVE -f -q $OSPATH $src_file\n"
+  catch "exec /bin/sh -c \"$OCTAVE -f -q $OSPATH $src_file 2>&1\"" oct_output
 }
 
 # do_test -- run a test given by the file $src_code.
 
 proc do_test { src_code } {
   global OCTAVE
-  global OCTAVE_SCRIPT_PATH
   global srcdir
   global subdir
   global spawn_id