From c7a30bf7d8e2b79624925a6f27281a0297217398 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Wed, 21 Jan 2015 06:50:56 +0100 Subject: [tests] Refactor CheckTests.py into custom scripts --- test/CheckTexinfo.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 test/CheckTexinfo.py (limited to 'test/CheckTexinfo.py') diff --git a/test/CheckTexinfo.py b/test/CheckTexinfo.py new file mode 100755 index 00000000..c289da68 --- /dev/null +++ b/test/CheckTexinfo.py @@ -0,0 +1,44 @@ +#!/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 CheckTexinfo (CheckOptions): + def __init__(self, args): + CheckOptions.__init__(self, args) + self.option_pattern = '@item --([-A-Za-z]+).*@c option' + self.source_file = join(self.source, 'doc', 'ledger3.texi') + self.source_type = 'texinfo' + +if __name__ == "__main__": + def getargs(): + parser = argparse.ArgumentParser(prog='CheckTexinfo', + description='Check that ledger options are documented in the texinfo manual') + 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 = CheckTexinfo(args) + status = script.main() + sys.exit(status) -- cgit v1.2.3