about summary refs log tree commit diff
path: root/tests/run-make
AgeCommit message (Collapse)AuthorLines
2024-06-11Auto merge of #125752 - jieyouxu:kaboom, r=Kobzolbors-8/+8
run-make: arm command wrappers with drop bombs This PR is one in a series of cleanups to run-make tests and the run-make-support library. ### Summary It's easy to forget to actually executed constructed command wrappers, e.g. `rustc().input("foo.rs")` but forget the `run()`, so to help catch these mistakes, we arm command wrappers with drop bombs on construction to force them to be executed by test code. This PR also removes the `Deref`/`DerefMut` impl for our custom `Command` which derefs to `std::process::Command` because it can cause issues when trying to use a custom command: ```rs htmldocck().arg().run() ``` fails to compile because the `arg()` is resolved to `std::process::Command::arg`, which returns `&mut std::process::Command` that doesn't have a `run()` command. This PR also: - Removes `env_var` on the `impl_common_helper` macro that was wrongly named and is a footgun (no users). - Bumps the run-make-support library to version `0.1.0`. - Adds a changelog to the support library. ### Details Especially for command wrappers like `Rustc`, it's very easy to build up a command invocation but forget to actually execute it, e.g. by using `run()`. This commit adds "drop bombs" to command wrappers, which are armed on command wrapper construction, and only defused if the command is executed (through `run`, `run_fail`). If the test writer forgets to execute the command, the drop bomb will "explode" and panic with an error message. This is so that tests don't silently pass with constructed-but-not-executed command wrappers. This PR is best reviewed commit-by-commit. try-job: x86_64-msvc
2024-06-11tests/run-make: update tests to use new API许杰友 Jieyou Xu (Joe)-8/+8
2024-06-11Rename `needs-matching-clang` to `needs-force-clang-based-tests`Zalathar-5/+17
This header is much more restrictive than its old name would suggest. As a result, most of the tests that use it don't actually run in any CI jobs.
2024-06-10Rollup merge of #126223 - jieyouxu:rmake-run-in-tmpdir-self-test, r=KobzolMatthias Krüger-0/+38
run-make: add `run_in_tmpdir` self-test Add a basic sanity test for `run_in_tmpdir` to make sure that files (including read-only files) and directories created inside the "scratch" tmpdir are removed after the closure returns. r? ghost (while i run a try job) try-job: x86_64-msvc
2024-06-10Rollup merge of #126211 - lolbinarycat:llvm-outputs-rmake, r=jieyouxuMatthias Krüger-5/+20
migrate tests/run-make/llvm-outputs to use rmake.rs part of #121876 <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r​? <reviewer name> -->
2024-06-10run-make: add run_in_tmpdir self-test许杰友 Jieyou Xu (Joe)-0/+38
2024-06-10migrate tests/run-make/llvm-outputs to use rmake.rsbinarycat-5/+20
part of #121876
2024-06-09rewrite `short-ice` in `rmake` formatOneirical-46/+31
2024-06-09rustdoc: Add support for --remap-path-prefixEdward Shen-0/+2
Adds --remap-path-prefix as an unstable option. This is implemented to mimic the behavior of rustc's --remap-path-prefix but with minor adjustments. This flag similarly takes in two paths, a prefix to replace and a replacement string.
2024-06-09Auto merge of #126087 - jieyouxu:rmake-docs, r=Kobzolbors-0/+43
run-make: add some basic docs about the test suite's setup r? `@Kobzol`
2024-06-08run-make: add some basic docs about the test suite's setup许杰友 Jieyou Xu (Joe)-0/+43
2024-06-08Migrate runmake tests away from custom commands and `command_output`Jakub Beránek-107/+86
2024-06-08Auto merge of #126097 - Kobzol:runmake-change-cwd, r=jieyouxubors-240/+199
Change how runmake v2 tests are executed This PR makes execution of v2 runmake tests more sane, by executing each test in a temporary directory by default, rather than running it inside `tests/run-make`. This will have.. a lot of conflicts. Fixes: https://github.com/rust-lang/rust/issues/126080 Closes https://github.com/rust-lang/rust/issues/125726, because it removes `tmp_dir`, lol. r? `@jieyouxu` try-job: x86_64-msvc
2024-06-08Fix windows testJakub Beránek-2/+2
2024-06-08Remove unnecessary functions and the last mention of TMPDIR from ↵Jakub Beránek-16/+17
`run-make-support`
2024-06-07Rollup merge of #126112 - Kobzol:runmake-source-root, r=jieyouxuMatthias Krüger-2/+2
Clean up source root in run-make tests The name `S` isn't exactly the most descriptive, and we also shouldn't need to pass it when building (actually I think that most of the env. vars that we pass to `cargo` here are probably not really needed). Related issue: https://github.com/rust-lang/rust/issues/126071 r? ```@jieyouxu```
2024-06-07Address review commentsJakub Beránek-8/+8
2024-06-07Remove all usages of `tmp_dir` from testsJakub Beránek-206/+175
2024-06-07Fix `bare-outfile` testJakub Beránek-5/+1
2024-06-07Fix `mixing-formats` run-make testJakub Beránek-17/+10
2024-06-07Do not pass source root when building run-make testsJakub Beránek-2/+2
2024-06-06Rollup merge of #126098 - Kobzol:remove-same-lib-runmake-test, r=jieyouxuJubilee-32/+0
Remove `same-lib-two-locations-no-panic` run-make test This test doesn't really make any sense anymore, it became broken a long time ago. r? ``@jieyouxu``
2024-06-06Auto merge of #126104 - workingjubilee:rollup-t1ac2ld, r=workingjubileebors-18/+19
Rollup of 12 pull requests Successful merges: - #125220 (Repair several `riscv64gc-unknown-linux-gnu` codegen tests) - #126033 (CI: fix publishing of toolstate history) - #126034 (Clarify our tier 1 Windows Server support) - #126035 (Some minor query system cleanups) - #126051 (Clarify an `x fmt` error.) - #126059 (Raise `DEFAULT_MIN_STACK_SIZE` to at least 64KiB) - #126064 (Migrate `run-make/manual-crate-name` to `rmake.rs`) - #126072 (compiletest: Allow multiple `//@ run-flags:` headers) - #126073 (Port `tests/run-make-fulldeps/obtain-borrowck` to ui-fulldeps) - #126081 (Do not use relative paths to Rust source root in run-make tests) - #126086 (use windows compatible executable name for libcxx-version) - #126096 ([RFC-2011] Allow `core_intrinsics` when activated) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-06Rollup merge of #126081 - Kobzol:run-make-relative-paths, r=jieyouxuJubilee-13/+13
Do not use relative paths to Rust source root in run-make tests Pre-requisite for https://github.com/rust-lang/rust/issues/126080. Fixes: https://github.com/rust-lang/rust/issues/126071 r? `@jieyouxu`
2024-06-06Rollup merge of #126064 - GuillaumeGomez:migrate-run-make-manual-crate-name, ↵Jubilee-5/+6
r=jieyouxu Migrate `run-make/manual-crate-name` to `rmake.rs` Part of https://github.com/rust-lang/rust/issues/121876. r? ``@jieyouxu``
2024-06-06Remove `same-lib-two-locations-no-panic` run-make testJakub Beránek-32/+0
This test doesn't really make any sense anymore, it became broken a long time ago.
2024-06-06Do not use relative paths to Rust source root in run-make testsJakub Beránek-13/+13
2024-06-06add non-regression run-make test for issues 125474, 125484, and 125646Rémy Rakic-0/+28
2024-06-06Migrate `run-make/manual-crate-name` to `rmake.rs`Guillaume Gomez-5/+6
2024-06-05Rollup merge of #125683 - Oneirical:patience-testing-test, r=jieyouxuJubilee-34/+57
Rewrite `suspicious-library`, `resolve-rename` and `incr-prev-body-beyond-eof` `run-make` tests in `rmake.rs` format Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Some oddly specific ignore flags in `incr-prev-body-beyond-eof`: ```rs // ignore-none // ignore-nvptx64-nvidia-cuda ``` it could be interesting to run a try job, but it seems there is no nvidia-cuda in the CI settings (`jobs.yml`). try-job: armhf-gnu
2024-06-04Auto merge of #125989 - GuillaumeGomez:rollup-xu69i13, r=GuillaumeGomezbors-8/+7
Rollup of 11 pull requests Successful merges: - #106186 (Add function `core::iter::chain`) - #125596 (Convert `proc_macro_back_compat` lint to an unconditional error.) - #125696 (Explain differences between `{Once,Lazy}{Cell,Lock}` types) - #125917 (Create `run-make` `env_var` and `env_var_os` helpers) - #125927 (Ignore `vec_deque_alloc_error::test_shrink_to_unwind` test on non-unwind targets) - #125930 (feat(opt-dist): new flag `--benchmark-cargo-config`) - #125932 (Fix typo in the docs of `HashMap::raw_entry_mut`) - #125933 (Update books) - #125944 (Update fuchsia maintainers) - #125946 (Include trailing commas in wrapped function declarations [RustDoc]) - #125973 (Remove `tests/run-make-fulldeps/pretty-expanded`) Failed merges: - #125815 (`rustc_parse` top-level cleanups) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-04rewrite suspicious-library in rmakeOneirical-27/+29
2024-06-04Auto merge of #125426 - jieyouxu:rmake-support-env-reset, r=saethlinbors-1/+0
Update `compiler-builtins` test to not clear essential env vars Noticed in https://github.com/rust-lang/rust/pull/122580#issuecomment-2125755689, the `compiler-builtins` test failed on Windows for a `cargo` invocation because necessary env vars `TMP` and `TEMP` were cleared by `Command::env_clear`, causing temp dir eventually used by codegen to fallback to the Windows directory, which will trigger permission errors. This PR removes the `env_clear` on the cargo invocation. r? `@saethlin` (feel free to reroll, since you authored the test) try-job: x86_64-msvc try-job: test-various
2024-06-04Create `run-make` `env_var` and `env_var_os` helpersGuillaume Gomez-8/+7
2024-06-04compiler-builtins: don't clear env vars for cargo invocation许杰友 Jieyou Xu (Joe)-1/+0
2024-06-04Rollup merge of #125818 - Urgau:print-check-cfg-no-values, r=petrochenkov许杰友 Jieyou Xu (Joe)-0/+14
Handle no values cfgs with `--print=check-cfg` This PR fix a bug with `--print=check-cfg`, where no values cfgs where not printed since we only printed cfgs that had at least one values. The representation I choose is `CFG=`, since it doesn't correspond to any valid config, it also IMO nicely complements the `values()` (to indicate no values). Representing the absence of value by the absence of the value. So for `cfg(feature, values())` we would print `feature=`. I also added the missing tracking issue number in the doc. r? ```@petrochenkov```
2024-06-04Auto merge of #122597 - pacak:master, r=bjorn3bors-0/+66
Show files produced by `--emit foo` in json artifact notifications Right now it is possible to ask `rustc` to save some intermediate representation into one or more files with `--emit=foo`, but figuring out what exactly was produced is difficult. This pull request adds information about `llvm_ir` and `asm` intermediate files into notifications produced by `--json=artifacts`. Related discussion: https://internals.rust-lang.org/t/easier-access-to-files-generated-by-emit-foo/20477 Motivation - `cargo-show-asm` parses those intermediate files and presents them in a user friendly way, but right now I have to apply some dirty hacks. Hacks make behavior confusing: https://github.com/hintron/computer-enhance/issues/35 This pull request introduces a new behavior: now `rustc` will emit a new artifact notification for every artifact type user asked to `--emit`, for example for `--emit asm` those will include all the `.s` files. Most users won't notice this behavior, to be affected by it all of the following must hold: - user must use `rustc` binary directly (when `cargo` invokes `rustc` - it consumes artifact notifications and doesn't emit anything) - user must specify both `--emit xxx` and `--json artifacts` - user must refuse to handle unknown artifact types - user must disable incremental compilation (or deal with it better than cargo does, or use a workaround like `save-temps`) in order not to hit #88829 / #89149
2024-06-03Auto merge of #125383 - Oneirical:bundle-them-up, r=jieyouxubors-106/+128
Rewrite `emit`, `mixing-formats` and `bare-outfile` `run-make` tests in `rmake.rs` format Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). try-job: x86_64-msvc
2024-06-02Remove some allowed-makefilesOneirical-70/+77
2024-06-02Rollup merge of #125808 - ↵Jubilee-21/+41
GuillaumeGomez:migrate-run-make-c-link-to-rust-dylib, r=jieyouxu Migrate `run-make/c-link-to-rust-dylib` to `rmake.rs` Part of https://github.com/rust-lang/rust/issues/121876. First commit comes from https://github.com/rust-lang/rust/pull/125773. r? `@jieyouxu`
2024-06-02Rollup merge of #125849 - GuillaumeGomez:migrate-emit-named-files, r=jieyouxuJubilee-33/+25
Migrate `run-make/emit-named-files` to `rmake.rs` Part of https://github.com/rust-lang/rust/issues/121876. r? `@jieyouxu`
2024-06-02Migrate `run-make/c-link-to-rust-dylib` to `rmake.rs`Guillaume Gomez-21/+41
2024-06-02Handle no values cfg with --print=check-cfgUrgau-0/+14
2024-06-02Auto merge of #125822 - Urgau:print-check-cfg-refactor-test, r=jieyouxubors-64/+86
Refactor `--print=check-cfg` test *as asked in https://github.com/rust-lang/rust/pull/125818#discussion_r1622463592* r? `@jieyouxu`
2024-06-01Migrate `run-make/emit-named-files` to `rmake.rs`Guillaume Gomez-33/+25
2024-06-01Migrate `run-make/cdylib` to `rmake.rs`Guillaume Gomez-23/+36
2024-05-31Refactor --print=check-cfg testUrgau-64/+86
2024-05-31Auto merge of #125759 - nnethercote:format-some-tests, r=GuillaumeGomezbors-371/+422
Format some tests There are more directories under `tests/` still to do, but this is enough for one PR. r? `@GuillaumeGomez`
2024-05-31Run rustfmt on `tests/run-make/`.Nicholas Nethercote-371/+422
With the exception of `tests/run-make/translation/test.rs`, which has a syntax error. The expected output in `rustdoc-error-lines/rmake.rs`'s required slight tweaking. The two `reproducible-build.rs` files need `// ignore-tidy-linelength` because rustfmt produces lines longer than 100 chars, which tidy doesn't like, yuk.
2024-05-30rewrite mixing-formats testOneirical-75/+87