about summary refs log tree commit diff
path: root/tests/ui/attributes/unix_sigpipe
AgeCommit message (Collapse)AuthorLines
2024-05-02Change `SIGPIPE` ui from `#[unix_sigpipe = "..."]` to `-Zon-broken-pipe=...`Martin Nordholts-384/+0
In the stabilization attempt of `#[unix_sigpipe = "sig_dfl"]`, a concern was raised related to using a language attribute for the feature: Long term, we want `fn lang_start()` to be definable by any crate, not just libstd. Having a special language attribute in that case becomes awkward. So as a first step towards towards the next stabilization attempt, this PR changes the `#[unix_sigpipe = "..."]` attribute to a compiler flag `-Zon-broken-pipe=...` to remove that concern, since now the language is not "contaminated" by this feature. Another point was also raised, namely that the ui should not leak **how** it does things, but rather what the **end effect** is. The new flag uses the proposed naming. This is of course something that can be iterated on further before stabilization.
2024-04-29Typo fix: exec:ing -> exec'ingMartin Nordholts-1/+1
2024-04-24Rollup merge of #123316 - Enselic:sigpipe-inherit-variants, r=fmeaseLeón Orell Valerian Liehr-8/+39
Test `#[unix_sigpipe = "inherit"]` with both `SIG_DFL` and `SIG_IGN` Extend our `#[unix_sigpipe = "inherit"]` test so that it detects if `SIGPIPE` wrongly ends up being `SIG_DFL` when the parent has `SIG_IGN`. We have no current test for this particular case. Tracking issue: https://github.com/rust-lang/rust/issues/97889
2024-04-17Remove libc from more testsBen Kimock-2/+0
2024-04-13Test `#[unix_sigpipe = "inherit"]` with both `SIG_DFL` and `SIG_IGN`Martin Nordholts-8/+39
Add a test that fails if `#[unix_sigpipe = "inherit"]` wrongly results in `SIGPIPE` being `SIG_DFL` if the parent has `SIG_IGN`. We have no current test for this particular case.
2024-03-25unix_sigpipe: Add test for SIGPIPE disposition in child processesMartin Nordholts-0/+90
For robustness, also test the disposition in our own process even if other tests in `tests/ui/attributes/unix_sigpipe` already covers it.
2024-03-12tests: Add ui/attributes/unix_sigpipe/unix_sigpipe-str-list.rsMartin Nordholts-1/+13
Which is a variant of [`unix_sigpipe-list.rs`][1] but where a string is used instead of an identifier. This makes it more similar to the proper form `#[unix_sigpipe = "sig_dfl"]` and thus more likely to be written by users by mistake. Also rename the first test to be more in line with the terminology of [The Reference][2]. [1]: https://github.com/rust-lang/rust/blob/master/tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.rs [2]: https://doc.rust-lang.org/reference/attributes.html#meta-item-attribute-syntax
2024-03-11unix_sigpipe: Replace `inherit` with `sig_dfl` in syntax testsMartin Nordholts-14/+14
The `sig_dfl` variant of the attribute is the most likely variant to be stabilized first, and thus to become the "most allowed" variant of the attribute. Because of this, it is the most appropriate variant to use in syntax tests, because even if the most allowed variant is used, the compiler shall still emit errors if it e.g. is used in the wrong places.
2024-03-10diagnostics: Do not suggest using `#[unix_sigpipe]` without a valueMartin Nordholts-11/+4
Remove `Word` from the `unix_sigpipe` attribute template so that plain `#[unix_sigpipe]` is not included in suggestions of valid forms of the attribute. Also re-arrange diagnostics code slightly to avoid duplicate diagnostics.
2024-02-28Rollup merge of #121527 - Enselic:unix_sigpipe-tests-fixes, r=davidtwcoGuillaume Gomez-16/+25
unix_sigpipe: Simple fixes and improvements in tests In https://github.com/rust-lang/rust/pull/120832 I included 5 preparatory commits. It will take a while before discussions there and in https://github.com/rust-lang/rust/issues/62569 is settled, so here is a PR that splits out 4 of the commits that are easy to review, to get them out of the way. r? ``@davidtwco`` who already approved these commits in https://github.com/rust-lang/rust/pull/120832 (but I have tweaked them a bit and rebased them since then). For the convenience of my reviewer, here are the full commit messages of the commits: <details> <summary>Click to expand</summary> ``` commit 948b1d68abdf6ccde608831401dfe35af4a8cb04 (HEAD -> unix_sigpipe-tests-fixes, origin/unix_sigpipe-tests-fixes) Author: Martin Nordholts <martin.nordholts@codetale.se> Date: Fri Feb 9 07:57:27 2024 +0100 tests: Add unix_sigpipe-different-duplicates.rs test variant To make sure that #[unix_sigpipe = "x"] #[unix_sigpipe = "y"] behaves like #[unix_sigpipe = "x"] #[unix_sigpipe = "x"] commit d14f15862d2ac7111f70efe82882fb3575167a53 Author: Martin Nordholts <martin.nordholts@codetale.se> Date: Fri Feb 9 08:47:47 2024 +0100 tests: Combine unix_sigpipe-not-used.rs and unix_sigpipe-only-feature.rs The only difference between the files is the presence/absence of #![feature(unix_sigpipe)] attribute. Avoid duplication by using revisions instead. commit a1cb3dba840fd56a7f9a0c90346a1fcddc641f9c Author: Martin Nordholts <martin.nordholts@codetale.se> Date: Fri Feb 9 06:44:56 2024 +0100 tests: Rename unix_sigpipe.rs to unix_sigpipe-bare.rs for clarity The test is for the "bare" variant of the attribute that looks like this: #[unix_sigpipe] which is not allowed, because it must look like this: #[unix_sigpipe = "sig_ign"] commit e060274e55a5b09fe6ace6dfe72ca0cca663b711 Author: Martin Nordholts <martin.nordholts@codetale.se> Date: Fri Feb 9 05:48:24 2024 +0100 tests: Fix typo unix_sigpipe-error.rs -> unix_sigpipe-sig_ign.rs There is no error expected. It's simply the "regular" test for sig_ign. So rename it. ``` </details> Tracking issue: https://github.com/rust-lang/rust/issues/97889
2024-02-24Don't unnecessarily change `SIGPIPE` disposition in unix_sigpipe testsMartin Nordholts-6/+6
In `auxiliary/sigpipe-utils.rs`, all we want to know is the current `SIGPIPE` disposition. We should not change it. So use `libc::sigaction` instead of `libc::signal`. That way we can also remove the code that restores it.
2024-02-23tests: Add unix_sigpipe-different-duplicates.rs test variantMartin Nordholts-2/+21
To make sure that #[unix_sigpipe = "x"] #[unix_sigpipe = "y"] behaves like #[unix_sigpipe = "x"] #[unix_sigpipe = "x"]
2024-02-23tests: Combine unix_sigpipe-not-used.rs and unix_sigpipe-only-feature.rsMartin Nordholts-13/+3
The only difference between the files is the presence/absence of #![feature(unix_sigpipe)] attribute. Avoid duplication by using revisions instead.
2024-02-23tests: Rename unix_sigpipe.rs to unix_sigpipe-bare.rs for clarityMartin Nordholts-1/+1
The test is for the "bare" variant of the attribute that looks like this: #[unix_sigpipe] which is not allowed, because it must look like this: #[unix_sigpipe = "sig_ign"]
2024-02-23tests: Fix typo unix_sigpipe-error.rs -> unix_sigpipe-sig_ign.rsMartin Nordholts-0/+0
There is no error expected. It's simply the "regular" test for sig_ign. So rename it.
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-12/+12
2023-11-24Show number in error message even for one errorNilstrieb-9/+9
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-26Tweak suggestion spans for invalid crate-level inner attributeEsteban Küber-2/+6
CC #89566.
2023-01-11Move /src/test to /testsAlbert Larsan-0/+247