Commits

Doug Hellmann committed 4245b88

reorg test runner to remove redundant test runs

Comments (0)

Files changed (34)

 
 #set -x
 
-if [ -z "$TOXIC" ]
-then
-    echo "Only run this via tox" 1>&2
-    exit 1
-fi
-
 envdir="$1"
 shift
 scripts="$*"
     fi
 fi
 
-# Make sure the test shells exist before proceeding, otherwise tests are
-# going to fail later.
-DESIRED_SHELLS=${DESIRED_SHELLS:-"bash zsh ksh"}
-missing_shells=""
-test_shells=""
-for shell in $DESIRED_SHELLS
-do
-    if test_shell=$(which $shell); then
-        test_shells="$test_shells $test_shell"
-    else
-        missing_shells="$missing_shells $shell"
-    fi
-done
-if [ -n "$missing_shells" ]
-then
-    echo "Couldn't find the following shells: $missing_shells" 1>&2
-    exit 1
-fi
-
 # Force the tox virtualenv to be active.
 #
 # Since this script runs from within a separate shell created by tox,
 # are *not* inherited.
 #
 source "$envdir/bin/activate"
+TMPDIR="$envdir/tmp"
+export TMPDIR
+mkdir -p "$TMPDIR"
 
 # Set up virtualenvwrapper.hook_loader to print more details than usual for debugging.
 #export HOOK_VERBOSE_OPTION=-vvv
-export HOOK_VERBOSE_OPTION="-q"
+HOOK_VERBOSE_OPTION="-q"
+export HOOK_VERBOSE_OPTION
 
 # Force virtualenvwrapper to use the python interpreter in the
 # tox-created virtualenv.
-export VIRTUALENVWRAPPER_PYTHON="$envdir/bin/python"
+VIRTUALENVWRAPPER_PYTHON="$envdir/bin/python"
+export VIRTUALENVWRAPPER_PYTHON
 
 # Clear any user settings for the hook directory or log directory
 unset VIRTUALENVWRAPPER_HOOK_DIR
 for test_script in $scripts
 do
 
-    for test_shell in $test_shells
-    do
-        unset BASH
-        unset ZSH_VERSION
-        test_shell_opts=
-        case /$test_shell in
-            */zsh) test_shell_opts="-o shwordsplit" ;;
-        esac
-        export test_shell
-        export SHELL=$(which $test_shell)
+    echo
+    echo '********************************************************************************'
+    echo "Running $test_script"
+    echo "  VIRTUAL_ENV=$VIRTUAL_ENV"
+    echo "  VIRTUALENVWRAPPER_PYTHON=$VIRTUALENVWRAPPER_PYTHON"
+    echo "    $($VIRTUALENVWRAPPER_PYTHON -V 2>&1)"
+    echo "  PYTHONPATH=$PYTHONPATH"
+    echo "  SHELL=$SHELL"
+    echo "  BASH_VERSION=$BASH_VERSION"
+    echo "  ZSH_VERSION=$ZSH_VERSION"
+    echo "  KSH_VERSION=$KSH_VERSION"
+    echo "  virtualenv=$(which virtualenv)"
+    echo
+    SHUNIT_PARENT="$test_script"
+    export SHUNIT_PARENT
+    $test_shell_opts $test_script || exit 1
+    echo
 
-        echo
-        echo '********************************************************************************'
-        echo "Running $test_script"
-        echo "  VIRTUAL_ENV=$VIRTUAL_ENV"
-        echo "  VIRTUALENVWRAPPER_PYTHON=$VIRTUALENVWRAPPER_PYTHON"
-        echo "    $($VIRTUALENVWRAPPER_PYTHON -V 2>&1)"
-        echo "  PYTHONPATH=$PYTHONPATH"
-        echo "  SHELL=$test_shell"
-        echo "  virtualenv=$(which virtualenv)"
-        echo
-        export SHUNIT_PARENT="$test_script"
-        $test_shell $test_shell_opts $test_script || exit 1
-        echo
-    done
 done
 
 exit 0

File contents unchanged.

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_add2virtualenv.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"
-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"
-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_cpvirtualenv.sh

-#venv!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_deactivate.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_derive_workon_home.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_dir_stack.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_expandpath.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_hook_dir.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_lazy.sh

+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_lazy_loaded.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_lazy_run.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_log_file.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"
-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_mktmpenv.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_mkvirtualenv.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_mkvirtualenv_associate.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_mkvirtualenv_install.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_mkvirtualenv_requirements.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_project.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(dirname $0)
 source "$test_dir/setup.sh"

tests/test_project_activate.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(dirname $0)
 source "$test_dir/setup.sh"

tests/test_project_cd.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(dirname $0)
 source "$test_dir/setup.sh"

tests/test_project_mk.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(dirname $0)
 source "$test_dir/setup.sh"

tests/test_project_templates.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(dirname $0)
 source "$test_dir/setup.sh"

tests/test_rmvirtualenv.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_run_hook.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_support.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_tempfile.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_toggleglobalsitepackages.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"

tests/test_workon.sh

-#!/bin/sh
+# -*- mode: shell-script -*-
 
 test_dir=$(cd $(dirname $0) && pwd)
 source "$test_dir/setup.sh"
 [tox]
-envlist = py27,py26,py32,style
+envlist = py27,py26,py32,py33,zsh,ksh,style
 
 [testenv]
 commands = bash ./tests/run_tests {envdir} []
 deps = flake8
 commands = flake8 virtualenvwrapper docs/source/conf.py
 
+[testenv:py27]
+setenv = 
+  SHELL = /bin/bash
+commands =  bash ./tests/run_tests {envdir} []
 
-# Not sure why this is needed, but on my system if it isn't included then
-# the python version picked up for 2.6 is actually 2.7.
+# Not sure why the basepython setting is needed, but on my system if
+# it isn't included then the python version picked up for 2.6 is
+# actually 2.7.
+#
 # IF THIS CAUSES YOU A PROBLEM COMMENT IT OUT BEFORE RUNNING THE TESTS.
+#
 [testenv:py26]
-#basepython=/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
 basepython=python2.6
+setenv = 
+  SHELL = /bin/bash
+commands =  bash ./tests/run_tests {envdir} []
+
+[testenv:py32]
+setenv = 
+  SHELL = /bin/bash
+commands =  bash ./tests/run_tests {envdir} []
+
+[testenv:py33]
+setenv = 
+  SHELL = /bin/bash
+commands =  bash ./tests/run_tests {envdir} []
+
+[testenv:zsh]
+basepython=python2.7
+setenv = 
+  SHELL = /bin/zsh
+commands =  zsh -o shwordsplit ./tests/run_tests {envdir} []
+
+[testenv:ksh]
+basepython=python2.7
+setenv = 
+  SHELL = /bin/ksh
+commands =  ksh ./tests/run_tests {envdir} []
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.