TITLE='Test --no-mtime option'
# 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/point1-1.jpg" >"$LOGDIR/test.jpg" && touch -t 201001020304.05 "$LOGDIR/test.jpg" && touch "$LOGDIR/ztest.jpg"'
COMMAND='$PROGRAM --no-mtime -z 0 -g "$STAGINGDIR/track1.gpx" "$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
