Skip to content

Commit e1d2c69

Browse files
committed
Add -Zbuild-std test
1 parent b36dd19 commit e1d2c69

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

.github/workflows/rust.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,28 @@ jobs:
6060
run: cargo test --verbose
6161
- name: Test no-rustc mode
6262
run: cargo check --no-default-features
63+
64+
build-std:
65+
strategy:
66+
matrix:
67+
include:
68+
- os: ubuntu-latest
69+
host_target: x86_64-unknown-linux-gnu
70+
- os: macos-latest
71+
host_target: x86_64-apple-darwin
72+
- os: windows-latest
73+
host_target: i686-pc-windows-msvc
74+
runs-on: ${{ matrix.os }}
75+
# Run tests under a directory with a space in it to double check the windows path heuristic
76+
defaults:
77+
run:
78+
working-directory: "dir with spaces/build std"
79+
steps:
80+
- uses: actions/checkout@v4
81+
with:
82+
path: "dir with spaces/build std"
83+
- uses: dtolnay/rust-toolchain@nightly
84+
with:
85+
components: rust-src
86+
- name: Run build-std test
87+
run: cargo test --verbose --test build_std

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ features = ["capture-spantrace"]
4545
name = "integration"
4646
harness = false
4747

48+
[[test]]
49+
name = "build_std"
50+
test = false
51+
4852
[features]
4953
default = ["rustc"]
5054
rustc = []

tests/build_std.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use ui_test::dependencies::DependencyBuilder;
2+
use ui_test::spanned::Spanned;
3+
use ui_test::Config;
4+
5+
#[test]
6+
fn test() {
7+
let mut config = Config::rustc("tests/build_std");
8+
let revisioned = config.comment_defaults.base();
9+
10+
revisioned.exit_status = Spanned::dummy(0).into();
11+
revisioned.require_annotations = Spanned::dummy(false).into();
12+
revisioned.set_custom(
13+
"dependencies",
14+
DependencyBuilder {
15+
build_std: Some(String::new()),
16+
..DependencyBuilder::default()
17+
},
18+
);
19+
20+
ui_test::run_tests(config).unwrap();
21+
}

tests/build_std/test.rs

Whitespace-only changes.

0 commit comments

Comments
 (0)