53 Commits

Author SHA1 Message Date
Jynn Nelson 20404bf4a6 Split out linker-info from linker-messages
- Hide common linker output behind `linker-info`
- Add tests
- Account for different capitalization on windows-gnu when removing
  "warning" prefix
- Add some more comments
- Add macOS deployment-target test
- Ignore linker warnings from trying to statically link glibc

  I don't know what's going on in `nofile-limit.rs` but I want no part
  of it.

- Use a fake linker so tests are platform-independent
2026-03-06 10:38:21 +01:00
Urgau 0acc846387 Normalize away the maybe remapped paths to the compiler and std 2025-12-18 21:18:05 +01:00
Waffle Lapkin 98430c4d9d remove unused features from some tests 2025-12-02 11:07:42 +01:00
Michael van Straten 24b0c27b9a Add new inherit_handles flag to CommandExt trait
This patch adds a new flag to the [`CommandExt`](1) trait to set whether to
inherit the handles of the calling process (2) on Windows systems.

ACP: https://github.com/rust-lang/libs-team/issues/264

[1]: https://doc.rust-lang.org/stable/std/os/windows/process/trait.CommandExt.html
[2]: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw
2025-10-21 18:53:46 +02:00
Guillaume Gomez 97eaf45e31 Ignore more failing ui tests in GCC backend 2025-10-13 15:20:49 +02:00
Guillaume Gomez a535c7be54 Ignore more failing ui tests for GCC backend 2025-09-26 15:33:48 +02:00
Mads Marquart 37be93497e Fix test suite in iOS/tvOS/watchOS/visionOS simulator 2025-09-19 13:55:03 +02:00
Trevor Gross 289fe36d37 Print thread ID in panic message if thread name is unknown
`panic!` does not print any identifying information for threads that are
unnamed. However, in many cases, the thread ID can be determined.

This changes the panic message from something like this:

    thread '<unnamed>' panicked at src/main.rs:3:5:
    explicit panic

To something like this:

    thread '<unnamed>' (0xff9bf) panicked at src/main.rs:3:5:
    explicit panic

Stack overflow messages are updated as well.

This change applies to both named and unnamed threads. The ID printed is
the OS integer thread ID rather than the Rust thread ID, which should
also be what debuggers print.
2025-08-06 23:59:47 +00:00
Guillaume Gomez de93fb13fe Add ignore-backends annotations in failing GCC backend ui tests 2025-07-23 13:48:04 +02:00
Matthias Krüger 66799d0b83 Rollup merge of #143303 - Kivooeo:tf28, r=tgross35
`tests/ui`: A New Order [28/28] FINAL PART

> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.

Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.

r? ``@tgross35``
2025-07-11 07:35:19 +02:00
Kivooeo 259512e3b6 cleaned up some tests 2025-07-10 18:50:35 +05:00
наб a0111ec7a1 awhile -> a while where appropriate 2025-07-02 20:17:29 +02:00
Kivooeo 1fb5e0149f moved tests 2025-07-01 23:33:59 +05:00
Chris Denton a6e4d03086 Test Command::current_dir with verbatim path 2025-03-24 18:57:22 +00:00
Chris Denton 4fcebee60a Fix Windows Command search path bug 2025-02-26 13:56:47 +00:00
Xing Xue 0ffb771607 Use yes except target_os = "nto". 2025-02-18 16:22:16 +00:00
Chris Denton 630727006f Move two windows process tests to tests/ui 2025-02-07 10:43:50 +00:00
许杰友 Jieyou Xu (Joe) 071ad3795c tests: use needs-threads instead of ignore-emscripten 2025-01-23 20:51:29 +08:00
许杰友 Jieyou Xu (Joe) 8a0310a0b1 tests: use needs-subprocess instead of ignore-{wasm32,emscripten,sgx} 2025-01-23 20:51:29 +08:00
许杰友 Jieyou Xu (Joe) 1abb93608f tests: cleanup tests/ui/process/issue-13304.rs
- Remove unnecessary `mut`, remove `#[allow(unused_mut)]`.
- Replace `ignore-*` with `needs-subprocess`.
2025-01-23 20:51:29 +08:00
许杰友 Jieyou Xu (Joe) 0cc392e5fa tests: cleanup tests/ui/process/sigpipe-should-be-ignored.rs
- Unwrap a must-use I/O result and remove `#![allow(unused_must_use)]`.
- Replace `ignore-*` with `needs-subprocess`.
2025-01-23 20:51:29 +08:00
许杰友 Jieyou Xu (Joe) 7eaa6ec8f7 tests: cleanup tests/ui/process/try-wait.rs
- Remove already stable feature gate and remove
  `#![allow(stable_features)]`.
