# This file is in charge of starting up the tgdb_driver. # The rest of the tests assume that the program has already been started. set timeout 3 global TGDB_DRIVER if ![info exists TGDB_DRIVER] { # set TGDB_DRIVER [findfile $base_dir/../../../objdir "tgdb_driver"] set TGDB_DRIVER "../../tgdb/tgdb-base/src/tgdb_driver" } if ![info exists tgdb_prompt] then { set tgdb_prompt "\[(\]tgdb\[)\] " } # Needed for some tests under Cygwin. global EXEEXT global env if ![info exists env(EXEEXT)] { set EXEEXT "" } else { set EXEEXT $env(EXEEXT) } # # tgdb_exit -- quit and cleanup # proc tgdb_exit {} { send "quit\n" } # # tgdb_start -- start tgdb running # proc tgdb_start {} { global TGDB_DRIVER global tgdb_prompt global spawn_id global verbose if { $verbose > 1 } { send_user "starting $TGDB_DRIVER\n" } spawn $TGDB_DRIVER expect { -re "No such file.*" { perror "Can't start $TGDB_DRIVER" ; return -1; } -re ".*$tgdb_prompt" { return 0; } timeout { perror "Failed to spawn $TGDB_DRIVER (timeout)"; return -1; } } return -1 } if [tgdb_start] then { puts "Error starting program" exit 1 }