summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvisvgm/dvisvgm-src/tests/check-conv
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/tests/check-conv')
-rwxr-xr-xBuild/source/texk/dvisvgm/dvisvgm-src/tests/check-conv50
1 files changed, 50 insertions, 0 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/tests/check-conv b/Build/source/texk/dvisvgm/dvisvgm-src/tests/check-conv
new file mode 100755
index 00000000000..d1e1a445848
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/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-2017 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