CS3413/Assignment9/tests/test_images.sh

23 lines
476 B
Bash

#!/usr/bin/env bash
# Executable path
EXECUTABLE=../build/Assignment9
test_reverse() {
start=$(date +%s)
cp "$1" in.png
cp in.png out.png
$EXECUTABLE out.png > /dev/null
$EXECUTABLE out.png > /dev/null
diff in.png out.png
rm in.png out.png
end=$(date +%s)
echo "Test $1 took $((end - start)) seconds"
}
test_reverse test1.png
# test_reverse test2.png # This png is invalid, so it will fail
test_reverse test3.png
test_reverse test4.png