From dad8108feba7579ceddc23cbb93b9fd48111d0d6 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 9 Feb 2020 10:35:04 +1000 Subject: [PATCH] run the TZ test only on Macs --- rslib/Makefile | 4 +--- rslib/src/sched.rs | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/rslib/Makefile b/rslib/Makefile index cc214b075..d153d537d 100644 --- a/rslib/Makefile +++ b/rslib/Makefile @@ -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 $@ diff --git a/rslib/src/sched.rs b/rslib/src/sched.rs index e320e57da..0caf053c5 100644 --- a/rslib/src/sched.rs +++ b/rslib/src/sched.rs @@ -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");