diff options
author | Jacob Bachmeyer <jcb62281+dev@gmail.com> | 2020-07-20 21:39:21 -0500 |
---|---|---|
committer | Jacob Bachmeyer <jcb62281+dev@gmail.com> | 2020-07-20 21:39:21 -0500 |
commit | 89f58b27832f8fc7b443988d02e56cfaba12eb5a (patch) | |
tree | 162fedc62b2a815722180f3e8adc8e2c4b6ff8c9 /lib | |
parent | cafd85defe299956b18c75c2439e74bd19652388 (diff) | |
download | dejagnu-89f58b27832f8fc7b443988d02e56cfaba12eb5a.zip dejagnu-89f58b27832f8fc7b443988d02e56cfaba12eb5a.tar.gz dejagnu-89f58b27832f8fc7b443988d02e56cfaba12eb5a.tar.bz2 |
Add regression test for PR42399
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dejagnu.exp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/dejagnu.exp b/lib/dejagnu.exp index ea363a9..e1060ae 100644 --- a/lib/dejagnu.exp +++ b/lib/dejagnu.exp @@ -112,16 +112,19 @@ proc host_execute {args} { set timetol 0 set arguments "" - if { [llength $args] == 0} { - set executable $args + if { [llength $args] == 0 } { + return "No executable specified." } else { - set executable [string trimleft [lindex [split $args " "] 0] "\{"] - set params [string trimleft [lindex [split $args " "] 1] "\{"] - set params [string trimright $params "\}"] + set executable [lindex $args 0] + set arguments [lrange $args 1 end] } verbose "The executable is $executable" 2 - if {![file exists $executable]} { + verbose "The arguments are $arguments" 2 + if { [file exists "./${executable}"] } { + set executable "./${executable}" + } + if { ![file exists $executable] } { perror "The executable, \"$executable\" is missing" 0 return "No source file found" } @@ -129,7 +132,7 @@ proc host_execute {args} { # spawn the executable and look for the DejaGnu output messages from the # test case. # spawn -noecho -open [open "|./${executable}" "r"] - spawn -noecho "./${executable}" $params + eval [list spawn -noecho $executable] $arguments set prefix "\[^\r\n\]*" expect { -re "^$prefix\[0-9\]\[0-9\]:..:..:${text}*\r\n" { |