diff --git a/tests/shlib/common.sh b/tests/shlib/common.sh index d1cfbbf1..e6ff6d33 100644 --- a/tests/shlib/common.sh +++ b/tests/shlib/common.sh @@ -53,10 +53,17 @@ print_environ() { enter_suite() { set +x local suite_name="$1" ; shift + local final="$1" export POWERLINE_CURRENT_SUITE="${POWERLINE_CURRENT_SUITE}/$suite_name" travis_fold start "$POWERLINE_CURRENT_SUITE" print_environ - set -x + if test "$final" = final ; then + if test -n "$POWERLINE_SUITE_FINAL" ; then + fail __suite__/enter/final E "Final suites do not allow nesting" + fi + export POWERLINE_SUITE_FINAL=1 + set -x + fi } exit_suite() { diff --git a/tests/test_awesome/test.sh b/tests/test_awesome/test.sh index 93d50303..fc85dc21 100755 --- a/tests/test_awesome/test.sh +++ b/tests/test_awesome/test.sh @@ -102,7 +102,7 @@ if ! test -e "$DEPRECATED_SCRIPT" ; then # skip "deprecated" "Missing deprecated bar bindings script" : else - enter_suite "deprecated" + enter_suite "deprecated" final for args in "" "0.5"; do rm -rf "$TEST_ROOT/results" mkdir "$TEST_ROOT/results" @@ -132,7 +132,7 @@ else exit_suite --continue fi -enter_suite "awesome" +enter_suite "awesome" final ADDRESS="powerline-ipc-test-$$" echo "Powerline address: $ADDRESS" rm -rf "$TEST_ROOT/results" diff --git a/tests/test_bar/test.sh b/tests/test_bar/test.sh index d6522eed..a0838fa6 100755 --- a/tests/test_bar/test.sh +++ b/tests/test_bar/test.sh @@ -94,7 +94,7 @@ if ! test -e "$DEPRECATED_SCRIPT" ; then # skip "deprecated" "Missing deprecated bar bindings script" : else - enter_suite "deprecated" + enter_suite "deprecated" final run python "$DEPRECATED_SCRIPT" $args > "$TEST_ROOT/deprecated.log" 2>&1 & SPID=$! sleep 5 @@ -122,7 +122,7 @@ else sleep 5 killscript $SPID sleep 0.5 - enter_suite "args($args)" + enter_suite "args($args)" final fnum=0 for file in "$TEST_ROOT/results"/*.log ; do if ! test -e "$file" ; then diff --git a/tests/test_daemon/test.sh b/tests/test_daemon/test.sh index 6538e4fd..a5c12c11 100755 --- a/tests/test_daemon/test.sh +++ b/tests/test_daemon/test.sh @@ -1,7 +1,7 @@ #!/bin/sh . tests/shlib/common.sh -enter_suite daemon +enter_suite daemon final export ADDRESS="powerline-ipc-test-$$" echo "Powerline address: $ADDRESS" diff --git a/tests/test_in_vterm/test_tmux.sh b/tests/test_in_vterm/test_tmux.sh index d6cd6a51..062e02ba 100755 --- a/tests/test_in_vterm/test_tmux.sh +++ b/tests/test_in_vterm/test_tmux.sh @@ -2,7 +2,7 @@ . tests/shlib/common.sh . tests/shlib/vterm.sh -enter_suite tmux +enter_suite tmux final vterm_setup diff --git a/tests/test_in_vterm/test_vim.sh b/tests/test_in_vterm/test_vim.sh index 57c195ed..a7e61686 100755 --- a/tests/test_in_vterm/test_vim.sh +++ b/tests/test_in_vterm/test_vim.sh @@ -3,7 +3,7 @@ . tests/shlib/vterm.sh . tests/shlib/vim.sh -enter_suite vvim +enter_suite vvim final vterm_setup diff --git a/tests/test_lint/test.sh b/tests/test_lint/test.sh index f73ea981..03c2f8a8 100755 --- a/tests/test_lint/test.sh +++ b/tests/test_lint/test.sh @@ -1,7 +1,7 @@ #!/bin/sh . tests/shlib/common.sh -enter_suite lint +enter_suite lint final if ! "$PYTHON" "$ROOT/scripts/powerline-lint" -p "$ROOT/powerline/config_files" ; then fail "test" F "Running powerline-lint failed" diff --git a/tests/test_python/test.sh b/tests/test_python/test.sh index 667d642d..f0422372 100755 --- a/tests/test_python/test.sh +++ b/tests/test_python/test.sh @@ -1,7 +1,7 @@ #!/bin/sh . tests/shlib/common.sh -enter_suite python +enter_suite python final for file in "$ROOT"/tests/test_python/test_*.py ; do test_name="${file##*/test_}" diff --git a/tests/test_shells/test.sh b/tests/test_shells/test.sh index c6867342..44943029 100755 --- a/tests/test_shells/test.sh +++ b/tests/test_shells/test.sh @@ -1,7 +1,7 @@ #!/bin/sh . tests/shlib/common.sh -enter_suite shell +enter_suite shell final if test $# -eq 0 ; then FAST=1 diff --git a/tests/test_vim/test.sh b/tests/test_vim/test.sh index 87502a94..cd5ca622 100755 --- a/tests/test_vim/test.sh +++ b/tests/test_vim/test.sh @@ -3,7 +3,7 @@ . tests/shlib/vterm.sh . tests/shlib/vim.sh -enter_suite vim +enter_suite vim final vterm_setup vim