Commit graph

31 commits

Author SHA1 Message Date
Walid
ebcd86df07
env: adds --ignore-signal (#6377)
* env: adds --ignore-signal
This commit implement #6164.

* env: handle STOP signal and fix styling issue

* env: fix encoded bytes

* env: adds SAFETY comment and handle special signals in ignore_signal

* env: fix parsing to have compatible behaviour

* env: remove derive from Options

* env: changed safety comment, handle duplications after parsing and non-unix cfg

* env: adds tests for ignore-signal parsing and invalid and special signals

* env: change signal values to be non-constant

* env: adds testing for signal ignoring

* env: styling and remove unix specific derive

* test_env: add SIGSTOP to cspell workspace wordlist

* env: makes signal handling unix specific

* env: make ignore-signal function invocation unix specific

* test_env: make signal vector use slices ref instead of vec (linter)

* env: makes ignore-signal in options unix specific

* test_env: add unix specific import
2024-05-23 22:01:39 +02:00
Daniel Hofstetter
a2bc0ffdb0 env: remove dependency on GNU env in tests 2024-04-22 14:55:14 +02:00
Daniel Hofstetter
c83cec7c0c env: move unit tests to env.rs 2024-04-21 01:26:50 +02:00
Daniel Hofstetter
29e5d0b42b clippy: fix redundant_clone lint warnings in tests 2024-04-21 01:26:50 +02:00
Ulrich Hornung
eca8130a4a feature: env argv0 overwrite (unix only) 2024-04-07 01:27:30 +02:00
Krysztal112233
d21dc125d0
lint: fix clippy::suspicious_open_options of project. 2024-03-23 16:49:35 +08:00
Ulrich Hornung
c62ba559d0 env: support string args by "-S", "-vS" or "--split-strings" 2024-03-19 00:45:05 +01:00
Sylvestre Ledru
bfca6bf70f Add license headers on all files 2023-08-21 10:49:27 +02:00
Miles Liu
81a4e8fb7d
Remove keep_env from the test framework 2023-03-24 14:25:37 +08:00
Daniel Hofstetter
6988eb7ec6 tests: expand wildcard imports 2023-03-20 15:32:35 +01:00
Joining7943
1c230fd779 tests/util: Refactor UCommand and TestScenario.
Summary of changes in UCommand:
* Extend UCommand by builder methods and simplify methods in TestScenario
* Simplify code structures where possible. Add documentation.
* Store bin_path as PathBuf and util_name as String in all structs
* Remove UCommand::util and make bin_path, temp_dir private
* Rename UCommand::with_limit -> UCommand::limit

Summary of changes in TestScenario:
* Rename some parameters in TestScenario methods to be more descriptive
* Remove ucmd_keepenv, cmd_keepenv from TestScenario. Use UCommand::keep_env instead.
2023-02-18 23:38:20 +01:00
Joining7943
1fadeb43b2 tests/util: Do not trim stderr in CmdResult::stderr_is. Add method stderr_trimmed_is.
Fix tests assert whitespace instead of trimming it. Disable some tests in `test_tr` because `tr`
produces too many newlines.
2023-01-22 14:56:19 +01:00
Daniel Hofstetter
8114abc956 Fix "needless borrow" clippy warning in env test 2022-11-04 11:10:35 +01:00
Terts Diepraam
b0c200e831 env: handle - correctly again 2022-10-13 20:06:02 +02:00
Terts Diepraam
b7c1216a1a env: update to clap 4 2022-10-13 17:50:29 +02:00
Terts Diepraam
9177cb7b24 all: add tests for usage error exit code 2022-09-10 20:59:42 +02:00
Terts Diepraam
18369dc0be all: use array intoiterator 2022-04-05 10:39:31 +02:00
Daniel Eades
4f8d1c5fcf add additional lints 2022-01-31 20:40:47 +01:00
Daniel Eades
784f2e2ea1 use semicolons if nothing returned 2022-01-30 15:08:26 +01:00
Thomas Queiroz
124f929848
tests/env: change Windows test_change_directory
Invoke `cmd.exe /C cd` to determine the current working directory instead of relying on the output of
environment variables.
2021-11-07 23:11:39 -03:00
Thomas Queiroz
c44b5952b8
tests/env: add unsetting invalid variables test 2021-11-02 19:51:37 -03:00
Thomas Queiroz
f9512e5a90
tests/env: add empty name test 2021-11-02 16:45:39 -03:00
Roy Ivy III
5553416b87 tests ~ fix clippy complaint (clippy::bool_assert_comparision) 2021-06-06 19:17:18 -05:00
Roy Ivy III
4e20dedf58 tests ~ refactor/polish spelling (comments, names, and exceptions) 2021-05-31 08:23:57 -05:00
Jan Scheer
3aeccfd802 fix a lot of clippy warnings 2021-05-29 15:11:22 +02:00
Jan Scheer
646c6cacbc refactor tests (#1982) 2021-04-23 02:28:46 +02:00
Sylvestre Ledru
c5b43c0994 rustfmt the recent change 2021-04-17 13:21:30 +02:00
Gilad Naaman
81d42aa2b3 Fix some tests to not use CmdResult fields 2021-04-10 23:30:50 +03:00
Sylvestre Ledru
e331186fee
unbreak build with rustc 1.32: force tempfile 3.1.0 (#1695) 2021-01-19 08:15:53 +01:00
Felipe Lema
ba6b55f117 feature[env]: Add support for --chdir=DIR in env (fixes #1568) (#1569) 2020-08-08 22:26:49 -05:00
Roy Ivy III
de0375f909 tests ~ reorganize tests 2020-06-01 18:30:04 -05:00
Renamed from tests/test_env.rs (Browse further)