Commit Graph

51 Commits

Author SHA1 Message Date
Miguel Ojeda
3938541d29 tests: add test for warning-free builds of core under no_global_oom_handling
`tests/run-make/alloc-no-oom-handling` tests that `alloc` under
`no_global_oom_handling` builds and is warning-free.

Do the same for `core` to prevent issues such as [1].

Link: https://github.com/rust-lang/rust/pull/110649 [1]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-04-24 01:56:37 +02:00
Camille GILLOT
9bab866cd3 Bless coverage. 2023-04-20 21:36:22 +00:00
Matthias Krüger
9a13f4f018
Rollup merge of #110525 - jyn514:translation-download-rustc, r=albertlarsan68
Fix `tests/run-make-translation` when download-rustc is enabled

When building locally, we never generate a `share` directory in the local sysroot. However, when we download the `rustc` component from ci, it includes a `share/man` directory in the sysroot. The `run-make/translation` test assumed that it didn't exist, and would create a link from `fakeroot` to the real share directory, and write symbolic links into it. Change it not to create the link, so that rustc doesn't try to load multiple copies of the same `.ftl` file.

Fixes https://github.com/rust-lang/rust/issues/110357.
2023-04-19 17:54:42 +02:00
bors
3a5c8e91f0 Auto merge of #110393 - fee1-dead-contrib:rm-const-traits, r=oli-obk
Rm const traits in libcore

See [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/.60const.20Trait.60.20removal.20or.20rework)

* [x] Bless ui tests
* [ ] Re constify some unstable functions with workarounds if they are needed
2023-04-19 13:03:40 +00:00
Deadbeef
14d1e87db9 temporarily ignore run-make coverage tests 2023-04-19 11:49:47 +00:00
jyn
23cf3ce03b Fix tests/run-make-translation when download-rustc is enabled
When building locally, we never generate a `share` directory in the
local sysroot. However, when we download the `rustc` component from ci,
it includes a `share/man` directory in the sysroot. The
`run-make/translation` test assumed that it didn't exist, and would
create a link from `fakeroot` to the real share directory, and write
symbolic links into it. Change it not to create the link, so that rustc
doesn't try to load multiple copies of the same `.ftl` file.
2023-04-19 00:39:20 -05:00
Erik Hofmayer
0a763c92f2 Make commit-date pattern more specific in test for issue 107094 2023-04-17 18:53:52 +02:00
Erik Hofmayer
550df4d34b Change mode of Makefile of test for issue 107094 2023-04-16 12:50:32 +02:00
Erik Hofmayer
135e6201fc Add regression test for issue 107094 2023-04-16 12:50:32 +02:00
Eric Huss
79b3af3f62 Temporarily disable the jobserver-error test 2023-04-15 07:40:19 -07:00
Camille GILLOT
c9409136c7 Bless run-make. 2023-04-15 07:46:47 +00:00
Matthias Krüger
d146211c64
Rollup merge of #109036 - chenyukang:yukang/fix-testcase, r=jyn514
Fix diff option conflict in UI test

Trivial fix for test case `tests/run-make/rustdoc-verify-output-files`,
it's failing on MacOS, the `-u` option specifies the unified context format, while the `-q` option specifies only brief output. These two options are incompatible, since the unified context format produces a more detailed output than the brief output format.
2023-04-13 21:58:35 +02:00
Jynn Nelson
67b391968d Replace rustdoc-ui/{c,z}-help tests with a run-make test
This make rustdoc resilient to changes in the debugging options while
still testing that it matches rustc.
2023-04-12 05:34:21 -05:00
Gary Guo
ea69dad8fa Fix coverage test 2023-04-07 10:18:28 +01:00
Gary Guo
2a9d710d99 Bless tests 2023-04-06 09:34:17 +01:00
Pietro Albini
48bea636fa
fix solaris ignore 2023-04-03 10:23:15 +02:00
Pietro Albini
3602200d50
make 32bit ignore more accurate 2023-04-03 10:23:08 +02:00
Pietro Albini
ef2bf6d505
implement --print=all-target-specs-json 2023-04-03 09:24:14 +02:00
bors
33289132ec Auto merge of #109770 - jyn514:run-make-fulldeps, r=Mark-Simulacrum
Move almost all run-make-fulldeps tests to run-make

They pass fine, and this avoids having to build the compiler twice.

There are few enough tests left that I think it should be possible to get rid of this test suite altogether, but I expect this PR to fail at least a few times in bors and want to get it merged before tackling further changes. cc https://github.com/rust-lang/rust/pull/83775

