mirror of
https://github.com/servo/servo.git
synced 2025-08-13 17:35:36 +01:00
Replace script_plugins with a clippy like rustc driver (named crown) (#30508)
* Remove script_plugins * Use crown instead of script_plugins * crown_is_not_used * Use crown in command base * bootstrap crown * tidy happy * disable sccache * Bring crown in tree * Install crown from tree * fix windows ci * fix warning * fix mac libscript_plugins.dylib is not available anymore * Update components/script/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> * Update for nightly-2023-03-18 Mostly just based off https://github.com/servo/servo/pull/30630 * Always install crown it's slow only when there is new version * Run crown test with `mach test-unit` * Small fixups; better trace_in_no_trace tests * Better doc * crown in config.toml * Fix tidy for real * no sccache on rustc_wrapper * document rustc overrides * fixup of compiletest * Make a few minor comment adjustments * Fix a typo in python/servo/platform/base.py Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com> * Proper test types * Ignore tidy on crown/tests --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
20a73721de
commit
604979e367
231 changed files with 881 additions and 680 deletions
52
support/crown/tests/compile_test.rs
Normal file
52
support/crown/tests/compile_test.rs
Normal file
|
@ -0,0 +1,52 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use compiletest_rs as compiletest;
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
static PROFILE_PATH: Lazy<PathBuf> = Lazy::new(|| {
|
||||
let current_exe_path = env::current_exe().unwrap();
|
||||
let deps_path = current_exe_path.parent().unwrap();
|
||||
let profile_path = deps_path.parent().unwrap();
|
||||
profile_path.into()
|
||||
});
|
||||
|
||||
fn run_mode(mode: &'static str, bless: bool) {
|
||||
let mut config = compiletest::Config {
|
||||
bless,
|
||||
edition: Some("2021".into()),
|
||||
..Default::default()
|
||||
}
|
||||
.tempdir();
|
||||
|
||||
let cfg_mode = mode.parse().expect("Invalid mode");
|
||||
config.mode = cfg_mode;
|
||||
config.src_base = PathBuf::from("tests").join(mode);
|
||||
config.rustc_path = PROFILE_PATH.join("crown");
|
||||
config.target_rustcflags = Some(format!(
|
||||
"-L {} -L {} -Zcrate-attr=feature(register_tool) -Zcrate-attr=register_tool(crown)",
|
||||
PROFILE_PATH.display(),
|
||||
PROFILE_PATH.join("deps").display()
|
||||
));
|
||||
// Does not work reliably: https://github.com/servo/servo/pull/30508#issuecomment-1834542203
|
||||
//config.link_deps();
|
||||
config.clean_rmeta();
|
||||
config.strict_headers = true;
|
||||
|
||||
compiletest::run_tests(&config);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn compile_test() {
|
||||
let bless = env::var("BLESS").map_or(false, |x| !x.trim().is_empty());
|
||||
run_mode("compile-fail", bless);
|
||||
run_mode("run-pass", bless);
|
||||
// UI test fails on windows
|
||||
if !cfg!(windows) {
|
||||
run_mode("ui", bless);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue