| 1 | //! Helper functions for nextest emulation. | 
| 2 |  | 
|---|
| 3 | use crate::Config; | 
|---|
| 4 |  | 
|---|
| 5 | /// Nexttest emulation: we act as if we are one single test. | 
|---|
| 6 | /// Returns `true` if we should not run any tests. | 
|---|
| 7 | /// Patches up the `Config`s to have appropriate filters. | 
|---|
| 8 | pub fn emulate(configs: &mut Vec<Config>) -> bool { | 
|---|
| 9 | if configs.iter().any(|c: &Config| c.list) { | 
|---|
| 10 | if configs.iter().any(|c: &Config| !c.run_only_ignored) { | 
|---|
| 11 | println!( "ui_test: test"); | 
|---|
| 12 | } | 
|---|
| 13 | return true; | 
|---|
| 14 | } | 
|---|
| 15 | for config: &mut Config in configs { | 
|---|
| 16 | if config.filter_exact | 
|---|
| 17 | && config.filter_files.len() == 1 | 
|---|
| 18 | && config.filter_files[0] == "ui_test" | 
|---|
| 19 | { | 
|---|
| 20 | config.filter_exact = false; | 
|---|
| 21 | config.filter_files.clear(); | 
|---|
| 22 | } | 
|---|
| 23 | } | 
|---|
| 24 | false | 
|---|
| 25 | } | 
|---|
| 26 |  | 
|---|