Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ui test that are run-pass and that do not test the compiler to library tests #79038

Merged
merged 1 commit into from
Dec 1, 2020

Conversation

CDirkx
Copy link
Contributor

@CDirkx CDirkx commented Nov 14, 2020

Part of #76268, these are some of the relevant ui tests I found that can be replaced by library tests.

Note: this PR just moves the tests, I have not checked for any overlap between these tests and existing library tests. The only test I changed is env_home_dir, where I added code to restore the old home dir after testing.

All moved tests:

ui test library test file test
const\ascii_ctype.rs core\tests\ascii.rs ascii_ctype_const
const\const-str-ptr.rs alloc\tests\str.rs const_str_ptr
assert-eq-trailing-comma.rs core\tests\macros.rs assert_eq_trailing_comma
assert-escape.rs core\tests\macros.rs assert_escape
assert-ne-trailing-comma.rs core\tests\macros.rs assert_ne_trailing_comma
atomic-access-bool.rs core\tests\atomic.rs atomic_access_bool
atomic-alignment.rs core\tests\atomic.rs atomic_alignment
atomic-compare_exchange.rs core\tests\atomic.rs atomic_compare_exchange
atomic-print.rs std\tests\process.rs atomic_print
bool.rs core\tests\bool.rs test_bool
bool_not.rs core\tests\bool.rs test_bool_not
char_unicode.rs core\tests\unicode.rs version
cmp-default.rs core\tests\cmp.rs cmp_default
deref-mut-on-ref.rs core\tests\ops.rs deref_mut_on_ref
deref-on-ref.rs core\tests\ops.rs deref_on_ref
env-home-dir.rs std\tests\env.rs env_home_dir
env-vars.rs std\tests\env.rs env_vars
extend-for-unit.rs core\tests\iter.rs extend_for_unit
offset_from.rs core\tests\ptr.rs offset_from
option-ext.rs core\tests\option.rs option_ext
result-opt-conversions.rs core\tests\result.rs result_opt_conversions
sleep.rs std\tests\thread.rs sleep
try-wait.rs std\tests\process.rs try_wait
utf8.rs alloc\tests\str.rs utf8
utf8_chars.rs alloc\tests\str.rs utf8_chars
wrapping-int-api.rs core\tests\num\wrapping.rs wrapping_int_api

@rust-highfive
Copy link
Collaborator

r? @dtolnay

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 14, 2020
@bors
Copy link
Contributor

bors commented Nov 17, 2020