- Replace `ignore-*` with `needs-subprocess`.
2025-01-23 20:51:29 +08:00
许杰友 Jieyou Xu (Joe) c7c1e4d655 tests: cleanup tests/ui/process/issue-14456.rs
- Remove unnecessary `mut` and remove `#![allow(unused_mut)]`.
- Replace `ignore-*` with `needs-process`.
2025-01-23 20:51:29 +08:00
许杰友 Jieyou Xu (Joe) b617aae20e tests: cleanup tests/ui/process/process-panic-after-fork.rs
- Replace `ignore-windows` with `only-unix`.
- Replace `ignore-*` with `needs-subprocess`.
2025-01-23 20:51:29 +08:00
许杰友 Jieyou Xu (Joe) a4a3acace6 tests: cleanup tests/ui/process/fds-are-cloexec.rs
- Replace `ignore-windows` with `only-unix`.
- Replace `ignore-*` with `needs-subprocess`.
2025-01-23 20:51:29 +08:00
许杰友 Jieyou Xu (Joe) 635a06b595 tests: cleanup tests/ui/process/process-exit.rs
- Remove unnecessary `#![allow(unused_imports)]`.
- Replace `ignore-*` with `needs-subprocess`.
2025-01-23 20:51:29 +08:00
许杰友 Jieyou Xu (Joe) 02c003b50e tests: cleanup tests/ui/process/issue-20091.rs
- Remove already stable feature gate and remove
  `#![allow(stable_features)]`.
- Replace `ignore-*` with `needs-subprocess`.
2025-01-23 20:51:29 +08:00
许杰友 Jieyou Xu (Joe) 83226094e7 tests: cleanup tests/ui/process/signal-exit-status.rs
- Replace `ignore-windows` -> `only-unix` since the test exercises Unix
  signals and `ExitStatus::code` behavior that's specific to Unix.
- Replace `ignore-*` with `needs-subprocess`.
2025-01-23 20:51:29 +08:00
许杰友 Jieyou Xu (Joe) 2632fdc298 tests: cleanup tests/ui/process/core-run-destroy.rs
- Remove redundant `#![allow(stable_features)]`.
- Replace `ignore-*` with `needs-subprocess`.
2025-01-23 20:51:29 +08:00
John Kåre Alsaker 4bf85c25ec Try to write the panic message with a single write_all call 2025-01-01 15:58:29 +01:00
Zalathar 835fbcbcab Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
Kornel eadea7764e Use c"lit" for CStrings without unwrap 2024-12-02 18:16:36 +00:00
Ralf Jung c4cab8a15c bless tests for changed library path 2024-11-30 11:22:52 +01:00
Hood Chatham 1d6643c4f6 Fix most ui tests on emscripten target
To fix the linker errors, we need to set the output extension to `.js` instead
of `.wasm`. Setting the output to a `.wasm` file puts Emscripten into standalone
mode which is effectively a distinct target. We need to set the runner to be
`node` as well.

