aboutsummaryrefslogtreecommitdiff
path: root/test/grofftest.sh
diff options
context:
space:
mode:
authorYan Pas <yanp.bugz@gmail.com>2018-10-07 19:54:16 +0300
committerYan Pas <yanp.bugz@gmail.com>2018-10-07 19:55:10 +0300
commitc7aa7a83ddbfb220d1613dabb27dc1e72eeb7385 (patch)
tree18d29505f0eb22e75dfab321f76a6bdc1ba28d49 /test/grofftest.sh
parent27467189ab184c5d098e244e01f7d1bfdb0d4d45 (diff)
downloadpandoc-c7aa7a83ddbfb220d1613dabb27dc1e72eeb7385.tar.gz
test suite and more secapes
Diffstat (limited to 'test/grofftest.sh')
-rw-r--r--test/grofftest.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/grofftest.sh b/test/grofftest.sh
new file mode 100644
index 000000000..2c559d21a
--- /dev/null
+++ b/test/grofftest.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# iterates over specified directory, containing "\w+\.\d"-like files,
+# executes pandoc voer them and prints stderr on nonzero return code
+
+if [ $# -ne 2 ]; then
+ echo "Not enough arguments"
+ exit 1
+fi
+
+PANDOC=$1
+DIR=$2
+
+$PANDOC --version > /dev/null || { echo "pandoc executable error" >&2 ; exit 1 ; }
+
+ls $2 | egrep "^.+\.[0-9]$" | while read f ; do
+ FILE="$DIR/$f"
+ $PANDOC -f man -t native < $FILE > /dev/null
+ if [ $? -ne 0 ]; then
+ echo "Failed to convert $FILE"
+ fi
+done