@@ -7,18 +7,25 @@ use std::{
77pub use ui_test;
88
99use ui_test:: {
10- default_file_filter, default_per_file_config, run_tests_generic,
10+ default_file_filter, default_per_file_config,
11+ dependencies:: DependencyBuilder ,
12+ run_tests_generic,
13+ spanned:: Spanned ,
1114 status_emitter:: { Gha , StatusEmitter , Text } ,
1215 Args , Config , OutputConflictHandling ,
1316} ;
1417
1518/// Use this instead of hand rolling configs.
1619///
1720/// `root_dir` is the directory your tests are contained in. Needs to be a path from crate root.
21+ /// This config will build dependencies and will assume that the cargo manifest is placed at the
22+ /// current working directory.
1823fn basic_config ( root_dir : impl Into < PathBuf > , args : & Args ) -> Config {
1924 let mut config = Config {
20- dependencies_crate_manifest_path : Some ( "Cargo.toml" . into ( ) ) ,
21- bless_command : Some ( "`cargo test` with the BLESS environment variable set to any non empty value" . to_string ( ) ) ,
25+ bless_command : Some (
26+ "`cargo test` with the BLESS environment variable set to any non empty value"
27+ . to_string ( ) ,
28+ ) ,
2229 output_conflict_handling : if env:: var_os ( "BLESS" ) . is_some ( ) {
2330 OutputConflictHandling :: Bless
2431 } else {
@@ -45,6 +52,14 @@ fn basic_config(root_dir: impl Into<PathBuf>, args: &Args) -> Config {
4552 "$HOME" ,
4653 ) ;
4754
55+ // Manually insert @aux-build:<dep> comments into test files. This needs to
56+ // be done to build and link dependencies. Dependencies will be pulled from a
57+ // Cargo.toml file.
58+ config. comment_defaults . base ( ) . custom . insert (
59+ "dependencies" ,
60+ Spanned :: dummy ( vec ! [ Box :: new( DependencyBuilder :: default ( ) ) ] ) ,
61+ ) ;
62+
4863 config
4964}
5065
0 commit comments