layout/html/tests/style/runtests.sh
author jorendorff@mozilla.com
Mon, 19 Nov 2007 15:25:08 -0600
changeset 8097 74d4f075ce54b6e8a77a88dfaaa1d0bf2f665c58
parent 1 9b2a99adc05e53cd4010de512f50118594756650
permissions -rw-r--r--
Merging from cvs-trunk-mirror to mozilla-central.

#!/bin/sh

# create test file to use first; since we don't know where the tree
# is, and we need full pathnames in the file, we create it on the fly.

viewer=$MOZILLA_FIVE_HOME/viewer
echo viewer: $viewer
testsfile=/tmp/$$-tests.txt

if test "$1"x = "baselinex"; then
  rm -r -f baseline
  mkdir baseline
  for i in 1; do
    if test -f file_list"$i".txt; then 
      sed -e "s@file:///s|@file:$MOZ_SRC@" < file_list"$i".txt > $testsfile
      $viewer -d 1 -o baseline/ -f $testsfile
    fi
  done
  if test -f file_list_printing.txt; then 
    sed -e "s@file:///s|@file:$MOZ_SRC@" < file_list_printing.txt > $testsfile
    $viewer -Prt 1 -d 5 -o baseline/ -f $testsfile
  fi
elif test "$1"x = "verifyx"; then
  rm -r -f verify
  mkdir verify
  for i in 1 2 3 4 5 6; do
    if test -f file_list"$i".txt; then 
      sed -e "s@file:///s|@file:$MOZ_SRC@" < file_list"$i".txt > $testsfile
      $viewer -d 1 -o verify/ -rd baseline/ -f $testsfile
    fi
  done
  if test -f file_list_printing.txt; then 
    sed -e "s@file:///s|@file:$MOZ_SRC@" < file_list"$i".txt > $testsfile
    $viewer -Prt 1 -d 5 -o verify/ -rd baseline/ -f $testsfile
  fi
elif test "$1"x = "cleanx"; then
  rm -r -f verify baseline  
else
  echo "Usage: $0 baseline|verify|clean"
fi
rm -f $testsfile