☔ The latest upstream changes (presumably #79104) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@CDirkx CDirkx force-pushed the move-ui-tests branch 2 times, most recently from 019f175 to 9603d0b Compare November 17, 2020 03:26
@CDirkx
Copy link
Contributor Author

CDirkx commented Nov 17, 2020

env-vars.rs has been excluded from this move, as when run as a library test the other tests could interfere with it.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this is great.

@dtolnay
Copy link
Member

dtolnay commented Nov 22, 2020

@bors r+

Note: not reviewed with full scrutiny, just confirmed that the PR only touches cfg(test) code and the +/- line count is sane.

@bors
Copy link
Contributor

bors commented Nov 22, 2020

📌 Commit 9603d0b4d5d217ef61538b4ccaa0eee51aea5435 has been approved by dtolnay

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 22, 2020
@bors
Copy link
Contributor

bors commented Nov 22, 2020

⌛ Testing commit 9603d0b4d5d217ef61538b4ccaa0eee51aea5435 with merge 34c876fe5eb3caae834b19dd2ce0034a9fb1c10a...

@bors
Copy link
Contributor

bors commented Nov 22, 2020

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 22, 2020
@CDirkx
Copy link
Contributor Author

CDirkx commented Nov 22, 2020

Excluding atomic-print.rs and try-wait.rs as well, upon closer inspection these tests were not working as intended.

These tests communicate with another process spawned using std::process::Command::new(std::env::current_exe()) and expected specific values for certain std::env::args(). However when running as a #[test] vs as a ui test the supplied arguments are different. The code could be changed to work as a library test, but I think they are fine staying as ui tests.

@CDirkx
Copy link
Contributor Author

CDirkx commented Nov 22, 2020

@bors retry

@bors
Copy link
Contributor

bors commented Nov 22, 2020

@CDirkx: 🔑 Insufficient privileges: not in try users

@bors
Copy link
Contributor

bors commented Nov 23, 2020

☔ The latest upstream changes (presumably #78439) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@dtolnay
Copy link
Member

dtolnay commented Nov 24, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Nov 24, 2020

📌 Commit fcbe638 has been approved by dtolnay

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 24, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 24, 2020
Change ui test that are run-pass and that do not test the compiler to library tests

Part of rust-lang#76268, these are some of the relevant ui tests I found that can be replaced by library tests.

Note: this PR just moves the tests, I have not checked for any overlap between these tests and existing library tests. The only test I changed is `env_home_dir`, where I added code to restore the old home dir after testing.

All moved tests:

| ui test | library test file | test |
| --- | --- | --- |
| `const\ascii_ctype.rs` | `core\tests\ascii.rs` | `ascii_ctype_const` |
| `const\const-str-ptr.rs` | `alloc\tests\str.rs` | `const_str_ptr` |
| `assert-eq-trailing-comma.rs` | `core\tests\macros.rs` | `assert_eq_trailing_comma` |
| `assert-escape.rs` | `core\tests\macros.rs` | `assert_escape` |
| `assert-ne-trailing-comma.rs` | `core\tests\macros.rs` | `assert_ne_trailing_comma` |
| `atomic-access-bool.rs` | `core\tests\atomic.rs` | `atomic_access_bool` |
| `atomic-alignment.rs` | `core\tests\atomic.rs` | `atomic_alignment` |
| `atomic-compare_exchange.rs` | `core\tests\atomic.rs` | `atomic_compare_exchange` |
| ~~`atomic-print.rs`~~ | ~~`std\tests\process.rs`~~ | ~~`atomic_print`~~ |
| `bool.rs` | `core\tests\bool.rs` | `test_bool` |
| `bool_not.rs` | `core\tests\bool.rs` | `test_bool_not` |
| `char_unicode.rs` | `core\tests\unicode.rs` | `version` |
| `cmp-default.rs` | `core\tests\cmp.rs` | `cmp_default` |
| `deref-mut-on-ref.rs` | `core\tests\ops.rs` | `deref_mut_on_ref` |
| `deref-on-ref.rs` | `core\tests\ops.rs` | `deref_on_ref` |
| `env-home-dir.rs` | `std\tests\env.rs` | `env_home_dir` |
| ~~`env-vars.rs`~~ | ~~`std\tests\env.rs`~~ | ~~`env_vars`~~ |
| `extend-for-unit.rs` | `core\tests\iter.rs` | `extend_for_unit` |
| `offset_from.rs` | `core\tests\ptr.rs` | `offset_from` |
| `option-ext.rs` | `core\tests\option.rs` | `option_ext` |
| `result-opt-conversions.rs` | `core\tests\result.rs` | `result_opt_conversions` |
| `sleep.rs` | `std\tests\thread.rs` | `sleep` |
| ~~`try-wait.rs`~~ | ~~`std\tests\process.rs`~~ | ~~`try_wait`~~ |
| `utf8.rs` | `alloc\tests\str.rs` | `utf8` |
| `utf8_chars.rs` | `alloc\tests\str.rs` | `utf8_chars` |
| `wrapping-int-api.rs` | `core\tests\num\wrapping.rs` | `wrapping_int_api` |
@CDirkx
Copy link
Contributor Author

CDirkx commented Nov 30, 2020

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author
Rebased and resolved the merge conflict again 😅

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 30, 2020
@jyn514
Copy link
Member

jyn514 commented Nov 30, 2020

@bors r=dtolnay

@bors
Copy link
Contributor

bors commented Nov 30, 2020

📌 Commit be554c4 has been approved by dtolnay

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 30, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 30, 2020
Change ui test that are run-pass and that do not test the compiler to library tests

Part of rust-lang#76268, these are some of the relevant ui tests I found that can be replaced by library tests.

Note: this PR just moves the tests, I have not checked for any overlap between these tests and existing library tests. The only test I changed is `env_home_dir`, where I added code to restore the old home dir after testing.

All moved tests:

| ui test | library test file | test |
| --- | --- | --- |
| `const\ascii_ctype.rs` | `core\tests\ascii.rs` | `ascii_ctype_const` |
| `const\const-str-ptr.rs` | `alloc\tests\str.rs` | `const_str_ptr` |
| `assert-eq-trailing-comma.rs` | `core\tests\macros.rs` | `assert_eq_trailing_comma` |
| `assert-escape.rs` | `core\tests\macros.rs` | `assert_escape` |
| `assert-ne-trailing-comma.rs` | `core\tests\macros.rs` | `assert_ne_trailing_comma` |
| `atomic-access-bool.rs` | `core\tests\atomic.rs` | `atomic_access_bool` |
| `atomic-alignment.rs` | `core\tests\atomic.rs` | `atomic_alignment` |
| `atomic-compare_exchange.rs` | `core\tests\atomic.rs` | `atomic_compare_exchange` |
| ~~`atomic-print.rs`~~ | ~~`std\tests\process.rs`~~ | ~~`atomic_print`~~ |
| `bool.rs` | `core\tests\bool.rs` | `test_bool` |
| `bool_not.rs` | `core\tests\bool.rs` | `test_bool_not` |
| `char_unicode.rs` | `core\tests\unicode.rs` | `version` |
| `cmp-default.rs` | `core\tests\cmp.rs` | `cmp_default` |
| `deref-mut-on-ref.rs` | `core\tests\ops.rs` | `deref_mut_on_ref` |
| `deref-on-ref.rs` | `core\tests\ops.rs` | `deref_on_ref` |
| `env-home-dir.rs` | `std\tests\env.rs` | `env_home_dir` |
| ~~`env-vars.rs`~~ | ~~`std\tests\env.rs`~~ | ~~`env_vars`~~ |
| `extend-for-unit.rs` | `core\tests\iter.rs` | `extend_for_unit` |
| `offset_from.rs` | `core\tests\ptr.rs` | `offset_from` |
| `option-ext.rs` | `core\tests\option.rs` | `option_ext` |
| `result-opt-conversions.rs` | `core\tests\result.rs` | `result_opt_conversions` |
| `sleep.rs` | `std\tests\thread.rs` | `sleep` |
| ~~`try-wait.rs`~~ | ~~`std\tests\process.rs`~~ | ~~`try_wait`~~ |
| `utf8.rs` | `alloc\tests\str.rs` | `utf8` |
| `utf8_chars.rs` | `alloc\tests\str.rs` | `utf8_chars` |
| `wrapping-int-api.rs` | `core\tests\num\wrapping.rs` | `wrapping_int_api` |
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Dec 1, 2020
Change ui test that are run-pass and that do not test the compiler to library tests

Part of rust-lang#76268, these are some of the relevant ui tests I found that can be replaced by library tests.

Note: this PR just moves the tests, I have not checked for any overlap between these tests and existing library tests. The only test I changed is `env_home_dir`, where I added code to restore the old home dir after testing.

All moved tests:

| ui test | library test file | test |
| --- | --- | --- |
| `const\ascii_ctype.rs` | `core\tests\ascii.rs` | `ascii_ctype_const` |
| `const\const-str-ptr.rs` | `alloc\tests\str.rs` | `const_str_ptr` |
| `assert-eq-trailing-comma.rs` | `core\tests\macros.rs` | `assert_eq_trailing_comma` |
| `assert-escape.rs` | `core\tests\macros.rs` | `assert_escape` |
| `assert-ne-trailing-comma.rs` | `core\tests\macros.rs` | `assert_ne_trailing_comma` |
| `atomic-access-bool.rs` | `core\tests\atomic.rs` | `atomic_access_bool` |
| `atomic-alignment.rs` | `core\tests\atomic.rs` | `atomic_alignment` |
| `atomic-compare_exchange.rs` | `core\tests\atomic.rs` | `atomic_compare_exchange` |
| ~~`atomic-print.rs`~~ | ~~`std\tests\process.rs`~~ | ~~`atomic_print`~~ |
| `bool.rs` | `core\tests\bool.rs` | `test_bool` |
| `bool_not.rs` | `core\tests\bool.rs` | `test_bool_not` |
| `char_unicode.rs` | `core\tests\unicode.rs` | `version` |
| `cmp-default.rs` | `core\tests\cmp.rs` | `cmp_default` |
| `deref-mut-on-ref.rs` | `core\tests\ops.rs` | `deref_mut_on_ref` |
| `deref-on-ref.rs` | `core\tests\ops.rs` | `deref_on_ref` |
| `env-home-dir.rs` | `std\tests\env.rs` | `env_home_dir` |
| ~~`env-vars.rs`~~ | ~~`std\tests\env.rs`~~ | ~~`env_vars`~~ |
| `extend-for-unit.rs` | `core\tests\iter.rs` | `extend_for_unit` |
| `offset_from.rs` | `core\tests\ptr.rs` | `offset_from` |
| `option-ext.rs` | `core\tests\option.rs` | `option_ext` |
| `result-opt-conversions.rs` | `core\tests\result.rs` | `result_opt_conversions` |
| `sleep.rs` | `std\tests\thread.rs` | `sleep` |
| ~~`try-wait.rs`~~ | ~~`std\tests\process.rs`~~ | ~~`try_wait`~~ |
| `utf8.rs` | `alloc\tests\str.rs` | `utf8` |
| `utf8_chars.rs` | `alloc\tests\str.rs` | `utf8_chars` |
| `wrapping-int-api.rs` | `core\tests\num\wrapping.rs` | `wrapping_int_api` |
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 1, 2020
Rollup of 11 pull requests

Successful merges:

 - rust-lang#79038 (Change ui test that are run-pass and that do not test the compiler to library tests)
 - rust-lang#79184 (Stop adding '*' at the end of slice and str typenames for MSVC case)
 - rust-lang#79227 (Remove const_fn_feature_flags test)
 - rust-lang#79444 (Move const ip in ui test to unit test)
 - rust-lang#79522 (Validate lint docs separately.)
 - rust-lang#79525 (Add -Z normalize-docs and enable it for compiler docs)
 - rust-lang#79527 (Move intra-doc link tests into a subdirectory)
 - rust-lang#79548 (Show since when a function is const in stdlib)
 - rust-lang#79568 (update Miri)
 - rust-lang#79573 (Update with status for various NetBSD ports.)
 - rust-lang#79583 (Update books)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@@ -1,5 +1,6 @@
use std::env::*;
use std::ffi::{OsStr, OsString};
use std::path::PathBuf;
Copy link
Contributor

@jethrogb jethrogb Dec 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import on cfg(target_env = "sgx") (deny lint)

@bors bors merged commit b565fe2 into rust-lang:master Dec 1, 2020
@rustbot rustbot added this to the 1.50.0 milestone Dec 1, 2020
@jethrogb jethrogb mentioned this pull request Dec 1, 2020
jethrogb pushed a commit to jethrogb/rust that referenced this pull request Dec 1, 2020
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 1, 2020
jethrogb pushed a commit to jethrogb/rust that referenced this pull request Dec 1, 2020

unsafe {
let foo = &A as *const u8;
assert_eq!(foo, C);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this equality is truly guaranteed... at least it currently does not hold in Miri. This is probably related to rust-lang/miri#131.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 3, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Dec 4, 2020
@jethrogb jethrogb mentioned this pull request Dec 7, 2020
jethrogb pushed a commit to jethrogb/rust that referenced this pull request Dec 7, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 7, 2020
…crum

Fix SGX CI, take 3

Broken in rust-lang#79038

r? `@Mark-Simulacrum`

I actually ran `./x.py test --target x86_64-fortanix-unknown-sgx` on the commit before submitting it this time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants