summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/CheckTests.py80
-rw-r--r--test/baseline/opt-actual-dates.test0
-rw-r--r--test/baseline/opt-budget-format.test0
-rw-r--r--test/baseline/opt-cleared-format.test0
-rw-r--r--test/baseline/opt-count.test0
-rw-r--r--test/baseline/opt-date.test0
-rw-r--r--test/baseline/opt-datetime-format.test0
-rw-r--r--test/baseline/opt-decimal-comma.test0
-rw-r--r--test/baseline/opt-forecast-years.test0
-rw-r--r--test/baseline/opt-generated.test0
-rw-r--r--test/baseline/opt-group-by.test0
-rw-r--r--test/baseline/opt-group-title-format.test0
-rw-r--r--test/baseline/opt-meta-width.test0
-rw-r--r--test/baseline/opt-meta.test0
-rw-r--r--test/baseline/opt-no-rounding.test0
-rw-r--r--test/baseline/opt-no-titles.test0
-rw-r--r--test/baseline/opt-now.test0
-rw-r--r--test/baseline/opt-pivot.test0
-rw-r--r--test/baseline/opt-prepend-format.test0
-rw-r--r--test/baseline/opt-prepend-width.test0
20 files changed, 80 insertions, 0 deletions
diff --git a/test/CheckTests.py b/test/CheckTests.py
new file mode 100755
index 00000000..225d4a8d
--- /dev/null
+++ b/test/CheckTests.py
@@ -0,0 +1,80 @@
+#!/usr/bin/env python
+
+import sys
+import re
+import os
+
+from os.path import *
+from subprocess import Popen, PIPE
+
+ledger_binary = sys.argv[1]
+source_topdir = sys.argv[2]
+
+documented_options = []
+for line in open(join(source_topdir, 'doc', 'ledger.1')):
+ match = re.match('\.It Fl \\\\-([-A-Za-z]+)', line)
+ if match:
+ option = match.group(1)
+ if option not in documented_options:
+ documented_options.append(option)
+
+pipe = Popen('%s --debug option.names parse true' % ledger_binary,
+ shell=True, stdout=PIPE, stderr=PIPE)
+errors = 0
+
+untested_options = [
+ 'anon',
+ 'args-only',
+ 'cache',
+ 'debug',
+ 'download',
+ 'file',
+ 'force-color',
+ 'force-pager',
+ 'full-help',
+ 'help',
+ 'help-calc',
+ 'help-comm',
+ 'help-disp',
+ 'import',
+ 'init-file',
+ 'no-color',
+ 'options',
+ 'price-db',
+ 'price-exp',
+ 'revalued-total',
+ 'script',
+ 'seed',
+ 'trace',
+ 'verbose',
+ 'verify',
+ 'version'
+]
+
+for line in pipe.stderr:
+ match = re.search('\[DEBUG\] Option: (.*)', line)
+ if match:
+ option = match.group(1)
+
+ option = re.sub('_', '-', option)
+ option = re.sub('-$', '', option)
+
+ if option not in untested_options and \
+ not exists(join(source_topdir, 'test', 'baseline',
+ 'opt-%s.test' % option)):
+ print "Baseline test missing for --%s" % option
+ errors += 1
+
+ if option not in documented_options:
+ print "Man page entry missing for --%s" % option
+ errors += 1
+ else:
+ documented_options.remove(option)
+
+known_alternates = [ 'cost', 'first', 'last', 'leeway', 'period-sort' ]
+
+for option in documented_options:
+ if option not in known_alternates:
+ print "Man page entry for unknown option --%s" % option
+
+sys.exit(errors)
diff --git a/test/baseline/opt-actual-dates.test b/test/baseline/opt-actual-dates.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-actual-dates.test
diff --git a/test/baseline/opt-budget-format.test b/test/baseline/opt-budget-format.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-budget-format.test
diff --git a/test/baseline/opt-cleared-format.test b/test/baseline/opt-cleared-format.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-cleared-format.test
diff --git a/test/baseline/opt-count.test b/test/baseline/opt-count.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-count.test
diff --git a/test/baseline/opt-date.test b/test/baseline/opt-date.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-date.test
diff --git a/test/baseline/opt-datetime-format.test b/test/baseline/opt-datetime-format.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-datetime-format.test
diff --git a/test/baseline/opt-decimal-comma.test b/test/baseline/opt-decimal-comma.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-decimal-comma.test
diff --git a/test/baseline/opt-forecast-years.test b/test/baseline/opt-forecast-years.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-forecast-years.test
diff --git a/test/baseline/opt-generated.test b/test/baseline/opt-generated.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-generated.test
diff --git a/test/baseline/opt-group-by.test b/test/baseline/opt-group-by.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-group-by.test
diff --git a/test/baseline/opt-group-title-format.test b/test/baseline/opt-group-title-format.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-group-title-format.test
diff --git a/test/baseline/opt-meta-width.test b/test/baseline/opt-meta-width.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-meta-width.test
diff --git a/test/baseline/opt-meta.test b/test/baseline/opt-meta.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-meta.test
diff --git a/test/baseline/opt-no-rounding.test b/test/baseline/opt-no-rounding.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-no-rounding.test
diff --git a/test/baseline/opt-no-titles.test b/test/baseline/opt-no-titles.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-no-titles.test
diff --git a/test/baseline/opt-now.test b/test/baseline/opt-now.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-now.test
diff --git a/test/baseline/opt-pivot.test b/test/baseline/opt-pivot.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-pivot.test
diff --git a/test/baseline/opt-prepend-format.test b/test/baseline/opt-prepend-format.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-prepend-format.test
diff --git a/test/baseline/opt-prepend-width.test b/test/baseline/opt-prepend-width.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-prepend-width.test