diff options
author | William Langford <wlangfor@gmail.com> | 2019-02-20 20:58:25 -0500 |
---|---|---|
committer | William Langford <wlangfor@gmail.com> | 2019-02-22 19:32:31 -0500 |
commit | 03f746bf24884f3c20ccea0437876831bccd5beb (patch) | |
tree | 49c4d54826056f66df954de339a30037030b108b | |
parent | 5989388c9c4cc7c42bcc050eace010e8addafc11 (diff) |
Remove ruby dependency from mantests
-rwxr-xr-x | docs/build_mantests.py | 13 | ||||
-rwxr-xr-x | tests/mantest | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/docs/build_mantests.py b/docs/build_mantests.py new file mode 100755 index 00000000..40f0dccf --- /dev/null +++ b/docs/build_mantests.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +import yaml + +with open("content/manual/manual.yml") as f: + manual = yaml.load(f) + for section in manual.get('sections', []): + for entry in section.get('entries', []): + for example in entry.get('examples', []): + print(example.get('program', '').replace('\n', ' ')) + print(example.get('input', '')) + for s in example.get('output', []): + print(s) + print('') diff --git a/tests/mantest b/tests/mantest index c5acf925..e86792ed 100755 --- a/tests/mantest +++ b/tests/mantest @@ -3,5 +3,5 @@ . "${0%/*}/setup" "$@" # We set PAGER because there's a mantest for `env` that uses it. -(cd $JQBASEDIR/docs && rake mantests) | +(cd $JQBASEDIR/docs && pipenv run python3 build_mantests.py) | env PAGER=less $VALGRIND $Q $JQ -L "$mods" --run-tests |