summaryrefslogtreecommitdiff
path: root/dviware/dvisvgm/tests/check-conv
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /dviware/dvisvgm/tests/check-conv
Initial commit
Diffstat (limited to 'dviware/dvisvgm/tests/check-conv')
-rwxr-xr-xdviware/dvisvgm/tests/check-conv50
1 files changed, 50 insertions, 0 deletions
diff --git a/dviware/dvisvgm/tests/check-conv b/dviware/dvisvgm/tests/check-conv
new file mode 100755
index 0000000000..a43800b9a4
--- /dev/null
+++ b/dviware/dvisvgm/tests/check-conv
@@ -0,0 +1,50 @@
+#!/bin/bash
+# This file is part of the dvisvgm package and published under the
+# terms of the GNU General Public License version 3 or later.
+# See file COPYING for further details.
+# Copyright (C) 2009-2019 Martin Gieseking <martin.gieseking@uos.de>
+
+
+files=(sample frktest)
+state=0
+
+BLUE="\E[0;34m"
+GREEN="\E[0;32m"
+RED="\E[0;31m"
+COLOR_OFF="\E[0m"
+
+if [ \! -e enable-check-conv ]; then
+ echo -e "${BLUE}conversion checks skipped${COLOR_OFF}"
+ exit 0
+fi
+
+for f in ${files[@]}; do
+ for m in "wf" "nf"; do
+ infile=${srcdir}/$f
+ outfile=$f-$m.svg
+ cmpfile=${srcdir}/$f-$m-cmp.svg
+ if [ $m = "wf" ]; then
+ ../src/dvisvgm -v0 -o$outfile $infile
+ else
+ ../src/dvisvgm -v0 -n -o$outfile $infile
+ fi
+ xsltproc --novalid ${srcdir}/normalize.xsl $outfile | xmllint --format - >tmp1.svg
+ xsltproc --novalid ${srcdir}/normalize.xsl $cmpfile | xmllint --format - >tmp2.svg
+ mv tmp1.svg $outfile
+
+ diff $outfile tmp2.svg >$f-$m.diff #>/dev/null
+ if [ $? -ne 0 ]; then
+ echo -en "${RED}FAILED $COLOR_OFF"
+ state=1
+ else
+ echo -en "${GREEN}PASSED $COLOR_OFF"
+ rm $outfile
+ fi
+ echo "converting $f.dvi (mode $m)"
+ if [ \! -s $f-$m.diff ]; then
+ rm $f-$m.diff
+ fi
+ rm tmp2.svg
+ done
+done
+exit $state