Fix tests on NixOS (#9209) (#9285)

* Replace `/bin/sleep` with just `sleep`, i.e. use environment variable
  `$PATH` to locate binary.
* Replace `/usr/share/zoneinfo` with `$TZDIR` when it is defined,
  fallback to hardcoded path otherwise. This is the same behavior that
  Glibc2 normally have, see man 3 tzset.
This commit is contained in:
xzfc
2018-10-11 03:47:08 +07:00
committed by Andreas Rumpf
parent 0ead36dae6
commit 8ed3dac1dc
3 changed files with 4 additions and 4 deletions

View File

@@ -114,7 +114,7 @@ suite "ttimes":
# Generate tests for multiple timezone files where available
# Set the TZ env var for each test
when defined(linux) or defined(macosx):
const tz_dir = "/usr/share/zoneinfo"
let tz_dir = getEnv("TZDIR", "/usr/share/zoneinfo")
const f = "yyyy-MM-dd HH:mm zzz"
let orig_tz = getEnv("TZ")