Add firefox to travis; quit early if files are not found in generator tests

This commit is contained in:
Rachel Fenichel
2018-11-09 16:50:57 -08:00
parent abd22e867c
commit 6e300cc27c
2 changed files with 16 additions and 13 deletions

View File

@@ -12,6 +12,8 @@ matrix:
- os: osx
node_js: stable
osx_image: xcode8.3
addons:
firefox: latest
before_script:
# Symlink closure library used by test/jsunit

View File

@@ -14,21 +14,22 @@ FAILURE_COUNT=0
check_result() {
local suffix=$1 # One of: js, py, dart, lua, php
local tmp_filename="${TMP_DIR}generated.$suffix"
if [ ! -f $tmp_filename ]; then
echo "File $tmp_filename not found!"
FAILURE_COUNT=$((FAILURE_COUNT+1))
fi
local golden_filename="${GOLDEN_DIR}generated.$suffix"
if [ ! -f $golden_filename ]; then
echo "File $golden_filename not found!"
FAILURE_COUNT=$((FAILURE_COUNT+1))
fi
if cmp --silent $tmp_filename $golden_filename; then
echo -e "$SUCCESS_PREFIX $suffix: $tmp_filename matches $golden_filename"
if [ -f $tmp_filename ]; then
local golden_filename="${GOLDEN_DIR}generated.$suffix"
if [ -f $golden_filename ]; then
if cmp --silent $tmp_filename $golden_filename; then
echo -e "$SUCCESS_PREFIX $suffix: $tmp_filename matches $golden_filename"
else
echo -e "$FAILURE_PREFIX $suffix: $tmp_filename does not match $golden_filename"
FAILURE_COUNT=$((FAILURE_COUNT+1))
fi
else
echo "File $golden_filename not found!"
FAILURE_COUNT=$((FAILURE_COUNT+1))
fi
else
echo -e "$FAILURE_PREFIX $suffix: $tmp_filename does not match $golden_filename"
echo "File $tmp_filename not found!"
FAILURE_COUNT=$((FAILURE_COUNT+1))
fi
}