From eb5169485d676628d130037efc7198b5fbfba1f8 Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Fri, 7 Mar 2014 15:40:44 +0300 Subject: runtest.py: Clarify code a bit --- runtest.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'runtest.py') 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: -- cgit v1.2.1