From be3fd917a9a0ec3fc79a292f9a54f97eadf36fc7 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 01:29:10 +0300 Subject: [PATCH 01/28] Limit maximum amount of attempts to set register a --- tests/test_shells/test.sh | 48 +++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/tests/test_shells/test.sh b/tests/test_shells/test.sh index e88d2e9a..6b69fda3 100755 --- a/tests/test_shells/test.sh +++ b/tests/test_shells/test.sh @@ -92,6 +92,22 @@ run() { NL="$(printf '\nE')" NL="${NL%E}" +print_full_output() { + TEST_TYPE="$1" + TEST_CLIENT="$2" + SH="$3" + echo "Full output:" + echo '============================================================' + cat tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.full.log + echo '____________________________________________________________' + if test "x$POWERLINE_TEST_NO_CAT_V" != "x1" ; then + echo "Full output (cat -v):" + echo '============================================================' + cat -v tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.full.log + echo '____________________________________________________________' + fi +} + do_run_test() { TEST_TYPE="$1" shift @@ -106,8 +122,16 @@ do_run_test() { screen -L -c tests/test_shells/screenrc -d -m -S "$SESNAME" \ env LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" \ "$@" + local attempts=100 while ! screen -S "$SESNAME" -X readreg a tests/test_shells/input.$SH ; do sleep 0.1s + attempts=$(( attempts - 1 )) + if test $attempts -eq 0 ; then + echo "Waiting for too long: assuming test failed" + echo "Failed ${SH}: failed to put input.$SH contents to the screen register." + print_full_output ${TEST_TYPE} ${TEST_CLIENT} ${SH} + return 1 + fi done # Wait for screen to initialize sleep 1 @@ -117,16 +141,8 @@ do_run_test() { attempts=$(( attempts - 1 )) if test $attempts -eq 0 ; then echo "Waiting for too long: assuming test failed" - echo "Failed ${SH}. Full output:" - echo '============================================================' - cat tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.full.log - echo '____________________________________________________________' - if test "x$POWERLINE_TEST_NO_CAT_V" != "x1" ; then - echo "Full output (cat -v):" - echo '============================================================' - cat -v tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.full.log - echo '____________________________________________________________' - fi + echo -n "Failed ${SH}. " + print_full_output ${TEST_TYPE} ${TEST_CLIENT} ${SH} return 1 fi done @@ -179,16 +195,8 @@ do_run_test() { check_screen_log ${TEST_TYPE} ${TEST_CLIENT} ${SH} | cat -v echo '____________________________________________________________' fi - echo "Failed ${SH}. Full output:" - echo '============================================================' - cat tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.full.log - echo '____________________________________________________________' - if test "x$POWERLINE_TEST_NO_CAT_V" != "x1" ; then - echo "Full output (cat -v):" - echo '============================================================' - cat -v tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.full.log - echo '____________________________________________________________' - fi + echo -n "Failed ${SH}. " + print_full_output ${TEST_TYPE} ${TEST_CLIENT} ${SH} case ${SH} in *ksh) ${SH} -c 'echo ${KSH_VERSION}' From e7c381a63fd06813ccbec0fafedc9c5deeab56a9 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 01:51:58 +0300 Subject: [PATCH 02/28] Make sure USER and HOME variables are defined --- tests/test.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test.sh b/tests/test.sh index 62b525df..1a1c7954 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -1,6 +1,11 @@ #!/bin/bash . tests/bot-ci/scripts/common/main.sh +: ${USER:=`id -un`} +: ${HOME:=`getent passwd $USER | cut -d: -f6`} + +export USER HOME + FAILED=0 export PATH="/opt/fish/bin:${PATH}" From fb0fba6c6d176b2cd82f89e5f8bf52412e5aeacb Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 02:00:13 +0300 Subject: [PATCH 03/28] Do not modify $PATH and $LD_LIBRARY_PATH unless on travis --- tests/test.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/test.sh b/tests/test.sh index 1a1c7954..fa92949f 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -8,18 +8,20 @@ export USER HOME FAILED=0 -export PATH="/opt/fish/bin:${PATH}" +if test "$TRAVIS" = true ; then + export PATH="/opt/fish/bin:${PATH}" -if test "$PYTHON_IMPLEMENTATION" = "CPython" ; then - export PATH="/opt/zsh-${PYTHON_MM}${USE_UCS2_PYTHON:+-ucs2}/bin:${PATH}" -fi + if test "$PYTHON_IMPLEMENTATION" = "CPython" ; then + export PATH="/opt/zsh-${PYTHON_MM}${USE_UCS2_PYTHON:+-ucs2}/bin:${PATH}" + fi -if test -n "$USE_UCS2_PYTHON" ; then - export LD_LIBRARY_PATH="/opt/cpython-ucs2-$UCS2_PYTHON_VARIANT/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" - set +e - . virtualenvwrapper.sh - workon cpython-ucs2-$UCS2_PYTHON_VARIANT - set -e + if test -n "$USE_UCS2_PYTHON" ; then + export LD_LIBRARY_PATH="/opt/cpython-ucs2-$UCS2_PYTHON_VARIANT/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" + set +e + . virtualenvwrapper.sh + workon cpython-ucs2-$UCS2_PYTHON_VARIANT + set -e + fi fi export PYTHON="${PYTHON:=python}" From 683691931de0b72606500c67f91b036083bf3fef Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 02:21:11 +0300 Subject: [PATCH 04/28] Make sure that there is at least one blank line after full log --- tests/test_shells/test.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_shells/test.sh b/tests/test_shells/test.sh index 6b69fda3..5d638e1e 100755 --- a/tests/test_shells/test.sh +++ b/tests/test_shells/test.sh @@ -99,11 +99,13 @@ print_full_output() { echo "Full output:" echo '============================================================' cat tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.full.log + echo echo '____________________________________________________________' if test "x$POWERLINE_TEST_NO_CAT_V" != "x1" ; then echo "Full output (cat -v):" echo '============================================================' cat -v tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.full.log + echo echo '____________________________________________________________' fi } From 5ecf50b4d8bc6900fc03a4c6845d3d6e3fc78d1c Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 03:32:26 +0300 Subject: [PATCH 05/28] Use different $HOME --- tests/test_shells/test.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_shells/test.sh b/tests/test_shells/test.sh index 5d638e1e..a6d7a6f1 100755 --- a/tests/test_shells/test.sh +++ b/tests/test_shells/test.sh @@ -352,6 +352,9 @@ for exe in bash zsh busybox fish tcsh mksh dash ipython ; do fi done +mkdir tests/shell/home +export HOME="$PWD/tests/shell/home" + unset ENV export ADDRESS="powerline-ipc-test-$$" From e6b3bff50a09fde8d1bdbacf1c4ad97e140bf758 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 03:42:58 +0300 Subject: [PATCH 06/28] Rerun main() only after running finally block --- tests/test_in_vterm/test_tmux.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_in_vterm/test_tmux.py b/tests/test_in_vterm/test_tmux.py index 3cd137e2..9bbc3406 100755 --- a/tests/test_in_vterm/test_tmux.py +++ b/tests/test_in_vterm/test_tmux.py @@ -223,7 +223,8 @@ def main(attempts=3): expected_result = expected_result_new if not test_expected_result(p, expected_result, cols, rows, not attempts): if attempts: - return main(attempts=(attempts - 1)) + pass + # Will rerun main later. else: return False else: @@ -233,6 +234,7 @@ def main(attempts=3): 'PATH': vterm_path, 'LD_LIBRARY_PATH': os.environ.get('LD_LIBRARY_PATH', ''), }) + return main(attempts=(attempts - 1)) if __name__ == '__main__': From 838a7c3b15237104b4dfbd2df21a7f8708edb280 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 13:46:35 +0300 Subject: [PATCH 07/28] Fix the case when $0 is a path I.e. something like /home/zyx/.vam/powerline/tests/shell/path/mksh. --- powerline/bindings/shell/powerline.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/powerline/bindings/shell/powerline.sh b/powerline/bindings/shell/powerline.sh index 7ae7237f..5b4dc739 100644 --- a/powerline/bindings/shell/powerline.sh +++ b/powerline/bindings/shell/powerline.sh @@ -224,8 +224,7 @@ fi # Strips the leading `-`: it may be present when shell is a login shell _POWERLINE_USED_SHELL=${0#-} -_POWERLINE_USED_SHELL=${_POWERLINE_USED_SHELL#/usr} -_POWERLINE_USED_SHELL=${_POWERLINE_USED_SHELL#/bin/} +_POWERLINE_USED_SHELL=${_POWERLINE_USED_SHELL##*/} if "${POWERLINE_CONFIG_COMMAND}" shell uses tmux ; then _powerline_init_tmux_support $_POWERLINE_USED_SHELL From 8524ee35e7b1dad77f3ba3710b09f864db3abba5 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 13:56:25 +0300 Subject: [PATCH 08/28] Ignore stderr from printf and env MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit socat may close pipe before they succeed to write something which results in env: write error: Broken pipe (according to my experience leading printf’s always succeeds to write before socat closes pipe). --- client/powerline.sh | 2 +- tests/test_shells/run_script.py | 104 ++++++++++++++++++++++++++++++++ tests/test_shells/test.sh | 98 ++---------------------------- 3 files changed, 110 insertions(+), 94 deletions(-) create mode 100755 tests/test_shells/run_script.py diff --git a/client/powerline.sh b/client/powerline.sh index b8e37956..8bcec224 100755 --- a/client/powerline.sh +++ b/client/powerline.sh @@ -46,7 +46,7 @@ fi done printf '%s\0' "$PWD" $ENV -0 -) | socat -lf/dev/null -t 10 - "$ADDRESS" +) 2>/dev/null | socat -lf/dev/null -t 10 - "$ADDRESS" if test $? -ne 0 ; then powerline-render "$@" diff --git a/tests/test_shells/run_script.py b/tests/test_shells/run_script.py new file mode 100755 index 00000000..faa922b8 --- /dev/null +++ b/tests/test_shells/run_script.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8:noet +from __future__ import (unicode_literals, division, absolute_import, print_function) + +import argparse +import os +import re + +from time import sleep +from subprocess import check_call + +import pexpect + + +def get_argparser(ArgumentParser=argparse.ArgumentParser): + parser = ArgumentParser(description='Run powerline shell test using pexpect') + parser.add_argument('--wait-for-echo', action='store_true', help='Wait until the input is echoed back.') + parser.add_argument('--type', metavar='TYPE', help='Test type (daemon, nodaemon, …).') + parser.add_argument('--client', metavar='CLIENT', help='Type of the client used (C, shell, zpython, …).') + parser.add_argument('--shell', metavar='SHELL', help='Shell name.') + parser.add_argument('command', required=True, nargs=argparse.REMAINDER, metavar='COMMAND', + help='Command to run and its argument.') + return parser + + +def main(): + parser = get_argparser() + args = parser.parse_args() + + shell = args.shell or args.command[0] + test_type = args.test_type or shell + test_client = args.test_client or test_type + + log_file_base = '{0}.{1}.{2}'.format(shell, test_type, test_client) + full_log_file_name = os.path.join('tests', 'shell', '{0}.full.log'.format(log_file_base)) + # postproc_log_file_name = os.path.join('tests', 'shell', '{0}.log'.format(log_file_base)) + + local_paths = [ + os.path.abspath(os.path.join('tests', 'shell', 'path')), + os.path.abspath('scripts'), + ] + + if test_type == 'fish': + local_paths += ['/usr/bin', '/bin'] + + python_paths = os.environ.get('PYTHONPATH', '') + if python_paths: + python_paths = ':' + python_paths + python_paths = os.path.abspath('.') + python_paths + + environ = { + 'LANG': 'en_US.UTF-8', + 'PATH': os.pathsep.join(local_paths), + 'TERM': 'screen-256color', + 'DIR1': os.environ['DIR1'], + 'DIR2': os.environ['DIR2'], + 'XDG_CONFIG_HOME': os.path.abspath(os.path.join('tests', 'shell', 'fish_home')), + 'IPYTHONDIR': os.path.abspath(os.path.join('tests', 'shell', 'ipython_home')), + 'PYTHONPATH': python_paths, + 'POWERLINE_CONFIG_OVERRIDES': os.environ.get('POWERLINE_CONFIG_OVERRIDES', ''), + 'POWERLINE_THEME_OVERRIDES': os.environ.get('POWERLINE_THEME_OVERRIDES', ''), + 'POWERLINE_CONFIG_PATHS': os.path.abspath(os.path.join('powerline', 'config_files')), + 'POWERLINE_COMMAND_ARGS': os.environ.get('POWERLINE_COMMAND_ARGS', ''), + 'POWERLINE_COMMAND': os.environ.get('POWERLINE_COMMAND', ''), + 'LD_LIBRARY_PATH': os.environ.get('LD_LIBRARY_PATH', ''), + } + + if test_type == 'daemon': + environ['POWERLINE_SHELL_CONTINUATION'] = '1' + environ['POWERLINE_SHELL_SELECT'] = '1' + + child = pexpect.spawn( + args.command[0], + args.command[1:], + logfile=open(full_log_file_name), + env=environ, + ) + child.expect(re.compile('.*')) + sleep(0.5) + child.setwinsize(1, 300) + + with open(os.path.join('tests', 'test_shells', 'input.{0}'.format(shell)), 'rb') as F: + if not args.wait_for_echo: + child.send(F.read()) + else: + for line in F: + child.send(line) + sleep(1) + # TODO Implement something more smart + + child.wait() + + check_call([ + os.path.join('tests', 'shell', 'path', 'python'), + os.path.join('tests', 'test_shells', 'postproc.py'), + test_type, test_client, shell + ]) + pidfile = os.path.join('tests', 'shell', '3rd', 'pid') + if os.path.exists(pidfile): + os.unlink(pidfile) + + +if __name__ == '__main__': + main() diff --git a/tests/test_shells/test.sh b/tests/test_shells/test.sh index a6d7a6f1..69503eb4 100755 --- a/tests/test_shells/test.sh +++ b/tests/test_shells/test.sh @@ -47,47 +47,6 @@ check_screen_log() { fi } -run() { - TEST_TYPE="$1" - shift - TEST_CLIENT="$1" - shift - SH="$1" - shift - local local_path="$PWD/tests/shell/path:$PWD/scripts" - if test "x$SH" = "xfish" ; then - local_path="${local_path}:/usr/bin:/bin" - fi - if test $TEST_TYPE = daemon ; then - local additional_prompts=1 - else - local additional_prompts= - fi - env -i \ - LANG=en_US.UTF-8 \ - PATH="$local_path" \ - TERM="screen-256color" \ - COLUMNS="${COLUMNS}" \ - LINES="${LINES}" \ - TEST_TYPE="${TEST_TYPE}" \ - TEST_CLIENT="${TEST_CLIENT}" \ - SH="${SH}" \ - DIR1="${DIR1}" \ - POWERLINE_NO_ZSH_ZPYTHON="$(test $TEST_TYPE = zpython || echo 1)" \ - DIR2="${DIR2}" \ - XDG_CONFIG_HOME="$PWD/tests/shell/fish_home" \ - IPYTHONDIR="$PWD/tests/shell/ipython_home" \ - PYTHONPATH="${PWD}${PYTHONPATH:+:}$PYTHONPATH" \ - POWERLINE_CONFIG_OVERRIDES="${POWERLINE_CONFIG_OVERRIDES}" \ - POWERLINE_THEME_OVERRIDES="${POWERLINE_THEME_OVERRIDES}" \ - POWERLINE_SHELL_CONTINUATION=$additional_prompts \ - POWERLINE_SHELL_SELECT=$additional_prompts \ - POWERLINE_CONFIG_PATHS="$PWD/powerline/config_files" \ - POWERLINE_COMMAND_ARGS="${POWERLINE_COMMAND_ARGS}" \ - POWERLINE_COMMAND="${POWERLINE_COMMAND}" \ - "$@" -} - # HACK: get newline for use in strings given that "\n" and $'' do not work. NL="$(printf '\nE')" NL="${NL%E}" @@ -116,38 +75,8 @@ do_run_test() { TEST_CLIENT="$1" shift SH="$1" - SESNAME="powerline-shell-test-${SH}-$$" - # Note: when running screen with setuid libc unsets LD_LIBRARY_PATH, so it - # cannot be added to the `env -i` call above. - run "${TEST_TYPE}" "${TEST_CLIENT}" "${SH}" \ - screen -L -c tests/test_shells/screenrc -d -m -S "$SESNAME" \ - env LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" \ - "$@" - local attempts=100 - while ! screen -S "$SESNAME" -X readreg a tests/test_shells/input.$SH ; do - sleep 0.1s - attempts=$(( attempts - 1 )) - if test $attempts -eq 0 ; then - echo "Waiting for too long: assuming test failed" - echo "Failed ${SH}: failed to put input.$SH contents to the screen register." - print_full_output ${TEST_TYPE} ${TEST_CLIENT} ${SH} - return 1 - fi - done - # Wait for screen to initialize - sleep 1 - local attempts=100 - while ! screen -S "$SESNAME" -p 0 -X width 300 1 >/dev/null ; do - sleep 0.1s - attempts=$(( attempts - 1 )) - if test $attempts -eq 0 ; then - echo "Waiting for too long: assuming test failed" - echo -n "Failed ${SH}. " - print_full_output ${TEST_TYPE} ${TEST_CLIENT} ${SH} - return 1 - fi - done + local wait_for_echo_arg= if ( \ test "x${SH}" = "xdash" \ || ( \ @@ -166,28 +95,11 @@ do_run_test() { ) \ ) \ ) ; then - # If I do not use this hack for dash then output will look like - # - # command1 - # command2 - # … - # prompt1> prompt2> … - while read -r line ; do - if test "$(screen -S "$SESNAME" -p 0 -X stuff "$line$NL")" = "No screen session found." ; then - break - fi - sleep 1 - done < tests/test_shells/input.$SH - else - screen -S "$SESNAME" -p 0 -X paste a + wait_for_echo_arg="--wait-for-echo" fi - # Wait for screen to exit (sending command to non-existing screen session - # fails; when launched instance exits corresponding session is deleted) - while screen -S "$SESNAME" -X blankerprg "" > /dev/null ; do - sleep 0.1s - done - ${PYTHON} ./tests/test_shells/postproc.py ${TEST_TYPE} ${TEST_CLIENT} ${SH} - rm -f tests/shell/3rd/pid + "${PYTHON}" tests/test_shells/run_script.py \ + $wait_for_echo_arg --type=${TEST_TYPE} --client=${TEST_CLIENT} --shell=${SH} \ + "$@" if ! check_screen_log ${TEST_TYPE} ${TEST_CLIENT} ${SH} ; then echo '____________________________________________________________' if test "x$POWERLINE_TEST_NO_CAT_V" != "x1" ; then From 22162a965668eab119c2e8ba2509f128bb616578 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 14:03:34 +0300 Subject: [PATCH 09/28] Replace screen-based tests with pexpect-based tests Currently works for all tests, but dash ones. Not much of a problem since dash tests were disabled for being unstable. --- tests/install.sh | 2 +- tests/test_shells/run_script.py | 21 ++++++++++++++++----- tests/test_shells/screenrc | 7 ------- tests/test_shells/test.sh | 10 ++++------ 4 files changed, 21 insertions(+), 19 deletions(-) delete mode 100644 tests/test_shells/screenrc diff --git a/tests/install.sh b/tests/install.sh index 974971a5..83b97719 100755 --- a/tests/install.sh +++ b/tests/install.sh @@ -5,7 +5,7 @@ git clone --depth=1 git://github.com/powerline/deps tests/bot-ci/deps . tests/bot-ci/scripts/common/main.sh sudo apt-get install -qq libssl1.0.0 -sudo apt-get install -qq screen zsh tcsh mksh busybox socat realpath bc rc tmux +sudo apt-get install -qq zsh tcsh mksh busybox socat realpath bc rc tmux if test -n "$USE_UCS2_PYTHON" ; then pip install virtualenvwrapper diff --git a/tests/test_shells/run_script.py b/tests/test_shells/run_script.py index faa922b8..f9b9248a 100755 --- a/tests/test_shells/run_script.py +++ b/tests/test_shells/run_script.py @@ -8,6 +8,7 @@ import re from time import sleep from subprocess import check_call +from io import BytesIO import pexpect @@ -18,7 +19,7 @@ def get_argparser(ArgumentParser=argparse.ArgumentParser): parser.add_argument('--type', metavar='TYPE', help='Test type (daemon, nodaemon, …).') parser.add_argument('--client', metavar='CLIENT', help='Type of the client used (C, shell, zpython, …).') parser.add_argument('--shell', metavar='SHELL', help='Shell name.') - parser.add_argument('command', required=True, nargs=argparse.REMAINDER, metavar='COMMAND', + parser.add_argument('command', nargs=argparse.REMAINDER, metavar='COMMAND', help='Command to run and its argument.') return parser @@ -28,8 +29,8 @@ def main(): args = parser.parse_args() shell = args.shell or args.command[0] - test_type = args.test_type or shell - test_client = args.test_client or test_type + test_type = args.type or shell + test_client = args.client or test_type log_file_base = '{0}.{1}.{2}'.format(shell, test_type, test_client) full_log_file_name = os.path.join('tests', 'shell', '{0}.full.log'.format(log_file_base)) @@ -65,17 +66,24 @@ def main(): 'LD_LIBRARY_PATH': os.environ.get('LD_LIBRARY_PATH', ''), } + os.environ['PATH'] = environ['PATH'] + if test_type == 'daemon': environ['POWERLINE_SHELL_CONTINUATION'] = '1' environ['POWERLINE_SHELL_SELECT'] = '1' + if test_type != 'zpython' and shell == 'zsh': + environ['POWERLINE_NO_ZSH_ZPYTHON'] = '1' + + sio = BytesIO() + child = pexpect.spawn( args.command[0], args.command[1:], - logfile=open(full_log_file_name), env=environ, + logfile=sio, ) - child.expect(re.compile('.*')) + child.expect(re.compile(b'.*')) sleep(0.5) child.setwinsize(1, 300) @@ -90,6 +98,9 @@ def main(): child.wait() + with open(full_log_file_name, 'w') as LF: + LF.write(child.read()) + check_call([ os.path.join('tests', 'shell', 'path', 'python'), os.path.join('tests', 'test_shells', 'postproc.py'), diff --git a/tests/test_shells/screenrc b/tests/test_shells/screenrc deleted file mode 100644 index ba25fd28..00000000 --- a/tests/test_shells/screenrc +++ /dev/null @@ -1,7 +0,0 @@ -width 1024 -height 1 -logfile "tests/shell/${SH}.${TEST_TYPE}.${TEST_CLIENT}.full.log" -# Having utf8 setting on causes screen to recode file passed to readreg. Adding -# `-e utf8` just after `readreg` causes screen to fail with `-X: copyreg: -# character, ^x, or (octal) \032 expected.` in place of fixing the issue. -defutf8 off diff --git a/tests/test_shells/test.sh b/tests/test_shells/test.sh index 69503eb4..351eb1cc 100755 --- a/tests/test_shells/test.sh +++ b/tests/test_shells/test.sh @@ -173,7 +173,6 @@ cp -r tests/test_shells/ipython_home tests/shell mkdir tests/shell/path ln -s "$(which "${PYTHON}")" tests/shell/path/python -ln -s "$(which screen)" tests/shell/path ln -s "$(which env)" tests/shell/path ln -s "$(which git)" tests/shell/path ln -s "$(which sleep)" tests/shell/path @@ -347,9 +346,8 @@ if test -z "${ONLY_SHELL}" || test "x${ONLY_SHELL%sh}" != "x${ONLY_SHELL}" || te if test "x$ONLY_TEST_CLIENT" != "x" && test "x$TEST_CLIENT" != "x$ONLY_TEST_CLIENT" ; then continue fi - POWERLINE_COMMAND_ARGS="--socket $ADDRESS" - POWERLINE_COMMAND="$POWERLINE_COMMAND" - export POWERLINE_COMMAND + export POWERLINE_COMMAND_ARGS="--socket $ADDRESS" + export POWERLINE_COMMAND="$POWERLINE_COMMAND" echo ">> powerline command is ${POWERLINE_COMMAND:-empty}" J=-1 for TEST_COMMAND in \ @@ -455,8 +453,8 @@ fi if test "x${ONLY_SHELL}" = "x" || test "x${ONLY_SHELL}" = "xipython" ; then if which ipython >/dev/null ; then # Define some overrides which should be ignored by IPython. - POWERLINE_CONFIG_OVERRIDES='common.term_escape_style=fbterm' - POWERLINE_THEME_OVERRIDES='in.segments.left=[]' + export POWERLINE_CONFIG_OVERRIDES='common.term_escape_style=fbterm' + export POWERLINE_THEME_OVERRIDES='in.segments.left=[]' echo "> $(which ipython)" if ! run_test ipython ipython ipython ; then FAILED=1 From 1e85f5df15adbe8d64b3eabb8eb7703423aa20b3 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 15:09:41 +0300 Subject: [PATCH 10/28] Disable vterm tests for PyPy completely --- tests/test_in_vterm/test.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_in_vterm/test.sh b/tests/test_in_vterm/test.sh index e042aac1..8cb61545 100755 --- a/tests/test_in_vterm/test.sh +++ b/tests/test_in_vterm/test.sh @@ -19,8 +19,9 @@ cp -r tests/terminfo tests/vterm FAIL_SUMMARY="" test_tmux() { - if test "$PYTHON_IMPLEMENTATION" = PyPy && test "$PYTHON_VERSION_MAJOR" -eq 3 ; then - # FIXME PyPy3 segfaults for some reason + if test "$PYTHON_IMPLEMENTATION" = PyPy; then + # FIXME PyPy3 segfaults for some reason, PyPy does it as well, but + # occasionally. return 0 fi if ! which "${POWERLINE_TMUX_EXE}" ; then From d53c780071039bdb827ee31f4014130bfef40092 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 15:18:59 +0300 Subject: [PATCH 11/28] Do not use absolute path for tmux socket Absolute path is too long when using tests in ebuild. --- tests/test_in_vterm/test_tmux.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_in_vterm/test_tmux.py b/tests/test_in_vterm/test_tmux.py index 9bbc3406..7d70fd3f 100755 --- a/tests/test_in_vterm/test_tmux.py +++ b/tests/test_in_vterm/test_tmux.py @@ -97,7 +97,7 @@ def test_expected_result(p, expected_result, cols, rows, print_logs): def main(attempts=3): vterm_path = os.path.join(VTERM_TEST_DIR, 'path') - socket_path = os.path.join(VTERM_TEST_DIR, 'tmux-socket') + socket_path = 'tmux-socket' rows = 50 cols = 200 @@ -233,7 +233,7 @@ def main(attempts=3): check_call([tmux_exe, '-S', socket_path, 'kill-server'], env={ 'PATH': vterm_path, 'LD_LIBRARY_PATH': os.environ.get('LD_LIBRARY_PATH', ''), - }) + }, cwd=VTERM_TEST_DIR) return main(attempts=(attempts - 1)) From bb6342c12a80c45866da0ea011b61bf7cc62b570 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 15:30:42 +0300 Subject: [PATCH 12/28] Tell tmux correct path to shell to use --- tests/test_in_vterm/test_tmux.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_in_vterm/test_tmux.py b/tests/test_in_vterm/test_tmux.py index 7d70fd3f..9841334f 100755 --- a/tests/test_in_vterm/test_tmux.py +++ b/tests/test_in_vterm/test_tmux.py @@ -161,7 +161,7 @@ def main(attempts=3): 'TERMINFO': os.path.join(VTERM_TEST_DIR, 'terminfo'), 'TERM': 'st-256color', 'PATH': vterm_path, - 'SHELL': os.path.join(''), + 'SHELL': os.path.join(VTERM_TEST_DIR, 'path', 'bash'), 'POWERLINE_CONFIG_PATHS': os.path.abspath('powerline/config_files'), 'POWERLINE_COMMAND': 'powerline-render', 'POWERLINE_THEME_OVERRIDES': ( From b2ecb8ca8421593f289b3a3486eb13aa4c76d52d Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 15:35:58 +0300 Subject: [PATCH 13/28] Do not append PYTHON to *_REPO paths $PYTHON variable is sometimes a full path which makes everything fail. It is also useless move since directories are destroyed after tests and running two test.sh scripts in parallel is not supported in any case. --- tests/test_lib.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_lib.py b/tests/test_lib.py index 8b2581ed..e6b28624 100644 --- a/tests/test_lib.py +++ b/tests/test_lib.py @@ -39,9 +39,9 @@ else: use_mercurial = True -GIT_REPO = 'git_repo' + os.environ.get('PYTHON', '') -HG_REPO = 'hg_repo' + os.environ.get('PYTHON', '') -BZR_REPO = 'bzr_repo' + os.environ.get('PYTHON', '') +GIT_REPO = 'git_repo' +HG_REPO = 'hg_repo' +BZR_REPO = 'bzr_repo' def thread_number(): From 0f86bbf8196634e2bef2eb3515fdb8c06e09762c Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 15:54:44 +0300 Subject: [PATCH 14/28] In place of running ipython executable run IPython module This should fix the problem with using wrong ipython for tests. --- tests/test_shells/test.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_shells/test.sh b/tests/test_shells/test.sh index 351eb1cc..f5d208a8 100755 --- a/tests/test_shells/test.sh +++ b/tests/test_shells/test.sh @@ -215,6 +215,8 @@ done ln -s python tests/shell/path/pdb PDB_PYTHON=pdb +ln -s python tests/shell/path/ipython +IPYTHON_PYTHON=ipython if test -z "$POWERLINE_RC_EXE" ; then if which rc-status >/dev/null ; then @@ -230,7 +232,7 @@ if which "$POWERLINE_RC_EXE" >/dev/null ; then ln -s "$(which $POWERLINE_RC_EXE)" tests/shell/path/rc fi -for exe in bash zsh busybox fish tcsh mksh dash ipython ; do +for exe in bash zsh busybox fish tcsh mksh dash ; do if which $exe >/dev/null ; then if test "$exe" = "fish" ; then fish_version="$(fish --version 2>&1)" @@ -451,12 +453,12 @@ if test "x${ONLY_SHELL}" = "x" || test "x${ONLY_SHELL}" = "xpdb" ; then fi if test "x${ONLY_SHELL}" = "x" || test "x${ONLY_SHELL}" = "xipython" ; then - if which ipython >/dev/null ; then + if "${PYTHON}" -c "try: import IPython${NL}except ImportError: raise SystemExit(1)" ; then # Define some overrides which should be ignored by IPython. export POWERLINE_CONFIG_OVERRIDES='common.term_escape_style=fbterm' export POWERLINE_THEME_OVERRIDES='in.segments.left=[]' echo "> $(which ipython)" - if ! run_test ipython ipython ipython ; then + if ! run_test ipython ipython ${IPYTHON_PYTHON} -mIPython ; then FAILED=1 FAIL_SUMMARY="${FAIL_SUMMARY}${NL}T ipython" fi From d5361337c1623643e82c5a3d2538ee643a58e507 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 16:08:50 +0300 Subject: [PATCH 15/28] Use script to test whether python zsh uses matches $PYTHON --- tests/test_shells/test.sh | 2 +- tests/test_shells/zsh_test_script.zsh | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/test_shells/zsh_test_script.zsh diff --git a/tests/test_shells/test.sh b/tests/test_shells/test.sh index f5d208a8..5e346806 100755 --- a/tests/test_shells/test.sh +++ b/tests/test_shells/test.sh @@ -421,7 +421,7 @@ fi if ( test "x${ONLY_SHELL}" = "x" || test "x${ONLY_SHELL}" = "xzsh" ) \ && ( test "x${ONLY_TEST_TYPE}" = "x" || test "x${ONLY_TEST_TYPE}" = "xzpython" ) \ - && zsh -f -c 'zmodload libzpython' 2>/dev/null; then + && zsh tests/test_shells/zsh_test_script.zsh 2>/dev/null; then echo "> zpython" if ! run_test zpython zpython zsh -f -i ; then FAILED=1 diff --git a/tests/test_shells/zsh_test_script.zsh b/tests/test_shells/zsh_test_script.zsh new file mode 100644 index 00000000..f4b894ce --- /dev/null +++ b/tests/test_shells/zsh_test_script.zsh @@ -0,0 +1,9 @@ +set -e +. tests/bot-ci/scripts/common/main.sh +zmodload zpython +zpython 'import platform' +zpython 'zsh.setvalue("ZSH_PYTHON_VERSION", platform.python_version())' +zpython 'zsh.setvalue("ZSH_PYTHON_IMPLEMENTATION", platform.python_implementation())' + +[[ $ZSH_PYTHON_IMPLEMENTATION = $PYTHON_IMPLEMENTATION ]] +[[ $ZSH_PYTHON_VERSION = $PYTHON_VERSION ]] From 0710f2760f7e21b8b29d6fdd6a58ecf8ac651217 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 16:11:04 +0300 Subject: [PATCH 16/28] Open log as binary file for writing Child output is binary. --- tests/test_shells/run_script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_shells/run_script.py b/tests/test_shells/run_script.py index f9b9248a..6c2b7ae6 100755 --- a/tests/test_shells/run_script.py +++ b/tests/test_shells/run_script.py @@ -98,7 +98,7 @@ def main(): child.wait() - with open(full_log_file_name, 'w') as LF: + with open(full_log_file_name, 'wb') as LF: LF.write(child.read()) check_call([ From 0a87b558d9415b26880ea7ca7fdfd790fa286ad4 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 16:50:25 +0300 Subject: [PATCH 17/28] Do not use child.wait(), it hangs --- tests/test_shells/run_script.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test_shells/run_script.py b/tests/test_shells/run_script.py index 6c2b7ae6..7d2e6157 100755 --- a/tests/test_shells/run_script.py +++ b/tests/test_shells/run_script.py @@ -12,6 +12,8 @@ from io import BytesIO import pexpect +from powerline.lib.monotonic import monotonic + def get_argparser(ArgumentParser=argparse.ArgumentParser): parser = ArgumentParser(description='Run powerline shell test using pexpect') @@ -96,7 +98,13 @@ def main(): sleep(1) # TODO Implement something more smart - child.wait() + start = monotonic() + while child.isalive(): + sleep(0.1) + if monotonic() - start > 60 * 3: + # Waiting for three minutes. This is long enough. + child.kill() + break with open(full_log_file_name, 'wb') as LF: LF.write(child.read()) From 7d98218b64f66c216d50556f1f41999420c1bb96 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 16:58:39 +0300 Subject: [PATCH 18/28] Do not wait, just .read() .read() without arguments should read until EOF is received. --- tests/test_shells/run_script.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/test_shells/run_script.py b/tests/test_shells/run_script.py index 7d2e6157..5819b577 100755 --- a/tests/test_shells/run_script.py +++ b/tests/test_shells/run_script.py @@ -12,8 +12,6 @@ from io import BytesIO import pexpect -from powerline.lib.monotonic import monotonic - def get_argparser(ArgumentParser=argparse.ArgumentParser): parser = ArgumentParser(description='Run powerline shell test using pexpect') @@ -98,14 +96,6 @@ def main(): sleep(1) # TODO Implement something more smart - start = monotonic() - while child.isalive(): - sleep(0.1) - if monotonic() - start > 60 * 3: - # Waiting for three minutes. This is long enough. - child.kill() - break - with open(full_log_file_name, 'wb') as LF: LF.write(child.read()) From 6a6991bcb4627b4878aa93dfd061aa50104cf211 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 17:11:11 +0300 Subject: [PATCH 19/28] Use 3 minutes for timeout --- tests/test_shells/run_script.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_shells/run_script.py b/tests/test_shells/run_script.py index 5819b577..7b0e4a65 100755 --- a/tests/test_shells/run_script.py +++ b/tests/test_shells/run_script.py @@ -82,6 +82,7 @@ def main(): args.command[1:], env=environ, logfile=sio, + timeout=60 * 3, ) child.expect(re.compile(b'.*')) sleep(0.5) From 38a05b34d78feb62acc2f6cd56d94de0a7062776 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 17:55:49 +0300 Subject: [PATCH 20/28] =?UTF-8?q?Do=20not=20use=20=E2=80=9Cwhich=20ipython?= =?UTF-8?q?=E2=80=9D=20in=20echo=20since=20it=20is=20no=20longer=20relevan?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_shells/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_shells/test.sh b/tests/test_shells/test.sh index 5e346806..00b2c9af 100755 --- a/tests/test_shells/test.sh +++ b/tests/test_shells/test.sh @@ -457,7 +457,7 @@ if test "x${ONLY_SHELL}" = "x" || test "x${ONLY_SHELL}" = "xipython" ; then # Define some overrides which should be ignored by IPython. export POWERLINE_CONFIG_OVERRIDES='common.term_escape_style=fbterm' export POWERLINE_THEME_OVERRIDES='in.segments.left=[]' - echo "> $(which ipython)" + echo "> ipython" if ! run_test ipython ipython ${IPYTHON_PYTHON} -mIPython ; then FAILED=1 FAIL_SUMMARY="${FAIL_SUMMARY}${NL}T ipython" From deee40505d9f3d90c660ed02b31820d6ad0f2626 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 17:56:13 +0300 Subject: [PATCH 21/28] Do not repeat `if` more times then needed --- tests/test_shells/postproc.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_shells/postproc.py b/tests/test_shells/postproc.py index d544bf83..96ab9ee9 100755 --- a/tests/test_shells/postproc.py +++ b/tests/test_shells/postproc.py @@ -31,6 +31,10 @@ user = os.environ['USER'] REFS_RE = re.compile(r'^\[\d+ refs\]\n') IPYPY_DEANSI_RE = re.compile(r'\033(?:\[(?:\?\d+[lh]|[^a-zA-Z]+[a-ln-zA-Z])|[=>])') +start_str = 'cd tests/shell/3rd' +if shell == 'pdb': + start_str = 'class Foo(object):' + with codecs.open(fname, 'r', encoding='utf-8') as R: with codecs.open(new_fname, 'w', encoding='utf-8') as W: found_cd = False @@ -38,11 +42,7 @@ with codecs.open(fname, 'r', encoding='utf-8') as R: for line in (R if shell != 'fish' else R.read().split('\n')): i += 1 if not found_cd: - found_cd = ( - 'class Foo(object):' in line - if shell == 'pdb' else - 'cd tests/shell/3rd' in line - ) + found_cd = (start_str in line) continue if 'true is the last line' in line: break From b7c7d29aa048a5e1085a2070b215ce1503111d6b Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 18:05:04 +0300 Subject: [PATCH 22/28] =?UTF-8?q?Use=20=E2=80=9Cnon-blocking=E2=80=9D=20re?= =?UTF-8?q?ad=20and=20stop=20on=20TIMEOUT=20and=20EOF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_shells/run_script.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test_shells/run_script.py b/tests/test_shells/run_script.py index 7b0e4a65..817378e1 100755 --- a/tests/test_shells/run_script.py +++ b/tests/test_shells/run_script.py @@ -98,7 +98,15 @@ def main(): # TODO Implement something more smart with open(full_log_file_name, 'wb') as LF: - LF.write(child.read()) + while True: + try: + s = child.read_nonblocking(1000) + except pexpect.TIMEOUT: + break + except pexpect.EOF: + break + else: + LF.write(s) check_call([ os.path.join('tests', 'shell', 'path', 'python'), From 678faed4c2ef99f989f84a68bc9a55648f810ffe Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 18:15:39 +0300 Subject: [PATCH 23/28] Force destroying child after everything was done Normally this line should not do anything useful. --- tests/test_shells/run_script.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_shells/run_script.py b/tests/test_shells/run_script.py index 817378e1..0d7aad7d 100755 --- a/tests/test_shells/run_script.py +++ b/tests/test_shells/run_script.py @@ -108,6 +108,8 @@ def main(): else: LF.write(s) + child.close(force=True) + check_call([ os.path.join('tests', 'shell', 'path', 'python'), os.path.join('tests', 'test_shells', 'postproc.py'), From 74e81bf788a2c1c93198ee7d2c790cb970915f14 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 18:17:23 +0300 Subject: [PATCH 24/28] Restore the timeout There may be a reason for a test to take 3 minutes long, but there is no reason for the test to take even half a minute long *without any output*. --- tests/test_shells/run_script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_shells/run_script.py b/tests/test_shells/run_script.py index 0d7aad7d..3d5eddd5 100755 --- a/tests/test_shells/run_script.py +++ b/tests/test_shells/run_script.py @@ -82,7 +82,7 @@ def main(): args.command[1:], env=environ, logfile=sio, - timeout=60 * 3, + timeout=30, ) child.expect(re.compile(b'.*')) sleep(0.5) From 9a89d4defa8ea8a3c58084b199f6953ef9485350 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 18:20:20 +0300 Subject: [PATCH 25/28] Do not special-case PyPy+ipython --- tests/test_shells/test.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/test_shells/test.sh b/tests/test_shells/test.sh index 00b2c9af..60347387 100755 --- a/tests/test_shells/test.sh +++ b/tests/test_shells/test.sh @@ -79,10 +79,6 @@ do_run_test() { local wait_for_echo_arg= if ( \ test "x${SH}" = "xdash" \ - || ( \ - test "x${SH}" = "xipython" \ - && test "$PYTHON_IMPLEMENTATION" = "PyPy" \ - ) \ || ( \ test "x${SH}" = "xpdb" \ && ( \ From 0058919c2b14023bfdb8f30141d7640692f57ebe Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 18:44:01 +0300 Subject: [PATCH 26/28] Remove blank lines from pdb output It is the problem that causes python-3.2 pdb tests to fail on travis. --- tests/test_shells/postproc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_shells/postproc.py b/tests/test_shells/postproc.py index 96ab9ee9..42b402a3 100755 --- a/tests/test_shells/postproc.py +++ b/tests/test_shells/postproc.py @@ -118,4 +118,6 @@ with codecs.open(fname, 'r', encoding='utf-8') as R: line = '' elif line == '-> self.quitting = 1\n': line = '-> self.quitting = True\n' + elif line == '\n': + line = '' W.write(line) From 68b43c59beca4c018bccdb63fcb1bb55195201cb Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 18:53:32 +0300 Subject: [PATCH 27/28] Disable pdb PyPy tests completely They currently fail for the reason that does not seem related to powerline (though this problem did not occur before porting tests to pexpect, so this should be somewhat related (somewhat: PyPy fails on code `return br'\u%04x' % ord(c)` which is no a valid Python code (`%` can no longer be used with `bytes()` obects), the whole situation only means that before using pexpect bug in PyPy was not hit)). --- tests/test_shells/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_shells/test.sh b/tests/test_shells/test.sh index 60347387..8d7bef16 100755 --- a/tests/test_shells/test.sh +++ b/tests/test_shells/test.sh @@ -426,7 +426,7 @@ if ( test "x${ONLY_SHELL}" = "x" || test "x${ONLY_SHELL}" = "xzsh" ) \ fi if test "x${ONLY_SHELL}" = "x" || test "x${ONLY_SHELL}" = "xpdb" ; then - if ! ( test "$PYTHON_IMPLEMENTATION" = "PyPy" && test "$PYTHON_VERSION_MAJOR" = 2 ) ; then + if test "$PYTHON_IMPLEMENTATION" != "PyPy" ; then if test "x${ONLY_TEST_TYPE}" = "x" || test "x${ONLY_TEST_TYPE}" = "xsubclass" ; then echo "> pdb subclass" if ! run_test subclass python $PDB_PYTHON "$PWD/tests/test_shells/pdb-main.py" ; then From 3bf484de25cc77b0fc8f04e77f3993f4c1e939a8 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 21 Feb 2015 19:02:37 +0300 Subject: [PATCH 28/28] Break on self.quitting line This may also cause python-3.2 pdb test to error out. --- tests/test_shells/postproc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_shells/postproc.py b/tests/test_shells/postproc.py index 42b402a3..0646684e 100755 --- a/tests/test_shells/postproc.py +++ b/tests/test_shells/postproc.py @@ -120,4 +120,6 @@ with codecs.open(fname, 'r', encoding='utf-8') as R: line = '-> self.quitting = True\n' elif line == '\n': line = '' + if line == '-> self.quitting = True\n': + break W.write(line)