Skip to content

Commit

Permalink
Add -Zbuild-std test
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Jun 11, 2024
1 parent b36dd19 commit e1d2c69
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,28 @@ jobs:
run: cargo test --verbose
- name: Test no-rustc mode
run: cargo check --no-default-features

build-std:
strategy:
matrix:
include:
- os: ubuntu-latest
host_target: x86_64-unknown-linux-gnu
- os: macos-latest
host_target: x86_64-apple-darwin
- os: windows-latest
host_target: i686-pc-windows-msvc
runs-on: ${{ matrix.os }}
# Run tests under a directory with a space in it to double check the windows path heuristic
defaults:
run:
working-directory: "dir with spaces/build std"
steps:
- uses: actions/checkout@v4
with:
path: "dir with spaces/build std"
- uses: dtolnay/rust-toolchain@nightly
with:
components: rust-src
- name: Run build-std test
run: cargo test --verbose --test build_std
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ features = ["capture-spantrace"]
name = "integration"
harness = false

[[test]]
name = "build_std"
test = false

[features]
default = ["rustc"]
rustc = []
21 changes: 21 additions & 0 deletions tests/build_std.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use ui_test::dependencies::DependencyBuilder;
use ui_test::spanned::Spanned;
use ui_test::Config;

#[test]
fn test() {
let mut config = Config::rustc("tests/build_std");
let revisioned = config.comment_defaults.base();

revisioned.exit_status = Spanned::dummy(0).into();
revisioned.require_annotations = Spanned::dummy(false).into();
revisioned.set_custom(
"dependencies",
DependencyBuilder {
build_std: Some(String::new()),
..DependencyBuilder::default()
},
);

ui_test::run_tests(config).unwrap();
}
Empty file added tests/build_std/test.rs
Empty file.

0 comments on commit e1d2c69

Please sign in to comment.