summaryrefslogtreecommitdiff
path: root/test/CheckManpage.py
diff options
context:
space:
mode:
authorAlexis Hildebrandt <afh@surryhill.net>2015-01-21 06:50:56 +0100
committerAlexis Hildebrandt <afh@surryhill.net>2015-01-21 08:03:53 +0100
commitc7a30bf7d8e2b79624925a6f27281a0297217398 (patch)
tree74b0a446d98ffaa4b49ea6c500d73552d73f54b2 /test/CheckManpage.py
parent213f0341c1559bad2e873c309247b4de8acfa746 (diff)
downloadfork-ledger-c7a30bf7d8e2b79624925a6f27281a0297217398.tar.gz
fork-ledger-c7a30bf7d8e2b79624925a6f27281a0297217398.tar.bz2
fork-ledger-c7a30bf7d8e2b79624925a6f27281a0297217398.zip
[tests] Refactor CheckTests.py into custom scripts
Diffstat (limited to 'test/CheckManpage.py')
-rwxr-xr-xtest/CheckManpage.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/CheckManpage.py b/test/CheckManpage.py
new file mode 100755
index 00000000..6b0f2476
--- /dev/null
+++ b/test/CheckManpage.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 CheckManpage (CheckOptions):
+ def __init__(self, args):
+ CheckOptions.__init__(self, args)
+ self.option_pattern = '\.It Fl \\\\-([-A-Za-z]+)'
+ self.source_file = join(self.source, 'doc', 'ledger.1')
+ self.source_type = 'manpage'
+
+if __name__ == "__main__":
+ def getargs():
+ parser = argparse.ArgumentParser(prog='CheckManpage',
+ description='Check that ledger options are documented in the manpage')
+ 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 = CheckManpage(args)
+ status = script.main()
+ sys.exit(status)