Fixes https://github.com/rust-lang/rust/issues/66085. Fixes https://github.com/rust-lang/rust/issues/83773.
2023-04-03 01:34:05 +00:00
jyn
c45037b956 try to fix test-various 2023-04-02 17:54:24 -04:00
bors
22a7a19f93 Auto merge of #98112 - saethlin:mir-alignment-checks, r=oli-obk
Insert alignment checks for pointer dereferences when debug assertions are enabled

Closes https://github.com/rust-lang/rust/issues/54915

- [x] Jake tells me this sounds like a place to use `MirPatch`, but I can't figure out how to insert a new basic block with a new terminator in the middle of an existing basic block, using `MirPatch`. (if nobody else backs up this point I'm checking this as "not actually a good idea" because the code looks pretty clean to me after rearranging it a bit)
- [x] Using `CastKind::PointerExposeAddress` is definitely wrong, we don't want to expose. Calling a function to get the pointer address seems quite excessive. ~I'll see if I can add a new `CastKind`.~ `CastKind::Transmute` to the rescue!
- [x] Implement a more helpful panic message like slice bounds checking.

r? `@oli-obk`
2023-03-31 08:50:35 +00:00
Joshua Nelson
4851d5663c ignore failing cross-compiled run-make tests
`run-make-fulldeps` is never cross-compiled, so a lot of these tests
never accounted for --target. Ignore them when cross-compiling for
now.
2023-03-30 08:46:31 -05:00
Joshua Nelson
8e214cbc06 fix sysroot-crates-are-unstable for cross-compilation 2023-03-30 08:44:46 -05:00
Joshua Nelson
26e1ce7394 move tools.mk to run-make
apparently I missed some tests in the last commit. Rather than having
dozens of tests use the long version, use the short version in
`run-make` and the long version in `run-make-fulldeps` (which is now
only three tests)
2023-03-30 07:58:50 -05:00
Joshua Nelson
06b2d4b4ab fix wrong includes 2023-03-30 07:43:59 -05:00
Joshua Nelson
433da1fc04 Move almost all run-make-fulldeps to run-make
They pass fine.
2023-03-30 07:34:55 -05:00
Trevor Gross
dc4ba57566 Stabilize a portion of 'once_cell'
Move items not part of this stabilization to 'lazy_cell' or 'once_cell_try'
2023-03-29 18:04:44 -04:00
Matthias Krüger
09c139846b
Rollup merge of #109694 - BelovDV:fix-panic-jobserver-token, r=bjorn3
do not panic on failure to acquire jobserver token

Purpose: remove `panic`.

Rust fails to acquire token if an error in build system occurs - environment variable contains incorrect `jobserver-auth`. It isn't ice so compiler shouldn't panic on such error.

Related issue: #46981
2023-03-29 06:02:42 +02:00
Daniil Belov
be6a09f96b [fix] don't panic on failure to acquire jobserver token 2023-03-28 17:22:30 +03:00
Raoul Strackx
64927b973b Fix LVI test post LLVM 16 update 2023-03-27 13:48:38 +02:00
Matthias Krüger
cfd8105f3f
Rollup merge of #108986 - fortanix:raoul/sync_lvi_patches, r=cuviper
sync LVI tests

The LVI tests for the `x86_64-fortanix-unknown-sgx` target have gotten out of sync. LVI is still mitigated correctly, but the LVI tests need minor modifications. Other (non LVI-related) tests fail when the target applies LVI mitigations as they assume the generated code contains forbidden instructions such as `retq`. These tests are ignored for the sgx environment.

cc: `@jethrogb`
2023-03-24 01:22:05 +01:00
Ben Kimock
8ccf53332e A MIR transform that checks pointers are aligned 2023-03-23 18:23:06 -04:00
Daniel Paoliello
a90f342b03 Use -m option instead of looking for a cross-compiling version of dlltool 2023-03-22 14:30:28 -07:00
yukang
2c66c8f9c6 Fix diff option conflict in UI test 2023-03-12 07:50:39 +08:00
Raoul Strackx
d69ebf7e6c Ignore sgx platform for issue-36710 2023-03-10 17:54:58 +01:00
Raoul Strackx
8428090ee6 Fix run-make LVI tests 2023-03-10 17:54:57 +01:00
Camille GILLOT
684de0418f Update coverage info. 2023-03-09 17:51:38 +00:00
Yuki Okushi
4dc48db310
Rollup merge of #108774 - jyn514:translation-errors, r=davidtwco
Greatly improve the error messages when `run-make/translation` fails

Before:
```
LD_LIBRARY_PATH="/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage0-bootstrap-tools/aarch64-unknown-linux-gnu/release/deps:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage0/lib" '/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation -L /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation  test.rs --sysroot /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation/fakeroot -Ztranslate-lang=zh-CN 2>&1 | grep "this is a test message"
------------------------------------------
--- stderr -------------------------------
make: *** [Makefile:51: sysroot] Error 1
------------------------------------------

failures:
    [run-make] tests/run-make/translation
```

