GNU bug report logs - #44602
runtest fails when objdir in site.exp contains spaces.

Previous Next

Package: dejagnu;

Reported by: Robert Menteer <reetnem <at> mac.com>

Date: Thu, 12 Nov 2020 22:41:01 UTC

Owned by: jcb62281 <at> gmail.com

Severity: normal

To reply to this bug, email your comments to 44602 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-dejagnu <at> gnu.org:
bug#44602; Package dejagnu. (Thu, 12 Nov 2020 22:41:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Robert Menteer <reetnem <at> mac.com>:
New bug report received and forwarded. Copy sent to bug-dejagnu <at> gnu.org. (Thu, 12 Nov 2020 22:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Robert Menteer <reetnem <at> mac.com>
To: Robert Menteer via Bug-dejagnu <bug-dejagnu <at> gnu.org>
Subject: runtest fails when objdir in site.exp contains spaces.
Date: Thu, 12 Nov 2020 17:40:24 -0500
[Message part 1 (text/plain, inline)]
When the value of objdir in site.exp contains spaces (even if it’s quoted) runtest fails.

parallels <at> parallels-Parallels-Virtual-Platform:~/Desktop/Parallels Shared Folders/FlDist/trunk/testsuite$ runtest
ERROR: tcl error sourcing /home/parallels/Desktop/Parallels Shared Folders/FlDist/trunk/testsuite/site.exp.
bad option "/home/parallels/Desktop/Parallels": must be -encoding
    while executing
"source /home/parallels/Desktop/Parallels Shared Folders/FlDist/trunk/testsuite/site.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source /home/parallels/Desktop/Parallels Shared Folders/FlDist/trunk/testsuite/site.exp"
    invoked from within
"catch "uplevel #0 source $file""
parallels <at> parallels-Parallels-Virtual-Platform:~/Desktop/Parallels Shared Folders/FlDist/trunk/testsuite$ cat site.exp 
## these variables are automatically generated by make ##
# Do not edit here.  If you wish to override these values
# edit the last section
set srcdir "."
set objdir "/home/parallels/Desktop/Parallels Shared Folders/FlDist/trunk/testsuite"
## End of auto-generated content; you can edit from here. ##
parallels <at> parallels-Parallels-Virtual-Platform:~/Desktop/Parallels Shared Folders/FlDist/trunk/testsuite$ 

Thanks,
Bob Menteer
[Message part 2 (text/html, inline)]

Information forwarded to bug-dejagnu <at> gnu.org:
bug#44602; Package dejagnu. (Fri, 13 Nov 2020 00:05:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jacob Bachmeyer <jcb62281 <at> gmail.com>
To: Robert Menteer <reetnem <at> mac.com>, 
 Robert Menteer via Bug-dejagnu <bug-dejagnu <at> gnu.org>
Cc: 44602 <at> debbugs.gnu.org
Subject: Re: bug#44602: runtest fails when objdir in site.exp contains spaces.
Date: Thu, 12 Nov 2020 18:04:51 -0600
[Message part 1 (text/plain, inline)]
Robert Menteer via Bug-dejagnu via wrote:
> When the value of objdir in site.exp contains spaces (even if it’s 
> quoted) runtest fails.

This is due to using catch with quoted code fragments instead of braced 
code fragments.  The attached patch should fix the issue at least with 
runtest itself, but the full solution will require changes in many files 
in DejaGnu and we are already in the release code freeze for 1.6.3.  
This will be a known bug in 1.6.3 and should be fixed completely in 1.6.4.


-- Jacob
[PR44602-test-1.patch (text/plain, inline)]
diff --git a/runtest.exp b/runtest.exp
index 21adcf6..c019841 100644
--- a/runtest.exp
+++ b/runtest.exp
@@ -311,7 +311,7 @@ proc load_file { args } {
 	if {! [catch {file exists $file} result] && $result} {
 	    set found 1
 	    verbose "Found $file"
-	    if { [catch "uplevel #0 source $file"] == 1 } {
+	    if { [catch {uplevel #0 source $file}] == 1 } {
 		send_error "ERROR: tcl error sourcing $file.\n"
 		global errorInfo
 		if {[info exists errorInfo]} {
@@ -346,7 +346,7 @@ proc search_and_load_file { type filelist dirlist } {
 		} else {
 		    verbose "Loading $filename"
 		}
-		if {[catch "uplevel #0 source $filename" error] == 1} {
+		if {[catch {uplevel #0 source $filename} error] == 1} {
 		    global errorInfo
 		    send_error "ERROR: tcl error sourcing $type $filename.\n$error\n"
 		    if {[info exists errorInfo]} {
@@ -613,11 +613,11 @@ if { $logname eq "" } {
 	    set logname $env(LOGNAME)
 	} else {
 	    # try getting it with whoami
-	    catch "set logname [exec whoami]" tmp
+	    catch {set logname [exec whoami]} tmp
 	    if {[string match "*couldn't find*to execute*" $tmp]} {
 		# try getting it with who am i
 		unset tmp
-		catch "set logname [exec who am i]" tmp
+		catch {set logname [exec who am i]} tmp
 		if {[string match "*Command not found*" $tmp]} {
 		    send_user "ERROR: couldn't get the users login name\n"
 		    set logname "Unknown"
@@ -823,7 +823,7 @@ if {[expr {$build_triplet eq "" && $host_triplet eq ""}]} {
 	send_error "ERROR: Couldn't find config.guess program.\n"
 	exit 1
     }
-    catch "exec $config_guess" build_triplet
+    catch {exec $config_guess} build_triplet
     switch -- $build_triplet {
 	"No uname command or uname output not recognized" -
 	"Unable to guess system type" {
@@ -1578,7 +1578,7 @@ proc runtest { test_file_name } {
 	    }
 	}
 
-	if { [catch "uplevel #0 source $test_file_name" msg] == 1 } {
+	if { [catch {uplevel #0 source $test_file_name} msg] == 1 } {
 	    # If we have a Tcl error, propagate the exit status so
 	    # that 'make' (if it invokes runtest) notices the error.
 	    global exit_status exit_error

Information forwarded to bug-dejagnu <at> gnu.org:
bug#44602; Package dejagnu. (Fri, 13 Nov 2020 00:05:02 GMT) Full text and rfc822 format available.

Owner recorded as jcb62281 <at> gmail.com. Request was from Jacob Bachmeyer <jcb62281 <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 13 Nov 2020 00:16:01 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 215 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.