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
commit 8ed3dac1dc
3 changed files with 4 additions and 4 deletions

View file

@ -163,9 +163,9 @@ elif not defined(windows):
proc process_notification_test(): bool =
var selector = newSelector[int]()
var process2 = startProcess("/bin/sleep", "", ["2"], nil,
var process2 = startProcess("sleep", "", ["2"], nil,
{poStdErrToStdOut, poUsePath})
discard startProcess("/bin/sleep", "", ["1"], nil,
discard startProcess("sleep", "", ["1"], nil,
{poStdErrToStdOut, poUsePath})
selector.registerProcess(process2.processID, 0)