Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
318be2b
Stabilize atomic_as_ptr
tgross35 Feb 24, 2023
daf31a1
remove unused imports
stlankes Feb 26, 2023
ae27762
use `as_ptr` to determine the address of atomics
stlankes Feb 26, 2023
b16d6cc
Document BinOp::is_checkable
tmiasko Mar 12, 2023
58c7b67
create `config::tests::detect_src_and_out` test for bootstrap
onur-ozkan Mar 12, 2023
ed8dc5d
simd-wide-sum test: adapt for LLVM 17 codegen change
krasimirgg Mar 13, 2023
c32527f
Treat projections with infer as placeholder during fast reject in new…
compiler-errors Mar 7, 2023
868aa42
Add a test that used to take forever to compile
compiler-errors Mar 12, 2023
84d254e
Better names?
compiler-errors Mar 12, 2023
04dfedb
Don't use fd-lock on Solaris in bootstrap
psumbera Mar 13, 2023
f044156
Update books
rustbot Mar 13, 2023
34be05e
Gracefully handle `#[target_feature]` on statics
Noratrieb Mar 13, 2023
e670379
Rollup merge of #108419 - tgross35:atomic-as-ptr, r=m-ou-se
matthiaskrgr Mar 13, 2023
96f4497
Rollup merge of #108507 - hermitcore:new, r=m-ou-se
matthiaskrgr Mar 13, 2023
b4c7fc4
Rollup merge of #108607 - psumbera:solaris-no-flock-bootstrap, r=albe…
matthiaskrgr Mar 13, 2023
6cec8cb
Rollup merge of #108830 - compiler-errors:new-solver-fast-reject-fast…
matthiaskrgr Mar 13, 2023
f33292f
Rollup merge of #109055 - ozkanonur:detect_src_and_out, r=albertlarsan68
matthiaskrgr Mar 13, 2023
9fc8de0
Rollup merge of #109058 - tmiasko:is-checkable, r=jackh726
matthiaskrgr Mar 13, 2023
39e1f81
Rollup merge of #109081 - krasimirgg:llvm-17-simd-wide-sum, r=nikic
matthiaskrgr Mar 13, 2023
f6f238f
Rollup merge of #109083 - rustbot:docs-update, r=ehuss
matthiaskrgr Mar 13, 2023
30cd4b3
Rollup merge of #109088 - Nilstrieb:target-feature-on-statics-when, r…
matthiaskrgr Mar 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions src/bootstrap/config/tests.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::{Config, TomlConfig};
use std::path::Path;
use std::{env, path::Path};

fn toml(config: &str) -> impl '_ + Fn(&Path) -> TomlConfig {
|&_| toml::from_str(config).unwrap()
Expand Down Expand Up @@ -33,4 +33,35 @@ fn download_ci_llvm() {
));
}

// FIXME: add test for detecting `src` and `out`
#[test]
fn detect_src_and_out() {
let cfg = parse("");

// This will bring absolute form of `src/bootstrap` path
let current_dir = std::env::current_dir().unwrap();

// get `src` by moving into project root path
let expected_src = current_dir.ancestors().nth(2).unwrap();

assert_eq!(&cfg.src, expected_src);

// This should bring output path of bootstrap in absolute form
let cargo_target_dir = env::var_os("CARGO_TARGET_DIR")
.expect("CARGO_TARGET_DIR must been provided for the test environment from bootstrap");

// Move to `build` from `build/bootstrap`
let expected_out = Path::new(&cargo_target_dir).parent().unwrap();
assert_eq!(&cfg.out, expected_out);

let args: Vec<String> = env::args().collect();

// Another test for `out` as a sanity check
//
// This will bring something similar to:
// `{config_toml_place}/build/bootstrap/debug/deps/bootstrap-c7ee91d5661e2804`
// `{config_toml_place}` can be anywhere, not just in the rust project directory.
let dep = Path::new(args.first().unwrap());
let expected_out = dep.ancestors().nth(4).unwrap();

assert_eq!(&cfg.out, expected_out);
}