changeset 1781:3227fa662692

Fix build failure caused by bash-completion tests Reviewed-by: ebaron Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2015-July/014918.html PR2616
author Severin Gehwolf <sgehwolf@redhat.com>
date Thu, 10 Sep 2015 11:51:45 +0200
parents bc7fff685867
children 5345e379a7a6
files distribution/tools/verify-bash-completion.sh
diffstat 1 files changed, 10 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/distribution/tools/verify-bash-completion.sh	Mon Jul 27 11:14:32 2015 -0400
+++ b/distribution/tools/verify-bash-completion.sh	Thu Sep 10 11:51:45 2015 +0200
@@ -39,14 +39,11 @@
 # Tests for bash-completion
 
 set -e
-set -x
 
 errors=0
 
 TARGET="$(dirname $0)/../target"
 
-echo "$BASH_VERSION"
-
 # Join the supplied arguments into a single string using the specified separator
 # $1 : the separator
 # everything else: arguments to join
@@ -65,6 +62,16 @@
 }
 
 function __init {
+    USER_THERMOSTAT_HOME="$TARGET/bash-completion-test-user-home"
+    echo "Skipping initial thermostat setup..."
+    mkdir -p $USER_THERMOSTAT_HOME/data
+    echo "Exporting custom home..."
+    export USER_THERMOSTAT_HOME
+    touch ${USER_THERMOSTAT_HOME}/data/setup-complete.stamp
+
+    echo "Checking that help works..."
+    ${TARGET}/image/bin/thermostat help >/dev/null
+
     completion_file="${TARGET}/image/bin/thermostat-completion"
     source "${completion_file}"
 }
@@ -95,22 +102,11 @@
     input=$1
     expected=$2
     expected_pretty=$(echo $expected | __prettify)
-    echo "Testing $input"
-    __find_completion $input
-    # disable debugging output once to grab the actual output we need
-    set +x
     # save completions and any other output separately and check both
     __find_completion $input >${TARGET}/completion.actual 2>${TARGET}/completion.output
-    # enable debugging output to display more information
-    set -x
     actual=$(<${TARGET}/completion.actual)
     actual_pretty=$(echo "$actual" | __prettify)
     output=$(<${TARGET}/completion.output)
-    echo "Input: $input"
-    echo "Completion: $actual"
-    echo "Expected: $expected"
-    echo "Output: $output"
-
     if [[ $actual == $expected && -z $output ]] ; then
         echo "[OK]   '$input' => '$actual_pretty'"
     elif [[ -z $output ]]; then