1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
TITLE='Remove GPS tags with --no-mtime'
# This is a strange way to test this, but I haven't found a better means that's
# both simple && highly portable. This method just compares the relative mtime
# of the file under test and a just-created file with ls -t and ensures that
# the file under test is older than the other.
#
# This makes several assumptions:
# 1) the filesystem and ls command operate at one second resolution
# 2) when two files have the same mtime, ls -t will output them in
# lexicographic order
# The failure of either assumption is designed to cause a false negative
# result, so they should not disrupt operation of the test suite.
PRECOMMAND='cat "$STAGINGDIR/withgps.jpg" >"$LOGDIR/test.jpg" && touch -t 201001020304.05 "$LOGDIR/test.jpg" && touch "$LOGDIR/ztest.jpg"'
COMMAND='$PROGRAM --no-mtime --remove "$LOGDIR/test.jpg" > "$OUTFILE" 2>&1 && ls -t "$LOGDIR/ztest.jpg" "$LOGDIR/test.jpg" >> "$OUTFILE" 2>&1'
POSTCOMMAND='rm -f "$LOGDIR/test.jpg" "$LOGDIR/ztest.jpg"'
RESULTCODE=0
SEDCOMMAND='s@^.*/@@' # strip paths
|