IJPL-442: re-enable console output for windows debug mode

GitOrigin-RevId: a8ab3a84092fd1109373a56e749236df78a59503
This commit is contained in:
Ivan Pashchenko
2024-03-28 18:35:29 +01:00
committed by intellij-monorepo-bot
parent abcf215ab3
commit 7c55cd5a5a
2 changed files with 13 additions and 7 deletions

View File

@@ -72,11 +72,11 @@ const CLASS_PATH_SEPARATOR: &str = ":";
pub fn main_lib() {
let exe_path = env::current_exe().unwrap_or_else(|_| PathBuf::from(env::args().next().unwrap()));
let remote_dev = exe_path.file_name().unwrap().to_string_lossy().starts_with("remote-dev-server");
if remote_dev {
attach_console();
}
let debug_mode = remote_dev || env::var(DEBUG_MODE_ENV_VAR).is_ok();
if debug_mode {
attach_console();
}
if let Err(e) = main_impl(exe_path, remote_dev, debug_mode) {
ui::show_error(!debug_mode, e);

View File

@@ -507,8 +507,8 @@ fn run_launcher_impl(test_env: &TestEnvironment, run_spec: &LauncherRunSpec) ->
debug!("Starting '{}'\n with args {:?}\n in '{}'",
test_env.launcher_path.display(), run_spec.args, test_env.test_root_dir.path().display());
let stdout_file_path = test_env.test_root_dir.path().join("out.txt");
let stderr_file_path = test_env.test_root_dir.path().join("err.txt");
let stdout_file_path = &test_env.test_root_dir.path().join("out.txt");
let stderr_file_path = &test_env.test_root_dir.path().join("err.txt");
let project_dir = test_env.project_dir.to_str().unwrap();
let dump_file_path = test_env.test_root_dir.path().join("output.json");
let dump_file_path_str = dump_file_path.strip_ns_prefix()?.to_string_checked()?;
@@ -544,11 +544,17 @@ fn run_launcher_impl(test_env: &TestEnvironment, run_spec: &LauncherRunSpec) ->
full_env.insert(k, v);
}
let stdout_file = File::create(stdout_file_path)
.context(format!("Failed to create stdout file at {stdout_file_path:?}"))?;
let stderr_file = File::create(stderr_file_path)
.context(format!("Failed to create stderr file at {stderr_file_path:?}"))?;
let mut launcher_process = Command::new(&test_env.launcher_path)
.current_dir(test_env.test_root_dir.path())
.args(full_args)
.stdout(Stdio::from(File::create(&stdout_file_path)?))
.stderr(Stdio::from(File::create(&stderr_file_path)?))
.stdout(Stdio::from(stdout_file))
.stderr(Stdio::from(stderr_file))
.envs(full_env)
.spawn()
.context("Failed to spawn launcher process")?;