This fixes most of the ui tests. I fixed a few more tests with simple problems:
- `intrinsics/intrinsic-alignment.rs` and `structs-enums/rec-align-u64.rs` --
Two `#[cfg]` macros match for Emscripten so we got a duplicate definition of
`mod m`.
- `issues/issue-12699.rs` -- Seems to hang so I disabled it
- `process/process-sigpipe.rs` -- Not expected to work on Emscripten so I
disabled it
2024-10-15 14:25:55 +02:00
bjorn3 feeeb5c48e Bless tests 2024-08-02 11:34:54 +00:00
Zalathar 9aaa0c5867 Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
Jubilee Young d89500843c Move 100 entries from tests/ui into subdirs
- Move super-fast-paren-parsing test into ui/parser
- Move stmt_expr_attrs test into ui/feature-gates
- Move macro tests into ui/macros
- Move global_asm tests into ui/asm
- Move env tests into ui/process
- Move xcrate tests into ui/cross-crate
- Move unop tests into ui/unop
- Move backtrace tests into ui/backtrace
- Move check-static tests into ui/statics
- Move expr tests into ui/expr
- Move optimization fuel tests into ui/fuel
- Move ffi attribute tests into ui/ffi-attrs
- Move suggestion tests into ui/suggestions
- Move main tests into ui/fn-main
- Move lint tests into ui/lint
- Move repr tests into ui/repr
- Move intrinsics tests into ui/intrinsics
- Move tool lint tests into ui/tool-attributes
- Move return tests into ui/return
- Move pattern tests into ui/patttern
- Move range tests into ui/range
- Move foreign-fn tests into ui/foreign
- Move orphan-check tests into ui/coherence
- Move inference tests into ui/inference
- Reduce ROOT_ENTRY_LIMIT
2024-05-20 19:55:59 -07:00
Ben Kimock 18b0a07d49 Handle a few more simple tests 2024-05-20 11:13:10 -04:00
Martin Nordholts cde0cde151 Change SIGPIPE ui from #[unix_sigpipe = "..."] to -Zon-broken-pipe=...
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-05-02 19:48:29 +02:00
Ben Kimock 7457a0d441 Use the rustc_private libc less in tests 2024-04-15 08:54:11 -04:00
Alex Crichton cf6d6050f7 Update test directives for wasm32-wasip1
* The WASI targets deal with the `main` symbol a bit differently than
  native so some `codegen` and `assembly` tests have been ignored.
* All `ignore-emscripten` directives have been updated to
  `ignore-wasm32` to be more clear that all wasm targets are ignored and
  it's not just Emscripten.
* Most `ignore-wasm32-bare` directives are now gone.
* Some ignore directives for wasm were switched to `needs-unwind`
  instead.
* Many `ignore-wasm32*` directives are removed as the tests work with
  WASI as opposed to `wasm32-unknown-unknown`.
2024-03-11 09:36:35 -07:00
Caio 2aab000105 Move tests 2024-03-03 16:30:48 -03:00
许杰友 Jieyou Xu (Joe) ec2cc761bc [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
Matthew Jasper 982b49494e Remove revisions for THIR unsafeck
This is to make the diff when stabilizing it easier to review.
2024-01-05 09:30:27 +00:00
Mara Bos 4017c5c945 Fix tests. 2023-07-29 11:47:26 +02:00
Mara Bos 0e729404da Change default panic handler message format. 2023-07-29 11:42:50 +02:00
Martin Nordholts 075a6bbef9 Regression test println!() panic message on ErrorKind::BrokenPipe
No existing test failed if the [`panic!()`][1] of the `println!()`
family of functions was removed, or if its message was changed.

So add such a test.

[1] https://github.com/rust-lang/rust/blob/104f4300cfddbd956e32820ef202a732f06ec848/library/std/src/io/stdio.rs#L1007-L1009
2023-07-26 13:41:39 +02:00
Urgau b84c190b9a Allow newly uplifted invalid_from_utf8 lint 2023-05-27 00:18:28 +02:00
jyn fff8503613 Rollup merge of #109379 - flba-eb:108596_fixtest_sigpipe, r=jyn514
Replace `yes` command by `while-echo` in test `tests/ui/process/process-sigpipe.rs`

The `yes` command is not available on all platforms.

Fixes #108596.

Inviting `@mvf` as he contributed to this patch. Thanks! This issue has been discussed in https://github.com/rust-lang/rust/pull/106673 but was moved to #108596 to get going.

CC `@gh-tr`

r? `@workingjubilee`
`@rustbot` label +O-neutrino

Notes about the comments https://github.com/rust-lang/rust/pull/106673#discussion_r1117324265:
- The `echo` command is `/proc/boot/echo` (not built-in)
- `/bin/sh` is a symlink to `/proc/boot/ksh`
```sh
# ls -l /bin/sh /proc/boot/ksh /proc/boot/echo
lrwxrwxrwx   1 root      root             14 Mar 20 07:52 /bin/sh -> /proc/boot/ksh
-r-xr-xr-x   1 root      root           9390 Sep 12  2022 /proc/boot/echo
-r-xr-xr-x   1 root      root         308114 Sep 12  2022 /proc/boot/ksh
```
2023-04-26 01:55:50 -05:00
Ben Kimock 9f17ede4ac Raise an aborting signal without UB 2023-03-28 21:37:15 -04:00