Provide an config option to not set cfg(test)

This commit is contained in:
Chayim Refael Friedman 2024-09-09 23:24:34 +03:00
parent 546339a7be
commit 4ea09dd9f6
16 changed files with 73 additions and 15 deletions

View file

@ -30,6 +30,7 @@ pub struct LoadCargoConfig {
pub load_out_dirs_from_check: bool,
pub with_proc_macro_server: ProcMacroServerChoice,
pub prefill_caches: bool,
pub set_test: bool,
}
#[derive(Debug, Clone, PartialEq, Eq)]
@ -99,6 +100,7 @@ pub fn load_workspace(
vfs.file_id(&path)
},
extra_env,
load_config.set_test,
);
let proc_macros = {
let proc_macro_server = match &proc_macro_server {
@ -531,6 +533,7 @@ mod tests {
load_out_dirs_from_check: false,
with_proc_macro_server: ProcMacroServerChoice::None,
prefill_caches: false,
set_test: true,
};
let (db, _vfs, _proc_macro) =
load_workspace_at(path, &cargo_config, &load_cargo_config, &|_| {}).unwrap();