minor cleanup

This commit is contained in:
nora 2023-08-03 14:47:21 +02:00
parent ba3a199249
commit cc04638f1e
16 changed files with 22 additions and 21 deletions

1
ui-tests/.gitignore vendored
View file

@ -1 +0,0 @@
/target

1224
ui-tests/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,9 +0,0 @@
[package]
name = "ui-tests"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
ui_test = "0.12.1"

View file

@ -1,35 +0,0 @@
fn main() {
let mut args = std::env::args().skip(1).collect::<Vec<_>>();
let mut after_edition = false;
args.retain(|arg| {
// drop some stuff we dont care about
if arg.starts_with("--crate-type") {
return false;
}
if arg == "--edition" {
after_edition = true;
return false;
}
if after_edition {
after_edition = false;
return false;
}
true
});
// We don't want out.wat polluting things.
args.push("--no-output".into());
let result = std::process::Command::new("node")
.arg(".")
.args(args)
.spawn()
.unwrap()
.wait()
.unwrap();
let code = result.code().unwrap_or(1);
std::process::exit(code);
}

View file

@ -1,54 +0,0 @@
use ui_test::{
clap::Parser, default_filter_by_arg, default_per_file_config, status_emitter, Args,
CommandBuilder, Config, Mode, OutputConflictHandling,
};
fn main() {
std::process::Command::new("cargo")
.args(&[
"build",
"--manifest-path",
"ui-tests/Cargo.toml",
"--bin",
"nilc-wrapper",
])
.spawn()
.unwrap()
.wait()
.unwrap()
.success()
.then_some(())
.unwrap_or_else(|| std::process::exit(1));
let mut config = Config::rustc("ui-tests/ui");
config.host = Some("wasm :3".into());
config.program = CommandBuilder::cmd("ui-tests/target/debug/nilc-wrapper");
config.mode = Mode::Fail {
require_patterns: false,
};
let args = Args::parse();
let text = if args.quiet {
status_emitter::Text::quiet()
} else {
status_emitter::Text::verbose()
};
if !args.check && std::env::var_os("GITHUB_ACTIONS").is_none() {
config.output_conflict_handling = OutputConflictHandling::Bless;
}
let result = ui_test::run_tests_generic(
config,
args,
|path, args| {
path.extension().is_some_and(|ext| ext == "nil") && default_filter_by_arg(path, args)
},
default_per_file_config,
(text, status_emitter::Gha::<true> { name: "ui".into() }),
);
if let Err(result) = result {
println!("{:?}", result);
}
}