diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-22 03:10:19 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-22 03:10:19 -0400 |
commit | 7da270129547aebd84ac0fde63b796f8add8e89a (patch) | |
tree | 527981b9a420d9e1fdc8336cba23b603e589facc /test/RegressTests.py | |
parent | 81bf38584e43e5fc31e316246f11e210418548a9 (diff) | |
download | fork-ledger-7da270129547aebd84ac0fde63b796f8add8e89a.tar.gz fork-ledger-7da270129547aebd84ac0fde63b796f8add8e89a.tar.bz2 fork-ledger-7da270129547aebd84ac0fde63b796f8add8e89a.zip |
Regression and generate tests now fail properly
Diffstat (limited to 'test/RegressTests.py')
-rwxr-xr-x | test/RegressTests.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/test/RegressTests.py b/test/RegressTests.py index 73a05d52..f693bf5b 100755 --- a/test/RegressTests.py +++ b/test/RegressTests.py @@ -154,18 +154,22 @@ class RegressFile(object): if not use_stdin: os.remove(tempdata[1]) - def run_tests(self, pool): + def run_tests(self): test = self.read_test() while test: - if pool: - pool.apply_async(RegressFile.run_test, (self, test,)) - else: - self.run_test(test) + self.run_test(test) test = self.read_test(test) + return harness.failed def close(self): self.fd.close() +def do_test(path): + entry = RegressFile(path) + failed = entry.run_tests() + entry.close() + return failed + if __name__ == '__main__': if multiproc: pool = Pool(jobs*2) @@ -173,17 +177,16 @@ if __name__ == '__main__': pool = None if os.path.isdir(tests): - for test_file in os.listdir(tests): - if re.search('\.test$', test_file): - entry = RegressFile(os.path.join(tests, test_file)) - entry.run_tests(pool) - entry.close() + tests = [os.path.join(tests, x) + for x in os.listdir(tests) if x.endswith('.test')] + harness.failed = sum(pool.map(do_test, tests, 1)) else: entry = RegressFile(tests) - entry.run_tests(pool) + entry.run_tests() entry.close() if pool: pool.close() pool.join() + harness.exit() |