summaryrefslogtreecommitdiff
path: root/runtest.py
diff options
context:
space:
mode:
authorGreg Noel <GregNoel@tigris.org>2009-05-08 10:24:48 +0000
committerGreg Noel <GregNoel@tigris.org>2009-05-08 10:24:48 +0000
commit45a71ac9868993e5d02bfcc62ab376bf2c0b263b (patch)
tree1716befd7a66af8158060db230b28b8b8d16de50 /runtest.py
parent83b72a3b6946245fd192fc96379381538a3171cc (diff)
downloadscons-45a71ac9868993e5d02bfcc62ab376bf2c0b263b.tar.gz
Issue 2306: Exclude non-test files from regression tests. While runtest.py
was opened, changed two unnecessary absolute paths to relative.
Diffstat (limited to 'runtest.py')
-rw-r--r--runtest.py25
1 files changed, 16 insertions, 9 deletions
diff --git a/runtest.py b/runtest.py
index 462aff99..53f6e5be 100644
--- a/runtest.py
+++ b/runtest.py
@@ -609,16 +609,23 @@ elif all and not qmtest:
def find_Tests_py(tdict, dirname, names):
for n in filter(lambda n: n[-8:] == "Tests.py", names):
- t = os.path.join(dirname, n)
- if not tdict.has_key(t):
- tdict[t] = 1
+ tdict[os.path.join(dirname, n)] = 1
os.path.walk('src', find_Tests_py, tdict)
def find_py(tdict, dirname, names):
- for n in filter(lambda n: n[-3:] == ".py", names):
- t = os.path.join(dirname, n)
- if not tdict.has_key(t):
- tdict[t] = 1
+ tests = filter(lambda n: n[-3:] == ".py", names)
+ try:
+ excludes = open(os.path.join(dirname,".exclude_tests")).readlines()
+ except (OSError, IOError):
+ pass
+ else:
+ for exclude in excludes:
+ exclude = string.split(exclude, '#' , 1)[0]
+ exclude = string.strip(exclude)
+ if not exclude: continue
+ tests = filter(lambda n, ex = exclude: n != ex, tests)
+ for n in tests:
+ tdict[os.path.join(dirname, n)] = 1
os.path.walk('test', find_py, tdict)
if format == '--aegis' and aegis:
@@ -711,7 +718,7 @@ sys.stdout = Unbuffered(sys.stdout)
if list_only:
for t in tests:
- sys.stdout.write(t.abspath + "\n")
+ sys.stdout.write(t.path + "\n")
sys.exit(0)
#
@@ -740,7 +747,7 @@ for t in tests:
t.command_args = [python, '-tt']
if debug:
t.command_args.append(debug)
- t.command_args.append(t.abspath)
+ t.command_args.append(t.path)
t.command_str = string.join(map(escape, t.command_args), " ")
if printcommand:
sys.stdout.write(t.command_str + "\n")