1#!/bin/bash
2#
3# Copyright 2015 PDFium Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6#
7# Script to generate expected result files.
8#
9set -e
10while (( "$#" )); do
11  INFILE="$1"
12  echo $INFILE | grep -qs ' ' && echo space in filename detected && exit 1
13  out/Debug/pdfium_test --png $INFILE
14  RESULTS="$INFILE.*.png"
15  for RESULT in $RESULTS ; do
16      EXPECTED=`echo -n $RESULT | sed 's/[.]pdf[.]/_expected.pdf./'`
17      mv $RESULT $EXPECTED
18  done
19  shift
20done
21