summaryrefslogtreecommitdiff
path: root/Build/tests/largefile/testlfs-thanh/test-include
diff options
context:
space:
mode:
Diffstat (limited to 'Build/tests/largefile/testlfs-thanh/test-include')
-rwxr-xr-xBuild/tests/largefile/testlfs-thanh/test-include40
1 files changed, 40 insertions, 0 deletions
diff --git a/Build/tests/largefile/testlfs-thanh/test-include b/Build/tests/largefile/testlfs-thanh/test-include
new file mode 100755
index 00000000000..f859cd66b4e
--- /dev/null
+++ b/Build/tests/largefile/testlfs-thanh/test-include
@@ -0,0 +1,40 @@
+#!/bin/bash
+# Usage: $0 <image-file> <image-count-per-page> <page-count>
+# Example: $0 foo.png 10 2 => include foo.png 10x per page and make 2 pages
+
+set -e
+set -u
+
+img="$1"
+count="$2"
+pages="$3"
+output="$img-$count-$pages"
+
+runCmd() {
+ echo "running '$@'"
+ "$@" || true
+ echo ""
+}
+
+# gen test file
+cat <<EOT > $output.tex
+\input test-lfs.tex
+\includeImage $img $count $pages
+\end
+EOT
+
+# compile it
+runCmd ./pdftex -ini $output.tex
+
+# validate result
+ls -lh $output.pdf
+if which pdftoppm > /dev/null; then
+ echo "check $output.pdf using pdftoppm"
+ runCmd pdftoppm -r 72 $output.pdf $output
+ rm -f '*.ppm' || true
+fi
+
+if which gs > /dev/null; then
+ echo "check $output.pdf using gs"
+ runCmd gs -q -dNOPAUSE -r72 -sDEVICE=ppmraw -sOutputFile=/dev/null -dBATCH $output.pdf
+fi