Add simple script to regenerate expected results.
authorTom Sepez <tsepez@chromium.org>
Thu, 30 Jul 2015 23:48:28 +0000 (16:48 -0700)
committerTom Sepez <tsepez@chromium.org>
Thu, 30 Jul 2015 23:48:28 +0000 (16:48 -0700)
(I've been doing this by hand for far too long).

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1264873005 .

testing/tools/make_expected.sh [new file with mode: 0755]

diff --git a/testing/tools/make_expected.sh b/testing/tools/make_expected.sh
new file mode 100755 (executable)
index 0000000..c6e50dc
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+#
+# Script to generate expected result files.
+#
+set -e
+while (( "$#" )); do
+  INFILE="$1"
+  echo $INFILE | grep -qs ' ' && echo space in filename detected && exit 1
+  out/Debug/pdfium_test --png $INFILE
+  RESULTS="$INFILE.*.png"
+  for RESULT in $RESULTS ; do
+      EXPECTED=`echo -n $RESULT | sed 's/[.]pdf[.]/_expected.pdf./'`
+      mv $RESULT $EXPECTED
+  done
+  shift
+done