Patchwork test-parse-date: defines explicit start/end dates for DST

login
register
mail settings
Submitter Sébastien Brissaud
Date March 10, 2016, 7:12 a.m.
Message ID <23797e0fd7cfde38c57e.1457593944@descartes.seb.brissaud.name>
Download mbox | patch
Permalink /patch/13736/
State Accepted
Headers show

Comments

Sébastien Brissaud - March 10, 2016, 7:12 a.m.
# HG changeset patch
# User Sébastien Brissaud <sebastien@brissaud.name>
# Date 1455470337 -3600
#      Sun Feb 14 18:18:57 2016 +0100
# Node ID 23797e0fd7cfde38c57e7ef6adfd7b0ae5b344d2
# Parent  1c658391b22fb4d98ccfb60c0e57315b55634117
test-parse-date: defines explicit start/end dates for DST

Prior to this patch, DST times where tested by specifying a custom TZ
environment variable that didn't defined DST transition times.

Due to a bug in glibc, the test fail on 32bits platforms that use timezone
files generated by zic from tzcode >= 2014c (glibc >= 2.20).

See https://sourceware.org/bugzilla/show_bug.cgi?id=19738

By defining explicit transition times for DST in the TZ environment variable,
the test is now independant to how the system guess those transition times.
Pierre-Yves David - March 10, 2016, 4:04 p.m.
On 03/10/2016 07:12 AM, Sébastien Brissaud wrote:
> # HG changeset patch
> # User Sébastien Brissaud <sebastien@brissaud.name>
> # Date 1455470337 -3600
> #      Sun Feb 14 18:18:57 2016 +0100
> # Node ID 23797e0fd7cfde38c57e7ef6adfd7b0ae5b344d2
> # Parent  1c658391b22fb4d98ccfb60c0e57315b55634117
> test-parse-date: defines explicit start/end dates for DST

om nom nom nom, Timezone voodoo,

Pushed to the clowncopter, thanks.

Patch

diff --git a/tests/test-parse-date.t b/tests/test-parse-date.t
--- a/tests/test-parse-date.t
+++ b/tests/test-parse-date.t
@@ -25,16 +25,18 @@  This runs with TZ="GMT"
   $ hg ci -d "100000 1400000" -m "fail"
   abort: impossible time zone offset: 1400000
   [255]
 
 Check with local timezone other than GMT and with DST
 
-  $ TZ="PST+8PDT"
+  $ TZ="PST+8PDT+7,M4.1.0/02:00:00,M10.5.0/02:00:00"
   $ export TZ
 
 PST=UTC-8 / PDT=UTC-7
+Summer time begins on April's first Sunday at 2:00am,
+and ends on October's last Sunday at 2:00am.
 
   $ hg debugrebuildstate
   $ echo "a" > a
   $ hg ci -d "2006-07-15 13:30" -m "summer@UTC-7"
   $ hg debugrebuildstate
   $ echo "b" > a