logo

utils-std

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

time.t (725B)


  1. #!/usr/bin/env cram
  2. # SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. # SPDX-License-Identifier: MPL-2.0
  4. $ cd $TESTDIR/../cmd
  5. $ ./time
  6. Usage: time [-p|-v] command [argument ...]
  7. $ ./time -f
  8. time: error: Unrecognised option: '-f'
  9. Usage: time [-p|-v] command [argument ...]
  10. [1]
  11. $ ./time false
  12. real 0.[0-9]* (re)
  13. user 0.[0-9]* (re)
  14. sys 0.[0-9]* (re)
  15. [1]
  16. $ ./time true
  17. real 0.[0-9]* (re)
  18. user 0.[0-9]* (re)
  19. sys 0.[0-9]* (re)
  20. # NetBSD somehow doesn't returns ENOENT there, just errno = 0
  21. $ test "NetBSD" != "$(uname -s)" || exit 80
  22. $ ./time /var/empty/e/no/ent
  23. time: error: Failed executing '/var/empty/e/no/ent': No such file or directory
  24. [127]