diff options
author | Craig Earls <enderw88@gmail.com> | 2015-01-21 22:03:11 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2015-01-21 22:03:11 -0700 |
commit | 28b0d6756785b5d36ae73c4614a9295d9697041a (patch) | |
tree | 20257fd9d99acc7a9d55a655e078a95a12f6e577 /test/CheckBaselineTests.py | |
parent | a65033b66cc084ca0c40538a9aa0e243cc32ab8c (diff) | |
parent | bec52e3221d74ce3bf1383b245beae5a6214e387 (diff) | |
download | fork-ledger-28b0d6756785b5d36ae73c4614a9295d9697041a.tar.gz fork-ledger-28b0d6756785b5d36ae73c4614a9295d9697041a.tar.bz2 fork-ledger-28b0d6756785b5d36ae73c4614a9295d9697041a.zip |
Merge commit 'bec52e3221d74ce3bf1383b245beae5a6214e387' into next
Conflicts:
lisp/ledger-reconcile.el
Diffstat (limited to 'test/CheckBaselineTests.py')
-rwxr-xr-x | test/CheckBaselineTests.py | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/test/CheckBaselineTests.py b/test/CheckBaselineTests.py new file mode 100755 index 00000000..404c12db --- /dev/null +++ b/test/CheckBaselineTests.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from __future__ import print_function + +import sys +import re +import os +import argparse + +from os.path import * +from subprocess import Popen, PIPE + +from CheckOptions import CheckOptions + +class CheckBaselineTests (CheckOptions): + def __init__(self, args): + CheckOptions.__init__(self, args) + self.missing_baseline_tests = set() + + def main(self): + for option in self.ledger_options(): + if option in self.untested_options: continue + baseline_testpath = join(self.source, 'test', 'baseline', 'opt-%s.test' % option) + if exists(baseline_testpath) and getsize(baseline_testpath) > 0: continue + self.missing_baseline_tests.add(option) + + if len(self.missing_baseline_tests): + print("Missing Baseline test for:%s%s\n" % (self.sep, self.sep.join(sorted(list(self.missing_baseline_tests))))) + + errors = len(self.missing_baseline_tests) + return errors + +if __name__ == "__main__": + def getargs(): + parser = argparse.ArgumentParser(prog='CheckBaselineTests', + description='Check that ledger options are tested') + parser.add_argument('-l', '--ledger', + dest='ledger', + type=str, + action='store', + required=True, + help='the path to the ledger executable to test with') + parser.add_argument('-s', '--source', + dest='source', + type=str, + action='store', + required=True, + help='the path to the top level ledger source directory') + return parser.parse_args() + + args = getargs() + script = CheckBaselineTests(args) + status = script.main() + sys.exit(status) |