mirror of https://github.com/thumbsup/thumbsup
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.
33 lines
772 B
Plaintext
33 lines
772 B
Plaintext
7 years ago
|
#!/bin/bash
|
||
|
set -eou pipefail
|
||
|
|
||
|
# Run tests inside the integration folder
|
||
7 years ago
|
DIR="${BASH_SOURCE%/*}"
|
||
|
pushd "${DIR}/../test-snapshot" >/dev/null || exit
|
||
7 years ago
|
trap finish EXIT
|
||
|
function finish {
|
||
|
popd >/dev/null
|
||
|
}
|
||
|
|
||
|
# cleanup
|
||
|
rm -rf output-actual
|
||
|
|
||
|
# run thumbsup
|
||
7 years ago
|
node ../bin/thumbsup.js --config config.json --output output-actual
|
||
7 years ago
|
|
||
7 years ago
|
# compare albums with the snapshot
|
||
|
for expected in output-expected/*.html; do
|
||
|
actual=$(echo "${expected}" | sed s/expected/actual/)
|
||
|
diff -ub "${expected}" "${actual}"
|
||
|
done
|
||
|
|
||
|
# 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
|
||
7 years ago
|
|
||
|
echo "Output is identical to snapshot"
|