diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-03-16 19:34:01 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-03-16 19:34:01 +0000 |
commit | e4085f9c75afdfdb9084816798ea5d19ad679eed (patch) | |
tree | 999ff06c1d84d02b22accde1ebfbb2a7138836ba /tests | |
parent | 62efab186b2aa279e84ea45213bba0e099713f9b (diff) |
Fix test_time on Mac OS X (and other platforms without inotify)
Reviewboard: https://reviewboard.asterisk.org/r/554/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@252846 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_time.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/test_time.c b/tests/test_time.c index b4933e89b..41161310f 100644 --- a/tests/test_time.c +++ b/tests/test_time.c @@ -90,19 +90,26 @@ AST_TEST_DEFINE(test_timezone_watch) int system_res; snprintf(syscmd, sizeof(syscmd), "%s " TZDIR "/%s %s", type == 0 ? "cp" : "ln -sf", zones[i], tzfile); if ((system_res = system(syscmd))) { - ast_log(LOG_WARNING, "system() returned non-zero: %d\n", system_res); + ast_log(LOG_WARNING, "system(%s) returned non-zero: %d\n", syscmd, system_res); } + ast_localtime_wakeup_monitor(); ast_localtime(&tv, &atm[i], tzfile); if (i != 0) { if (atm[i].tm_hour == atm[i - 1].tm_hour) { res = AST_TEST_FAIL; - ast_test_status_update(test, "Failed %s test\n", type == 0 ? "deletion" : "symlink"); + ast_test_status_update(test, "Failed %s test: %d(%s) = %d(%s)\n", type == 0 ? "deletion" : "symlink", atm[i].tm_hour, zones[i], atm[i-1].tm_hour, zones[i-1]); } } + + /* stat(2) only has resolution to 1 second - must wait, or the mtime is the same */ + usleep(1100000); } } snprintf(syscmd, sizeof(syscmd), "rm -rf %s", tmpdir); + if (system(syscmd)) { + ast_log(LOG_WARNING, "system(%s) returned non-zero.\n", syscmd); + } /* Restore SIGCHLD handler */ ast_unreplace_sigchld(); |