From: William Langford Date: Thu, 21 Feb 2019 01:58:25 +0000 (-0500) Subject: Remove ruby dependency from mantests X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=53a3f47076b930ff01d65da340300a0adfb822aa;p=jq Remove ruby dependency from mantests --- diff --git a/docs/build_mantests.py b/docs/build_mantests.py new file mode 100755 index 0000000..40f0dcc --- /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 c5acf92..e86792e 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