summaryrefslogtreecommitdiff
path: root/runtest.py
diff options
context:
space:
mode:
authoranatoly techtonik <techtonik@gmail.com>2014-03-07 15:40:44 +0300
committeranatoly techtonik <techtonik@gmail.com>2014-03-07 15:40:44 +0300
commiteb5169485d676628d130037efc7198b5fbfba1f8 (patch)
tree965c482020d65a7bb7456b79b8a838bcb7f4d344 /runtest.py
parent623329c4367ae0b54512cc6008221559d82784d9 (diff)
downloadscons-eb5169485d676628d130037efc7198b5fbfba1f8.tar.gz
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 2e349699..393c8801 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: