run the TZ test only on Macs

This commit is contained in:
Damien Elmes 2020-02-09 10:35:04 +10:00
parent 87c73741d0
commit dad8108feb
2 changed files with 4 additions and 3 deletions

View File

@ -33,10 +33,8 @@ RUST_TOOLCHAIN := $(shell cat rust-toolchain)
rustup component add clippy-preview --toolchain $(RUST_TOOLCHAIN)
@touch $@
# set TZ here for the benefit of a single unit test that fails
# when running in the GitHub workflow.
.build/check: .build/rs-tools $(ALL_SOURCE)
TZ="Australia/Perth" cargo test --lib -- --nocapture
cargo test --lib -- --nocapture
cargo fmt -- --check
cargo clippy -- -D warnings
@touch $@

View File

@ -122,6 +122,9 @@ mod test {
}
#[test]
#[cfg(target_vendor = "apple")]
/// On Linux, TZ needs to be set prior to the process being started to take effect,
/// so we limit this test to Macs.
fn test_local_minutes_west() {
// -480 throughout the year
std::env::set_var("TZ", "Australia/Perth");