]> git.notmuchmail.org Git - notmuch/commitdiff
test: Set fixed time zone
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 23 Apr 2010 07:36:45 +0000 (09:36 +0200)
committerCarl Worth <cworth@cworth.org>
Fri, 23 Apr 2010 20:28:33 +0000 (13:28 -0700)
When the test suite is run in a different time zone that where Carl
lives, some tests may fail depending on the time when the test suite is
run. For example, just now I get:

     Search for all messages ("*"):... FAIL
    --- test-031.expected 2010-04-23 09:33:47.898634822 +0200
    +++ test-031.output 2010-04-23 09:33:47.898634822 +0200
    @@ -1,5 +1,5 @@
    -thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Test message #6 (inbox unread)
    -thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Test message #14 (inbox unread)
    +thread:XXX   2001-01-06 [1/1] Notmuch Test Suite; Test message #6 (inbox unread)
    +thread:XXX   2001-01-06 [1/1] Notmuch Test Suite; Test message #14 (inbox unread)
     thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; body search (inbox unread)
     thread:XXX   2000-01-01 [1/1] searchbyfrom; search by from (inbox unread)
     thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; search by to (inbox unread)

By setting a fixed time zone in the test script, these problems should
be eliminated.

Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
test/notmuch-test

index 3c1cd9ffca762e9ab95eba5085579b7287c98d1c..04c6470551d5ba627e5840d3dc97a06a28af007e 100755 (executable)
@@ -1,6 +1,8 @@
 #!/bin/bash
 set -e
 
+export TZ=UTC+8
+
 find_notmuch_binary ()
 {
     dir=$1