aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/dejagnu.exp17
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" {