Test with multiple time zones.

Previously Chrono was mainly tested in UTC (Travis) and UTC+9 (the
maintainer's local time zone), but we have frequently seen bugs that
only appear in time zones behind UTC. This commit makes the test run all
unit tests three times, in different time zones (UTC, UTC+9:30 and
UTC-4 for now---the choice is mostly arbitrary but tries to cover DST
and half-hour offsets for the future). Travis already ran them three
times (for rust-serialize and Serde) so this won't slow the CI down.

Closes #130.
This commit is contained in:
Kang Seonghoon 2017-02-14 03:15:07 +09:00
parent 73a3ec5514
commit 1afa60f377
No known key found for this signature in database
GPG Key ID: 82440FABA6709020
2 changed files with 7 additions and 4 deletions

View File

@ -17,13 +17,14 @@ env:
- LD_LIBRARY_PATH: /usr/local/lib - LD_LIBRARY_PATH: /usr/local/lib
script: script:
# interleave building and testing in hope that it saves time # interleave building and testing in hope that it saves time
# also vary the local time zone to (hopefully) catch tz-dependent bugs
# also avoid doc-testing multiple times---it takes a lot and rarely helps # also avoid doc-testing multiple times---it takes a lot and rarely helps
- cargo build -v - cargo build -v
- cargo test -v - TZ=ACST-9:30 cargo test -v
- cargo build -v --features rustc-serialize - cargo build -v --features rustc-serialize
- cargo test -v --features rustc-serialize --lib - TZ=EST4 cargo test -v --features rustc-serialize --lib
- cargo build -v --features 'serde bincode' - cargo build -v --features 'serde bincode'
- cargo test -v --features 'serde bincode' --lib - TZ=UTC0 cargo test -v --features 'serde bincode' --lib
notifications: notifications:
email: false email: false
irc: irc:

View File

@ -45,7 +45,9 @@ README.md: src/lib.rs
.PHONY: test .PHONY: test
test: test:
cargo test --features 'serde rustc-serialize bincode' TZ=UTC0 cargo test --features 'serde rustc-serialize bincode' --lib
TZ=ACST-9:30 cargo test --features 'serde rustc-serialize bincode' --lib
TZ=EST4 cargo test --features 'serde rustc-serialize bincode'
.PHONY: doc .PHONY: doc
doc: authors readme doc: authors readme