diff options
author | Roy Marples <roy@marples.name> | 2009-02-23 10:43:24 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2009-02-23 10:43:24 +0000 |
commit | f38ef0093915724421052abcf1f4013fe5738d32 (patch) | |
tree | e340327c2c7b911ed7c244696d367a24010dd883 /src/test | |
parent | 66cd081301a0b2e72c8ac348c2f1361261caae82 (diff) |
Fix unit test.
Diffstat (limited to 'src/test')
-rwxr-xr-x | src/test/units/is_older_than | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/src/test/units/is_older_than b/src/test/units/is_older_than index 7737f5fd..47a62d78 100755 --- a/src/test/units/is_older_than +++ b/src/test/units/is_older_than @@ -28,9 +28,6 @@ ref_is_older_than() return 1 } -rm -rf "${TMPDIR}" -mkdir "${TMPDIR}" - do_test() { local r1= r2= @@ -55,23 +52,32 @@ test_it() do_test "${TMPDIR}"/ref "${TMPDIR}"/dir1 "${TMPDIR}"/dir2 } -echo_cmd mkdir -p "${TMPDIR}"/dir1 "${TMPDIR}"/dir2 -echo_cmd touch "${TMPDIR}"/dir1/f1 "${TMPDIR}"/dir1/f2 "${TMPDIR}"/dir1/f3 "${TMPDIR}"/dir2/f1 "${TMPDIR}"/dir2/f2 "${TMPDIR}"/dir2/f3 -echo_cmd sleep 1 -echo_cmd touch "${TMPDIR}"/ref -test_it +run_test() +{ + echo_cmd mkdir -p "${TMPDIR}"/dir1 "${TMPDIR}"/dir2 + echo_cmd touch "${TMPDIR}"/dir1/f1 "${TMPDIR}"/dir1/f2 \ + "${TMPDIR}"/dir1/f3 "${TMPDIR}"/dir2/f1 \ + "${TMPDIR}"/dir2/f2 "${TMPDIR}"/dir2/f3 + echo_cmd sleep 1 + echo_cmd touch "${TMPDIR}"/ref + test_it || return 1 -echo_cmd sleep 1 -echo_cmd touch "${TMPDIR}"/dir1/f2 -test_it + echo_cmd sleep 1 + echo_cmd touch "${TMPDIR}"/dir1/f2 + test_it || return 1 -echo_cmd sleep 1 -echo_cmd touch "${TMPDIR}"/ref -test_it + echo_cmd sleep 1 + echo_cmd touch "${TMPDIR}"/ref + test_it || return 1 -echo_cmd sleep 1 -echo_cmd touch "${TMPDIR}"/dir2/f2 -test_it + echo_cmd sleep 1 + echo_cmd touch "${TMPDIR}"/dir2/f2 + test_it || return 1 +} rm -rf "${TMPDIR}" -exit 0 +mkdir "${TMPDIR}" +run_test +retval=$? +rm -rf "${TMPDIR}" +exit ${retval} |