Commit 41e836ec authored by Stefan H. Holek's avatar Stefan H. Holek

Print path that is actually scanned for tests, not libdir.

parent 7f7ee064
...@@ -377,15 +377,19 @@ class PathInit: ...@@ -377,15 +377,19 @@ class PathInit:
sys.path.insert(0, os.path.join(self.home, self.libdir)) sys.path.insert(0, os.path.join(self.home, self.libdir))
self.cwd = os.path.realpath(os.getcwd()) self.cwd = os.path.realpath(os.getcwd())
# Hack again for external products. # Hack again for external products.
global functional
kind = functional and "functional" or "unit"
if libdir: if libdir:
self.libdir = os.path.realpath(os.path.join(self.cwd, libdir)) self.libdir = os.path.realpath(os.path.join(self.cwd, libdir))
else: else:
self.libdir = os.path.realpath(os.path.join(self.cwd, self.libdir)) self.libdir = os.path.realpath(os.path.join(self.cwd, self.libdir))
if self.libdir not in sys.path: if self.libdir not in sys.path:
sys.path.insert(0, self.libdir) sys.path.insert(0, self.libdir)
print "Running %s tests from %s" % (kind, self.libdir) # Determine where to look for tests
if test_dir:
self.testdir = os.path.abspath(os.path.join(self.cwd, test_dir))
else:
self.testdir = self.libdir
kind = functional and "functional" or "unit"
print "Running %s tests from %s" % (kind, self.testdir)
def match(rx, s): def match(rx, s):
if not rx: if not rx:
...@@ -470,11 +474,7 @@ class TestFileFinder: ...@@ -470,11 +474,7 @@ class TestFileFinder:
def find_tests(rx): def find_tests(rx):
global finder global finder
finder = TestFileFinder(pathinit.libdir) finder = TestFileFinder(pathinit.libdir)
if test_dir: walk_with_symlinks(pathinit.testdir, finder.visit, rx)
walkdir = os.path.abspath(os.path.join(pathinit.cwd, test_dir))
else:
walkdir = pathinit.libdir
walk_with_symlinks(walkdir, finder.visit, rx)
return finder.files return finder.files
def package_import(modname): def package_import(modname):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment