diff options
author | Lars Wirzenius <liw@liw.fi> | 2013-04-11 20:13:00 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2013-04-11 20:13:00 +0100 |
commit | 587aac6fb3007eafe972aa9f0ad605ec4556a0f2 (patch) | |
tree | b97ff7c3d4d8b3090f0d967900aca68206288bd1 | |
download | desktop-cronish-587aac6fb3007eafe972aa9f0ad605ec4556a0f2.tar.gz |
Initial
-rwxr-xr-x | tests/date.script | 13 | ||||
-rwxr-xr-x | tests/mtime-old.script | 14 | ||||
-rwxr-xr-x | tests/timeout.script | 13 |
3 files changed, 40 insertions, 0 deletions
diff --git a/tests/date.script b/tests/date.script new file mode 100755 index 0000000..7214bb7 --- /dev/null +++ b/tests/date.script @@ -0,0 +1,13 @@ +#!/bin/sh + +set -eu + +cat <<EOF > "$DATADIR/foo.tasks" +date: + interval: 2 + command: date +%s >> "$DATADIR/foo.output" +EOF + + +./desktop-cronish --stop-after=5 "$DATADIR/foo.tasks" +awk 'NR > 1 { print $1 - prev } { prev = $1 }' | awk '$1 < 1' diff --git a/tests/mtime-old.script b/tests/mtime-old.script new file mode 100755 index 0000000..4d2d61d --- /dev/null +++ b/tests/mtime-old.script @@ -0,0 +1,14 @@ +#!/bin/sh + +set -eu + +touch -t 197001010000.00 "$DATADIR/foo.trigger" +cat <<EOF > "$DATADIR/foo.tasks" +date: + trigger-file: $DATADIR/foo.trigger + trigger-age: 10 + command: echo triggered > $DATADIR/foo.out +EOF + + +./desktop-cronish --stop-after 5 "$DATADIR/foo.tasks" diff --git a/tests/timeout.script b/tests/timeout.script new file mode 100755 index 0000000..b6b4651 --- /dev/null +++ b/tests/timeout.script @@ -0,0 +1,13 @@ +#!/bin/sh + +set -eu + +cat <<EOF > "$DATADIR/foo.tasks" +date: + interval: 2 + timeout: 1 + command: sleep 1000 +EOF + + +./desktop-cronish "$DATADIR/foo.tasks" |