Browse Source

tests: Stop invoking python just to get the real source directory

While we're at it, stop checking for a seven-year-old version of nose --
we already list a newer version in test-requirements.txt anyway.

Change-Id: I97beace3094f11286730b99653dc1e8f699c5aec
tags/2.24.0
Tim Burke 8 months ago
parent
commit
86952dd3ed
4 changed files with 5 additions and 13 deletions
  1. +1
    -1
      .alltests
  2. +1
    -1
      .functests
  3. +1
    -1
      .probetests
  4. +2
    -10
      .unittests

+ 1
- 1
.alltests View File

@@ -2,7 +2,7 @@

set -e

TOP_DIR=$(python -c "import os; print os.path.dirname(os.path.realpath('$0'))")
TOP_DIR=$(dirname $(realpath "$0"))

echo "==== Unit tests ===="
resetswift


+ 1
- 1
.functests View File

@@ -3,7 +3,7 @@
# How-To debug functional tests:
# SWIFT_TEST_IN_PROCESS=1 tox -e func -- --pdb test.functional.tests.TestFile.testCopy

SRC_DIR=$(python -c "import os; print(os.path.dirname(os.path.realpath('$0')))")
SRC_DIR=$(dirname $(realpath "$0"))

cd ${SRC_DIR} > /dev/null
export TESTS_DIR=${SRC_DIR}/test/functional


+ 1
- 1
.probetests View File

@@ -1,6 +1,6 @@
#!/bin/bash

SRC_DIR=$(python -c "import os; print(os.path.dirname(os.path.realpath('$0')))")
SRC_DIR=$(dirname $(realpath "$0"))

cd ${SRC_DIR}/test/probe
nosetests --exe $@


+ 2
- 10
.unittests View File

@@ -1,17 +1,9 @@
#!/bin/bash

TOP_DIR=$(python -c "import os; print(os.path.dirname(os.path.realpath('$0')))")
TOP_DIR=$(dirname $(realpath "$0"))

python -c 'from distutils.version import LooseVersion as Ver; import nose, sys; sys.exit(0 if Ver(nose.__version__) >= Ver("1.2.0") else 1)'
if [ $? != 0 ]; then
cover_branches=""
else
# Having the HTML reports is REALLY useful for achieving 100% branch
# coverage.
cover_branches="--cover-branches --cover-html --cover-html-dir=$TOP_DIR/cover"
fi
cd $TOP_DIR/test/unit
nosetests --exe --with-coverage --cover-package swift --cover-erase $cover_branches $@
nosetests --exe --with-coverage --cover-package swift --cover-erase --cover-branches --cover-html --cover-html-dir="$TOP_DIR"/cover $@
rvalue=$?
rm -f .coverage
cd -


Loading…
Cancel
Save