You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
thumbsup/scripts/verify

35 lines
824 B
Bash

#!/bin/bash
set -eou pipefail
# Run tests inside the integration folder
DIR="${BASH_SOURCE%/*}"
pushd "${DIR}/../test-snapshot" >/dev/null || exit
trap finish EXIT
function finish {
popd >/dev/null
}
# cleanup
rm -rf output-actual
# run thumbsup
node ../bin/thumbsup.js --config config.json --output output-actual
# compare albums with the snapshot
for expected in output-expected/*.html; do
actual=$(echo "${expected}" | sed s/expected/actual/)
diff -ub "${expected}" "${actual}"
done
echo "HTML pages are identical to snapshot"
# compare media with the snapshot
IFS=$'\n'; set -f
for expected in $(find output-expected/media -name "*.jpg"); do
actual=$(echo "${expected}" | sed s/expected/actual/)
./imagediff "${expected}" "${actual}"
done
unset IFS; set +f
echo "Resized media is identical to snapshot"