diff --git a/Cargo.toml b/Cargo.toml index 2fed3c2f77..ed744eac37 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,7 @@ exclude = [ "crates/bevy_derive/compile_fail", "crates/bevy_ecs/compile_fail", "crates/bevy_reflect/compile_fail", + "tools/compile_fail_utils", ] members = [ "crates/*", diff --git a/crates/bevy_derive/compile_fail/Cargo.toml b/crates/bevy_derive/compile_fail/Cargo.toml index a67a148135..45dcf8aaaf 100644 --- a/crates/bevy_derive/compile_fail/Cargo.toml +++ b/crates/bevy_derive/compile_fail/Cargo.toml @@ -8,8 +8,7 @@ license = "MIT OR Apache-2.0" publish = false [dependencies] -# ui_test dies if we don't specify the version. See oli-obk/ui_test#211 -bevy_derive = { path = "../", version = "0.14.0-dev" } +bevy_derive = { path = "../" } [dev-dependencies] compile_fail_utils = { path = "../../../tools/compile_fail_utils" } diff --git a/crates/bevy_ecs/compile_fail/Cargo.toml b/crates/bevy_ecs/compile_fail/Cargo.toml index a38c4183c8..76f7ec8b8a 100644 --- a/crates/bevy_ecs/compile_fail/Cargo.toml +++ b/crates/bevy_ecs/compile_fail/Cargo.toml @@ -8,8 +8,7 @@ license = "MIT OR Apache-2.0" publish = false [dependencies] -# ui_test dies if we don't specify the version. See oli-obk/ui_test#211 -bevy_ecs = { path = "../", version = "0.14.0-dev" } +bevy_ecs = { path = "../" } [dev-dependencies] compile_fail_utils = { path = "../../../tools/compile_fail_utils" } diff --git a/crates/bevy_reflect/compile_fail/Cargo.toml b/crates/bevy_reflect/compile_fail/Cargo.toml index 5a32cbcc41..2e8d542e2a 100644 --- a/crates/bevy_reflect/compile_fail/Cargo.toml +++ b/crates/bevy_reflect/compile_fail/Cargo.toml @@ -8,8 +8,7 @@ license = "MIT OR Apache-2.0" publish = false [dependencies] -# ui_test dies if we don't specify the version. See oli-obk/ui_test#211 -bevy_reflect = { path = "../", version = "0.14.0-dev" } +bevy_reflect = { path = "../" } [dev-dependencies] compile_fail_utils = { path = "../../../tools/compile_fail_utils" } diff --git a/tools/compile_fail_utils/Cargo.toml b/tools/compile_fail_utils/Cargo.toml index 37c51619f4..96c56b4da6 100644 --- a/tools/compile_fail_utils/Cargo.toml +++ b/tools/compile_fail_utils/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" publish = false [dependencies] -ui_test = "0.22.3" +ui_test = "0.23.0" [[test]] name = "example" diff --git a/tools/compile_fail_utils/src/lib.rs b/tools/compile_fail_utils/src/lib.rs index 83ac4cc659..9bf392c662 100644 --- a/tools/compile_fail_utils/src/lib.rs +++ b/tools/compile_fail_utils/src/lib.rs @@ -7,7 +7,10 @@ use std::{ pub use ui_test; use ui_test::{ - default_file_filter, default_per_file_config, run_tests_generic, + default_file_filter, default_per_file_config, + dependencies::DependencyBuilder, + run_tests_generic, + spanned::Spanned, status_emitter::{Gha, StatusEmitter, Text}, Args, Config, OutputConflictHandling, }; @@ -15,10 +18,14 @@ use ui_test::{ /// Use this instead of hand rolling configs. /// /// `root_dir` is the directory your tests are contained in. Needs to be a path from crate root. +/// This config will build dependencies and will assume that the cargo manifest is placed at the +/// current working directory. fn basic_config(root_dir: impl Into, args: &Args) -> Config { let mut config = Config { - dependencies_crate_manifest_path: Some("Cargo.toml".into()), - bless_command: Some("`cargo test` with the BLESS environment variable set to any non empty value".to_string()), + bless_command: Some( + "`cargo test` with the BLESS environment variable set to any non empty value" + .to_string(), + ), output_conflict_handling: if env::var_os("BLESS").is_some() { OutputConflictHandling::Bless } else { @@ -45,6 +52,14 @@ fn basic_config(root_dir: impl Into, args: &Args) -> Config { "$HOME", ); + // Manually insert @aux-build: comments into test files. This needs to + // be done to build and link dependencies. Dependencies will be pulled from a + // Cargo.toml file. + config.comment_defaults.base().custom.insert( + "dependencies", + Spanned::dummy(vec![Box::new(DependencyBuilder::default())]), + ); + config }