aboutsummaryrefslogtreecommitdiff
path: root/contrib/bluegnu2.0.3/example/calc/testsuite/config/unix.exp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bluegnu2.0.3/example/calc/testsuite/config/unix.exp')
-rw-r--r--contrib/bluegnu2.0.3/example/calc/testsuite/config/unix.exp49
1 files changed, 49 insertions, 0 deletions
diff --git a/contrib/bluegnu2.0.3/example/calc/testsuite/config/unix.exp b/contrib/bluegnu2.0.3/example/calc/testsuite/config/unix.exp
new file mode 100644
index 0000000..aec9f40
--- /dev/null
+++ b/contrib/bluegnu2.0.3/example/calc/testsuite/config/unix.exp
@@ -0,0 +1,49 @@
+if ![info exists prompt] then {
+ set prompt "calc: "
+}
+#
+# calc_version -- extract and print the version number of calc
+#
+
+proc calc_version {} {
+ global CALC
+ global prompt
+ set tmp [exec echo "version" | $CALC]
+ regexp "$prompt *(\[^\n\]*)\n.*" $tmp tmp version
+ clone_output "[which $CALC] version $version\n"
+}
+#
+# calc_load -- loads the program
+#
+proc calc_load { arg } {
+ #
+}
+
+#
+# calc_exit -- quit and cleanup
+#
+proc calc_exit {} {
+ send "quit\n"
+}
+
+#
+# calc_start -- start calc running
+#
+proc calc_start {} {
+ global CALC
+ global prompt
+ global spawn_id
+ global verbose
+
+ if { $verbose > 1 } {
+ send_user "starting $CALC\n"
+ }
+ spawn $CALC
+ expect {
+ -re "No such file.*" { perror "Can't start $CALC"; exit 1 }
+ -re "$prompt$" { }
+ timeout { perror "Failed to spawn $CALC (timeout)"; exit 1 }
+ }
+}
+
+calc_start