]> granicus.if.org Git - jq/commitdiff
Remove ruby dependency from mantests
authorWilliam Langford <wlangfor@gmail.com>
Thu, 21 Feb 2019 01:58:25 +0000 (20:58 -0500)
committerNico Williams <nico@cryptonector.com>
Tue, 26 Feb 2019 17:10:38 +0000 (11:10 -0600)
docs/build_mantests.py [new file with mode: 0755]
tests/mantest

diff --git a/docs/build_mantests.py b/docs/build_mantests.py
new file mode 100755 (executable)
index 0000000..40f0dcc
--- /dev/null
@@ -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('')
index c5acf925945d95116e9d416211825db4a6ce7e14..e86792edcaa7f13f71a46646ba73edca734f3ddb 100755 (executable)
@@ -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