After:

```
LD_LIBRARY_PATH="/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage0-bootstrap-tools/aarch64-unknown-linux-gnu/release/deps:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage0/lib" '/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation -L /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation  test.rs --sysroot /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation/fakeroot -Ztranslate-lang=zh-CN 2>&1 | grep "this is a test message"
[[[ begin stdout ]]]
error: failed to load fluent bundle: failed to add resource: Attempt to override an existing message: "parse_struct_literal_body_without_path".

[[[ end stdout ]]]
Error: cannot match: this is a test message
------------------------------------------
--- stderr -------------------------------
make: *** [Makefile:51: sysroot] Error 1
------------------------------------------

failures:
    [run-make] tests/run-make/translation
```
2023-03-07 23:06:23 +09:00
Joshua Nelson
339980930d Greatly improve the error messages when run-make/translation fails
Before:
```
LD_LIBRARY_PATH="/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage0-bootstrap-tools/aarch64-unknown-linux-gnu/release/deps:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage0/lib" '/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation -L /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation  test.rs --sysroot /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation/fakeroot -Ztranslate-lang=zh-CN 2>&1 | grep "this is a test message"
------------------------------------------
--- stderr -------------------------------
make: *** [Makefile:51: sysroot] Error 1
------------------------------------------

failures:
    [run-make] tests/run-make/translation
```

After:

```
LD_LIBRARY_PATH="/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage0-bootstrap-tools/aarch64-unknown-linux-gnu/release/deps:/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage0/lib" '/home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation -L /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation  test.rs --sysroot /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/test/run-make/translation/translation/fakeroot -Ztranslate-lang=zh-CN 2>&1 | grep "this is a test message"
[[[ begin stdout ]]]
error: failed to load fluent bundle: failed to add resource: Attempt to override an existing message: "parse_struct_literal_body_without_path".

[[[ end stdout ]]]
Error: cannot match: this is a test message
------------------------------------------
--- stderr -------------------------------
make: *** [Makefile:51: sysroot] Error 1
------------------------------------------

failures:
    [run-make] tests/run-make/translation
```
2023-03-05 14:31:36 +00:00
Matthias Krüger
03c1e4d4ff
Rollup merge of #108626 - ozkanonur:consistent-json-docs, r=aDotInTheVoid
rustdoc-json: switch from HashMap to FxHashMap to fix non-determinism

Using `HashMap` in `rustdoc_json_types::Crate` were causing creating randomly ordered objects in the json doc files. Which might cause problems to people who are doing comparison on those files specially in CI pipelines. See https://github.com/rust-lang/rust/issues/103785#issuecomment-1307425590

This PR fixes that issue and extends the coverage of `tests/run-make/rustdoc-verify-output-files` testing ability.
2023-03-05 14:29:09 +01:00
ozkanonur
52c71e6e28 fix inconsistent json outputs from rustdoc
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-03-05 00:09:09 +03:00
Giacomo Pasini
d1f7fa5b4e
Update expected closure coverage info in test 2023-03-03 18:21:27 +01:00
David Wood
a8e37507f4 errors: fix translation's run-make test
`run-make/translation` had some targets that weren't listed in `all` and
thus weren't being tested - the behaviour that should have been being
tested was basically correct fortunately.

Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-22 09:15:54 +00:00
bors
51cb5614dd Auto merge of #105601 - BelovDV:change-rlib-with-not-stable, r=petrochenkov
Enable new rlib in non stable cases

If bundled static library uses cfg (unstable) or whole-archive (wasn't supported) bundled libs are packed even without packed_bundled_libs.

r? `@petrochenkov`
2023-02-12 07:15:27 +00:00
Daniil Belov
601fc8b36b [link] enable packed bundled lib in non stable cases 2023-02-10 12:51:12 +03:00
yukang
257389882d add test for no input file 2023-02-10 08:02:56 +00:00
David Wood
2ff46641a9 incremental: migrate diagnostics
Migrate the `rustc_incremental` crate's diagnostics to translatable
diagnostic structs.

Signed-off-by: David Wood <david.wood@huawei.com>
2023-01-30 17:11:35 +00:00
Mateusz Mikuła
f6ea2ea551 Upgrade mingw-w64 on CI 2023-01-29 13:01:06 +01:00
Oli Scherer
bcc8b05d5c Make output_filenames a real query 2023-01-23 10:35:21 +00:00
Albert Larsan
40ba0e84d5
Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00