aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRob Savoye <rob@welcomehome.org>2003-03-17 02:25:05 +0000
committerRob Savoye <rob@welcomehome.org>2003-03-17 02:25:05 +0000
commit4306dace39d6628ca4105c672b1497c3c75ee745 (patch)
treef5a8e016dc94c65d51f49b16cfeb7ccf44f353fe /lib
parentfcec39f2fe9f5a28065086273464e7a589194969 (diff)
downloaddejagnu-4306dace39d6628ca4105c672b1497c3c75ee745.zip
dejagnu-4306dace39d6628ca4105c672b1497c3c75ee745.tar.gz
dejagnu-4306dace39d6628ca4105c672b1497c3c75ee745.tar.bz2
2003-03-16 Rob Savoye <rob@direwolf.welcomehome.org>
* lib/unix.exp: Preservce the value of LD_LIBRARY_PATH, rather than stomp on it. This is based on a patch from Brendan Conoboy <blc@redhat.com>. * Most files: Update copyright dates. 2003-03-13 Mike Stump <mrs@apple.com> * lib/dg.exp(dg-test): Add compiler flags to testcase name, to help ensure uniqueness. 2003-03-05 Alexandre Oliva <aoliva@redhat.com> * lib/remote.exp (standard_download, standard_upload): Support nfsdir and nfsroot_server. 2001-11-12 Andrew Cagney <ac131313@redhat.com> * lib/remote.exp (local_exec, standard_close): Use SHELL background instead of tcl background to background the kill processes. Work around problem found by Nick Duffek in older CYGWINs. (migrated from Redhat's sources kind late, sorry)
Diffstat (limited to 'lib')
-rw-r--r--lib/debugger.exp2
-rwxr-xr-xlib/dejagnu.exp21
-rw-r--r--lib/dg.exp10
-rw-r--r--lib/framework.exp2
-rw-r--r--lib/ftp.exp2
-rw-r--r--lib/kermit.exp2
-rw-r--r--lib/libgloss.exp18
-rw-r--r--lib/mondfe.exp2
-rw-r--r--lib/remote.exp96
-rw-r--r--lib/rlogin.exp2
-rw-r--r--lib/rsh.exp2
-rw-r--r--lib/standard.exp2
-rw-r--r--lib/target.exp2
-rw-r--r--lib/targetdb.exp2
-rw-r--r--lib/telnet.exp2
-rw-r--r--lib/tip.exp2
-rw-r--r--lib/util-defs.exp2
-rw-r--r--lib/utils.exp2
-rw-r--r--lib/xsh.exp2
19 files changed, 137 insertions, 38 deletions
diff --git a/lib/debugger.exp b/lib/debugger.exp
index edf8543..b9fc27f 100644
--- a/lib/debugger.exp
+++ b/lib/debugger.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1992 - 2002 Free Software Foundation, Inc.
+# Copyright (C) 1992 - 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/dejagnu.exp b/lib/dejagnu.exp
index c85b54e..680716e 100755
--- a/lib/dejagnu.exp
+++ b/lib/dejagnu.exp
@@ -1,3 +1,24 @@
+# Copyright (C) 1992 - 2001, 2002, 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-dejagnu@gnu.org
+
+# This file was written by Rob Savoye. (rob@welcomehome.org)
+
# a hairy pattern to recognize text
set text "\[- A-Za-z0-9\.\;\"\_\:\'\`\(\)\!\#\=\+\?\&\*]"
diff --git a/lib/dg.exp b/lib/dg.exp
index 4f6e300..3bcc514 100644
--- a/lib/dg.exp
+++ b/lib/dg.exp
@@ -1,5 +1,5 @@
# `dg' general purpose testcase driver.
-# Copyright (C) 1994 - 2002 Free Software Foundation, Inc.
+# Copyright (C) 1994 - 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -653,8 +653,14 @@ proc dg-test { args } {
set name "[file tail [file dirname $prog]]/[file tail $prog]"
}
+ # We append the compilation flags, if any, to ensure that the test case
+ # names are unique.
+ if { "$tool_flags" != "" } {
+ set name "$name $tool_flags"
+ }
+
# Process any embedded dg options in the testcase.
-
+
# Use "" for the second element of dg-do-what so we can tell if it's been
# explicitly set to "S".
set dg-do-what [list ${dg-do-what-default} "" P]
diff --git a/lib/framework.exp b/lib/framework.exp
index 4aaf0ae..8aa0641 100644
--- a/lib/framework.exp
+++ b/lib/framework.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1992 - 2002 Free Software Foundation, Inc.
+# Copyright (C) 1992 - 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/ftp.exp b/lib/ftp.exp
index c59c3df..c9f5629 100644
--- a/lib/ftp.exp
+++ b/lib/ftp.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1992 - 2002 Free Software Foundation, Inc.
+# Copyright (C) 1992 - 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/kermit.exp b/lib/kermit.exp
index 8cc1024..cd4e9d9 100644
--- a/lib/kermit.exp
+++ b/lib/kermit.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1992 - 2002 Free Software Foundation, Inc.
+# Copyright (C) 1992 - 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/libgloss.exp b/lib/libgloss.exp
index c2957c2..9497f0d 100644
--- a/lib/libgloss.exp
+++ b/lib/libgloss.exp
@@ -1,6 +1,5 @@
-# Copyright (C) 1992 - 2001, 2002
-# Free Software Foundation, Inc.
-
+# Copyright (C) 1992 - 2002, 2003 Free Software Foundation, Inc.
+#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@@ -18,7 +17,8 @@
# Please email any bugs, comments, and/or additions to this file to:
# bug-dejagnu@prep.ai.mit.edu
-# This file was written by Rob Savoye. (rob@cygnus.com) (now rob@welcomehome.org)
+# This file was written by Rob Savoye. (rob@cygnus.com)
+# (now rob@welcomehome.org)
# this contains a list of gcc options and their respective directories.
@@ -433,10 +433,14 @@ proc get_multilibs { args } {
return "";
}
- if { [board_info $target_board exists multilib_flags] } {
- set mopts [board_info $target_board multilib_flags];
+ if { [llength $args] > 0 } {
+ set mopts [lindex $args 0];
} else {
- set mopts ""
+ if { [board_info $target_board exists multilib_flags] } {
+ set mopts [board_info $target_board multilib_flags];
+ } else {
+ set mopts ""
+ }
}
set default_multilib [exec $compiler --print-multi-lib]
diff --git a/lib/mondfe.exp b/lib/mondfe.exp
index 023f87e..add4597 100644
--- a/lib/mondfe.exp
+++ b/lib/mondfe.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1992 - 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1992 - 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/remote.exp b/lib/remote.exp
index 1f07512..7a1db84 100644
--- a/lib/remote.exp
+++ b/lib/remote.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1992 - 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1992 - 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -179,7 +179,10 @@ proc local_exec { commandline inp outp timeout } {
# command in order to execute the execution. (English. Gotta love it.)
if { ! $got_eof } {
verbose "killing $pid $pgid";
- exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill -15 $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid)" &;
+ # This is very, very nasty. SH, instead of EXPECT, is used to
+ # run this in the background since, on older CYGWINs, a
+ # strange file I/O error occures.
+ exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill -15 $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid) &";
}
# This will hang if the kill doesn't work. Nothin' to do, and it's not ok.
catch "close -i $spawn_id";
@@ -212,7 +215,7 @@ proc local_exec { commandline inp outp timeout } {
}
verbose "output is $output";
if { $outp == "" } {
- return [list $status $output];
+ return [list $status $output];
} else {
return [list $status ""];
}
@@ -314,10 +317,11 @@ proc standard_close { host } {
}
if { $pid > 0 } {
verbose "doing kill, pid is $pid";
- # This is very, very nasty. Then again, if after did something
- # reasonable...
+ # This is very, very nasty. SH, instead of EXPECT, is used
+ # to run this in the background since, on older CYGWINs, a
+ # strange file I/O error occures.
set pgid "-[join $pid { -}]";
- exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid)" &;
+ exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid) &";
}
verbose "pid is $pid";
catch "close -i $shell_id";
@@ -407,7 +411,42 @@ proc remote_download { dest file args } {
#
proc standard_download {dest file destfile} {
- return [rsh_download $dest $file $destfile];
+ set orig_destfile $destfile
+
+ if [board_info $dest exists nfsdir] {
+ set destdir [board_info $dest nfsdir]
+ if [board_info $dest exists nfsroot_server] {
+ set dest [board_info $dest nfsroot_server];
+ } else {
+ set dest "";
+ }
+ set destfile "$destdir/$destfile";
+ }
+
+ if { "$dest" != "" } {
+ set result [rsh_download $dest $file $destfile];
+ if { $result == $destfile } {
+ return $orig_destfile;
+ } else {
+ return $result;
+ }
+ }
+
+ set result [catch "exec cp -p $file $destfile" output];
+ if [regexp "same file|are identical" $output] {
+ set result 0
+ set output ""
+ } else {
+ # try to make sure we can read it
+ # and write it (in case we copy onto it again)
+ catch {exec chmod u+rw $destfile}
+ }
+ if { $result != 0 || $output != "" } {
+ perror "remote_download to $dest of $file to $destfile: $output"
+ return "";
+ } else {
+ return $orig_destfile;
+ }
}
proc remote_upload {dest srcfile args} {
@@ -429,6 +468,38 @@ proc remote_upload {dest srcfile args} {
}
proc standard_upload { dest srcfile destfile } {
+ set orig_srcfile $srcfile
+
+ if [board_info $dest exists nfsdir] {
+ set destdir [board_info $dest nfsdir]
+ if [board_info $dest exists nfsroot_server] {
+ set dest [board_info $dest nfsroot_server];
+ } else {
+ set dest "";
+ }
+ set srcfile "$destdir/$srcfile";
+ }
+
+ if { "$dest" != "" } {
+ return [rsh_upload $dest $srcfile $destfile];
+ }
+
+ set result [catch "exec cp -p $srcfile $destfile" output];
+ if [regexp "same file|are identical" $output] {
+ set result 0
+ set output ""
+ } else {
+ # try to make sure we can read it
+ # and write it (in case we copy onto it again)
+ catch {exec chmod u+rw $destfile}
+ }
+ if { $result != 0 || $output != "" } {
+ perror "remote_upload to $dest of $file to $destfile: $output"
+ return "";
+ } else {
+ return $destfile;
+ }
+
return [rsh_upload $dest $srcfile $destfile];
}
@@ -442,7 +513,6 @@ proc call_remote { type proc dest args } {
if [board_info $dest exists name] {
set dest [board_info $dest name];
}
-verbose "In call_remote with $dest, $args"
if { $dest != "host" && $dest != "build" && $dest != "target" } {
if { ![board_info $dest exists name] } {
@@ -779,7 +849,7 @@ proc remote_raw_spawn { dest commandline } {
#
# The default spawn procedure. Uses rsh to connect to $dest.
#
-proc standard_spawn { dest commandline args } {
+proc standard_spawn { dest commandline } {
global board_info
if ![board_info $dest exists rsh_prog] {
@@ -795,7 +865,7 @@ proc standard_spawn { dest commandline args } {
if ![board_info $dest exists username] {
set rsh_useropts ""
} else {
- set rsh_useropts "-l [board_info $dest username]"
+ set rsh_useropts "-l $username"
}
if [board_info $dest exists hostname] {
@@ -804,8 +874,7 @@ proc standard_spawn { dest commandline args } {
set remote $dest;
}
-# spawn $RSH $rsh_useropts $remote $commandline;
- spawn "/bin/sh" "-c" "$RSH $rsh_useropts $remote \"$commandline\"";
+ spawn $RSH $rsh_useropts $remote $commandline;
set board_info($dest,fileid) $spawn_id;
return $spawn_id;
}
@@ -1068,7 +1137,7 @@ proc standard_wait { dest timeout } {
proc check_for_board_status { variable } {
upvar $variable output;
-
+
# If all programs of this board have a wrapper that always outputs a
# status message, then the absence of it means that the program
# crashed, regardless of status found elsewhere (e.g. simulator exit
@@ -1083,7 +1152,6 @@ proc check_for_board_status { variable } {
regsub "^.*\\*\\*\\* EXIT code " $output "" result;
regsub "\[\r\n\].*$" $result "" result;
regsub -all "(^|\[\r\n\]|\r\n)\\*\\*\\* EXIT code \[^\r\n\]*(\[\r\n\]\[\r\n\]?|$)" $output "" output;
-### regsub -all "(^|\r?\n)\\*\\*\\* EXIT code \[^\r\n\]*(\r?\n|$)" $output "" output;
regsub "^\[^0-9\]*" $result "" result
regsub "\[^0-9\]*$" $result "" result
verbose "got board status $result" 3
diff --git a/lib/rlogin.exp b/lib/rlogin.exp
index c4c948b..b49cd5d 100644
--- a/lib/rlogin.exp
+++ b/lib/rlogin.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1992 - 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1992 - 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/rsh.exp b/lib/rsh.exp
index ff28407..95de794 100644
--- a/lib/rsh.exp
+++ b/lib/rsh.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997 - 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1997 - 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/standard.exp b/lib/standard.exp
index c25a939..a197eaa 100644
--- a/lib/standard.exp
+++ b/lib/standard.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997 - 2002 Free Software Foundation, Inc.
+# Copyright (C) 1997 - 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/target.exp b/lib/target.exp
index a400e82..1152011 100644
--- a/lib/target.exp
+++ b/lib/target.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1992 - 2002 Free Software Foundation, Inc.
+# Copyright (C) 1992 - 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/targetdb.exp b/lib/targetdb.exp
index 7a746b3..99b3f58 100644
--- a/lib/targetdb.exp
+++ b/lib/targetdb.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997 - 2002 Free Software Foundation, Inc.
+# Copyright (C) 1997 - 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/telnet.exp b/lib/telnet.exp
index 23a2408..061ea58 100644
--- a/lib/telnet.exp
+++ b/lib/telnet.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997 - 2002 Free Software Foundation, Inc.
+# Copyright (C) 1997 - 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/tip.exp b/lib/tip.exp
index 8f60724..e829595 100644
--- a/lib/tip.exp
+++ b/lib/tip.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997 - 2002 Free Software Foundation, Inc.
+# Copyright (C) 1997 - 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/util-defs.exp b/lib/util-defs.exp
index d758099..a35bf12 100644
--- a/lib/util-defs.exp
+++ b/lib/util-defs.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1992 - 2002 Free Software Foundation, Inc.
+# Copyright (C) 1992 - 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/utils.exp b/lib/utils.exp
index 2febffe..fcac507 100644
--- a/lib/utils.exp
+++ b/lib/utils.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1992 - 2002 Free Software Foundation, Inc.
+# Copyright (C) 1992 - 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/xsh.exp b/lib/xsh.exp
index a983e00..07d6911 100644
--- a/lib/xsh.exp
+++ b/lib/xsh.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1992 - 2002 Free Software Foundation, Inc.
+# Copyright (C) 1992 - 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by