logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git

timeout.t (711B)


  1. #!/usr/bin/env cram
  2. # SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. # SPDX-License-Identifier: MPL-2.0
  4. $ export PATH="$TESTDIR/../cmd:$PATH"
  5. $ test "$(command -v timeout)" = "$TESTDIR/../cmd/timeout"
  6. Flaky on FreeBSD
  7. $ test "$(uname -s)" != "FreeBSD" || return 80
  8. $ timeout 0.5 sleep 10
  9. [124]
  10. $ timeout 0.5 sleep 0.2
  11. $ timeout 0.5 true
  12. $ timeout 0.5 false
  13. [1]
  14. $ timeout -s KILL 0.5 sleep 10
  15. [124]
  16. $ timeout -s SIGKILL 0.5 sleep 10
  17. [124]
  18. $ timeout -s 9 0.5 sleep 10
  19. [124]
  20. $ timeout -f 0.5 time -p sleep 1
  21. [124]
  22. $ timeout 0.5 time -p sleep 1
  23. real 1.\d+ (re)
  24. user 0.\d+ (re)
  25. sys 0.\d+ (re)
  26. [124]
  27. $ timeout -p 0.5 sleep 10