Commit Graph
60 Commits
Author SHA1 Message Date
David Peter b5a6860d96 Support list of exit codes in --ignore-failure 2025-11-18 09:19:27 +01:00
David Peter de07c77387 Formatting 2025-09-04 08:59:11 +02:00
David Peter fae8b0ef64 .contains(…) 2025-09-03 20:52:28 +02:00
Niklas Dewally 2166c9f02e Add option to name reference command
Add --reference-name option to give a reference command a name.

This was discussed in the PR that added --reference, #744, but
was unfortunately never implemented.
2025-09-03 20:45:39 +02:00
David Peter 0705d6c7d0 Basic scheduler test 2024-12-29 14:07:21 +01:00
David Peter 99d24b7a2e Multiple output policies 2024-11-11 22:24:25 +01:00
Jan-Eric Nitschke d4749b015f Fix prepare and conclude behaviour and add tests. 2024-06-30 22:45:40 +02:00
Jan-Eric Nitschke 9806ed7694 Added option to manually specify a reference to compare the results to. 2024-06-30 22:45:40 +02:00
Hamir Mahal ef1263279d style: simplify string interpolation 2024-06-01 11:07:23 +02:00
Jack O'Connor e13d0cb144 Add --conclude option with tests
This implementation of --conclude is basically identical
to the existing implementation for --prepare. I have not
adapted any existing tests. All tests which test --conclude
functionality are new.

The --conclude commands will run in the same order in which
they are supplied on the cli in the same manner as --prepare
and there must either be one --conclude command, or else the
same number of --concludes as there are commands.
2024-02-02 17:46:23 +01:00
Lena 69ee1738d4 Remove dependency on atty and use std::io::IsTerminal instead 2023-10-18 20:54:12 +02:00
David Peter 4564977b7a Add support for microseconds, closes #684 2023-10-05 09:39:00 +02:00
David Peter ac617c8714 Add new --sort option
This adds a new `--sort` option to choose the way in which the results
in the speed comparison and the markup exports are ordered.

closes #614
closes #601
2023-06-03 21:34:36 +02:00
David Peter 80ec1c5ddf Fix usage of --input=null 2023-03-21 21:03:34 +01:00
David Peter 1c7a8cc2f6 Fix clippy suggestions 2023-03-15 10:13:58 +01:00
David Peter c44aa1d006 Fix clippy suggestions 2023-03-15 10:13:58 +01:00
David Peter 42e85f240c Fix merge conflicts 2023-03-15 09:33:49 +01:00
Steve Nease d32b90ee5c Add the rest of the suggestions from code review 2023-03-15 09:33:49 +01:00
sneaseandDavid Peter bbb59fd7fa Apply suggestions from code review
Co-authored-by: David Peter <sharkdp@users.noreply.github.com>
2023-03-15 09:33:49 +01:00
Steve Nease 0e3bad1391 ran cargo fmt 2023-03-15 09:33:49 +01:00
Steve Nease e38acdb683 Added --stdin-data argument
This argument accepts a path to a file. The data contained in the file will be passed to the command via stdin.

Closes sharkdp/hyperfine#541
2023-03-15 09:33:49 +01:00
Benjamin Rombaut fcaa6d32dc chore: run fmt 2022-11-19 15:13:30 +01:00
Benjamin Rombaut 27ec9e22d8 use set and settrue 2022-11-19 15:13:30 +01:00
Benjamin Rombaut 5fcb7166a9 add clap deprecation notices 2022-11-19 15:13:30 +01:00
FilipAndersson f00acf962e Fixes #568 2022-10-29 14:58:57 +02:00
наб af2f0ace22 Default to $TERM unset = colour on Win32
This otherwise respects all other configuration
(NO_COLOR, TERM=dumb, &c.), but it's very common for the environment to
be lacking TERM, which in that case usually means a pro-verbial
TERM=cmd.exe, which is colourful

Fixes: 049d1138c9 ("Don't output colours
 by default if TERM=dumb or NO_COLOR=1")
2022-10-29 14:48:25 +02:00
David Peter c7e56942f7 Fix clippy suggestions 2022-09-07 09:20:50 +02:00
David Peter dffbdc34d4 Add new (hidden) --min-benchmarking-time option 2022-09-07 09:13:53 +02:00
David Peter 9fefe9af31 Rewrite boolean condition 2022-09-07 08:44:57 +02:00
наб 049d1138c9 Don't output colours by default if TERM=dumb or NO_COLOR=1
This matches ZFS, and is mostly état d'art

Closes #542
2022-09-02 13:38:37 +02:00
Tavian Barnes 3df63ba2bb Address review comments 2022-05-17 22:30:45 +02:00
Tavian Barnes efdf735723 Forbid --output=file without a path separator 2022-05-17 22:30:45 +02:00
Tavian Barnes ecee9df575 Add --output=inherit as an alias for --show-output 2022-05-17 22:30:45 +02:00
Tavian Barnes 277807cb5a Implement --output={null,pipe,<FILE>}
Fixes #377.
2022-05-17 22:30:45 +02:00
David Peter 365ff2584d Switch to --shell=none/-N, do not change the default 2022-02-22 22:51:09 +01:00
David Peter d9418e0731 Use raw executor by default, skip intermediate shell
This adds a new "raw executor" (next to the "shell executor") that
allows hyperfine to execute commands directly without any intermediate
shell.

The command line is split into tokens (using the `shell-words` crate),
and according to POSIX rules. The first token is taken as the executable,
and the rest as arguments.

The new executor is enabled by default. In order to select the shell
executor, users will have to pass `--shell=default`.

This allows us to reduce measurement noise and to benchmark very quick
commands. It also decreases the time to run benchmarks, as we don't need
the calibration phase.

Also, it allows one to make sure that the executed command is not
implemented as a shell builtin. For example `hyperfine true`
and `hyperfine --shell=default true` return different times due
to the fact that `bash` executes `true` as a NOP.

Co-authored: Ciprian Dorin Craciun <ciprian@volution.ro>
2022-02-22 22:51:09 +01:00
David Peter 9b8f2a9ee2 Move Stdio extraction to enum 2022-02-22 13:24:05 +01:00
David Peter f029a46ff9 Fix clippy warnings 2022-02-22 10:13:06 +01:00
David Peter 6887835f34 Proper shell overhead computation 2022-02-22 09:07:40 +01:00
David Peter 6f51232a8a Add debug/mock mode 2022-02-22 09:07:40 +01:00
David Peter 811e6b5fcd Rename test 2022-02-22 09:07:40 +01:00
David Peter 6645fa10b9 Use get_program 2022-02-22 09:07:40 +01:00
David Peter 21f76a338f Remove unused option 2022-02-22 09:07:40 +01:00
David Peter f9e62e5e7f Rename parse to from_str 2022-02-22 09:07:40 +01:00
David Peter 0ebd76dfc2 Turn show_output into enum 2022-02-22 09:07:40 +01:00
David Peter bea0cfab30 Rename Runs to RunBounds 2022-02-22 09:07:40 +01:00
David Peter 250db61fa0 Fix clippy warning 2022-02-22 09:07:40 +01:00
David Peter 72d27729fa New Scheduler struct 2022-02-19 16:53:02 +01:00
David Peter 5c634c9f2f Move a few modules to util 2022-02-06 20:19:50 +01:00
David Peter b54b2f81f4 Rename to Options 2022-02-06 20:19:50 +01:00