summaryrefslogtreecommitdiffstats
path: root/runtest.py
diff options
context:
space:
mode:
authoranatoly techtonik <techtonik@gmail.com>2014-03-07 12:40:44 (GMT)
committeranatoly techtonik <techtonik@gmail.com>2014-03-07 12:40:44 (GMT)
commit921286ae723f31832515508030b92c3e1ff98f66 (patch)
tree965c482020d65a7bb7456b79b8a838bcb7f4d344 /runtest.py
parent4c5afd028828a6908b788e67516c1f4aeaec2fb2 (diff)
downloadSCons-921286ae723f31832515508030b92c3e1ff98f66.zip
SCons-921286ae723f31832515508030b92c3e1ff98f66.tar.gz
SCons-921286ae723f31832515508030b92c3e1ff98f66.tar.bz2
runtest.py: Clarify code a bit
Diffstat (limited to 'runtest.py')
-rwxr-xr-xruntest.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/runtest.py b/runtest.py
index 2e34969..393c880 100755
--- a/runtest.py
+++ b/runtest.py
@@ -641,9 +641,13 @@ if old_pythonpath:
if python3incompatibilities:
os.environ['SCONS_HORRIBLE_REGRESSION_TEST_HACK'] = '1'
+
+# ---[ test discovery ]------------------------------------
+
tests = []
def find_Tests_py(directory):
+ """ Look for unit tests """
result = []
for dirpath, dirnames, filenames in os.walk(directory):
# Skip folders containing a sconstest.skip file
@@ -655,6 +659,7 @@ def find_Tests_py(directory):
return sorted(result)
def find_py(directory):
+ """ Look for module tests """
result = []
for dirpath, dirnames, filenames in os.walk(directory):
# Skip folders containing a sconstest.skip file
@@ -677,17 +682,20 @@ if args:
for path in glob.glob(a):
if os.path.isdir(path):
if path[:3] == 'src':
- tests.extend(find_Tests_py(path))
-
+ for p in find_Tests_py(path):
+ tests.append(p)
elif path[:4] == 'test':
- tests.extend(find_py(path))
+ for p in find_py(path):
+ tests.append(p)
else:
tests.append(path)
+
elif testlistfile:
tests = open(testlistfile, 'r').readlines()
tests = [x for x in tests if x[0] != '#']
tests = [x[:-1] for x in tests]
tests = [x.strip() for x in tests]
+
elif options.all:
# Find all of the SCons functional tests in the local directory
# tree. This is anything under the 'src' subdirectory that ends
@@ -711,6 +719,8 @@ runtest.py: No tests were found.
sys.exit(1)
+# ---[ test processing ]-----------------------------------
+
tests = [Test(t) for t in tests]
if list_only: