[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 0367d0bf57fb058b6f7fdc7bc9902de7bf5bbd26

Freddy Vulto fvulto at gmail.com
Fri Nov 5 20:13:07 UTC 2010


The following commit has been merged in the master branch:
commit 0367d0bf57fb058b6f7fdc7bc9902de7bf5bbd26
Author: Freddy Vulto <fvulto at gmail.com>
Date:   Fri Nov 5 21:11:57 2010 +0100

    (testsuite) Moved tool_start() code to tool_init()
    ${tool}_start was called from within `config/default_exp', but this
    proves to be error-prone, because DejaGnu isn't fully initialized at
    that point, causing an error when calling one of the DejaGnu methods
    pass/fail/unsupported/xfail/unresolved/untested:
    
        can't read "multipass_name": no such variable
    
    The right way seems to be calling ${tool}_start() from
    ${tool}_init().

diff --git a/test/config/default.exp b/test/config/default.exp
index 53e0185..1eb47a2 100644
--- a/test/config/default.exp
+++ b/test/config/default.exp
@@ -19,9 +19,3 @@ expect_after {
         }   
     }   
 }
-
-
-# Call tool_start(), if available
-if { [info procs "${tool}_start"] != "" } {
-    ${tool}_start
-}
diff --git a/test/lib/completion.exp b/test/lib/completion.exp
index ea2a3d8..b7563af 100644
--- a/test/lib/completion.exp
+++ b/test/lib/completion.exp
@@ -6,6 +6,14 @@ proc completion_exit {} {
 }
 
 
+proc completion_init {test_file_name} {
+    # Call completion_start() only once
+    if {! [info exists ::BASH_VERSINFO]} {
+        completion_start
+    }
+}
+
+
 proc completion_start {} {
     start_interactive_test
 }
diff --git a/test/lib/library.exp b/test/lib/library.exp
index b68f413..bc5de50 100644
--- a/test/lib/library.exp
+++ b/test/lib/library.exp
@@ -34,24 +34,14 @@ proc assert_bash_exec {{aCmd ""} {title ""} {prompt /@} {out -1}} {
         ]
     ]
     if {$out == -1 && [string length $results] > 0} {
-        # Is DejaGnu fully initialized, i.e. is "fail" method available?
-        if {[info exists multipass_name]} {
-            fail "ERROR Unexpected output from bash command \"$title\""
-        }
-        send_user "ERROR Unexpected output from bash command \"$title\":\n$results"
+        fail "ERROR Unexpected output from bash command \"$title\""
     }
 
     set cmd "echo $?"
     send "$cmd\r"
     expect {
         -ex "$cmd\r\n0\r\n$prompt" {}
-        $prompt {
-            # Is DejaGnu fully initialized, i.e. is "fail" method available?
-            if {[info exists multipass_name]} {
-                fail "ERROR executing bash command \"$title\""
-            }
-            send_user "ERROR executing bash command \"$title\""
-        }
+        $prompt {fail "ERROR executing bash command \"$title\""}
     }
 }
 
diff --git a/test/lib/unit.exp b/test/lib/unit.exp
index de87033..935997b 100644
--- a/test/lib/unit.exp
+++ b/test/lib/unit.exp
@@ -7,6 +7,14 @@ proc unit_exit {} {
 }
 
 
+proc unit_init {test_file_name} {
+    # Call unit_start() only once
+    if {! [info exists ::BASH_VERSINFO]} {
+        unit_start
+    }
+}
+
+
 proc unit_start {} {
     start_interactive_test
 }

-- 
bash-completion



More information about the Bash-completion-commits mailing list