compiletest: Allow using a specific debugger when running debuginfo tests
This commit is contained in:
parent
4c40c89c26
commit
4f4d62067a
1 changed files with 23 additions and 6 deletions
|
@ -37,7 +37,7 @@ use walkdir::WalkDir;
|
||||||
|
|
||||||
use self::header::{EarlyProps, make_test_description};
|
use self::header::{EarlyProps, make_test_description};
|
||||||
use crate::common::{
|
use crate::common::{
|
||||||
CompareMode, Config, Mode, PassMode, TestPaths, UI_EXTENSIONS, expected_output_path,
|
CompareMode, Config, Debugger, Mode, PassMode, TestPaths, UI_EXTENSIONS, expected_output_path,
|
||||||
output_base_dir, output_relative_path,
|
output_base_dir, output_relative_path,
|
||||||
};
|
};
|
||||||
use crate::header::HeadersCache;
|
use crate::header::HeadersCache;
|
||||||
|
@ -183,7 +183,13 @@ pub fn parse_config(args: Vec<String>) -> Config {
|
||||||
"What custom diff tool to use for displaying compiletest tests.",
|
"What custom diff tool to use for displaying compiletest tests.",
|
||||||
"COMMAND",
|
"COMMAND",
|
||||||
)
|
)
|
||||||
.reqopt("", "minicore-path", "path to minicore aux library", "PATH");
|
.reqopt("", "minicore-path", "path to minicore aux library", "PATH")
|
||||||
|
.optopt(
|
||||||
|
"",
|
||||||
|
"debugger",
|
||||||
|
"only test a specific debugger in debuginfo tests",
|
||||||
|
"gdb | lldb | cdb",
|
||||||
|
);
|
||||||
|
|
||||||
let (argv0, args_) = args.split_first().unwrap();
|
let (argv0, args_) = args.split_first().unwrap();
|
||||||
if args.len() == 1 || args[1] == "-h" || args[1] == "--help" {
|
if args.len() == 1 || args[1] == "-h" || args[1] == "--help" {
|
||||||
|
@ -302,7 +308,11 @@ pub fn parse_config(args: Vec<String>) -> Config {
|
||||||
stage_id: matches.opt_str("stage-id").unwrap(),
|
stage_id: matches.opt_str("stage-id").unwrap(),
|
||||||
mode,
|
mode,
|
||||||
suite: matches.opt_str("suite").unwrap(),
|
suite: matches.opt_str("suite").unwrap(),
|
||||||
debugger: None,
|
debugger: matches.opt_str("debugger").map(|debugger| {
|
||||||
|
debugger
|
||||||
|
.parse::<Debugger>()
|
||||||
|
.unwrap_or_else(|_| panic!("unknown `--debugger` option `{debugger}` given"))
|
||||||
|
}),
|
||||||
run_ignored,
|
run_ignored,
|
||||||
with_rustc_debug_assertions,
|
with_rustc_debug_assertions,
|
||||||
with_std_debug_assertions,
|
with_std_debug_assertions,
|
||||||
|
@ -475,9 +485,16 @@ pub fn run_tests(config: Arc<Config>) {
|
||||||
if let Mode::DebugInfo = config.mode {
|
if let Mode::DebugInfo = config.mode {
|
||||||
// Debugging emscripten code doesn't make sense today
|
// Debugging emscripten code doesn't make sense today
|
||||||
if !config.target.contains("emscripten") {
|
if !config.target.contains("emscripten") {
|
||||||
configs.extend(debuggers::configure_cdb(&config));
|
match config.debugger {
|
||||||
configs.extend(debuggers::configure_gdb(&config));
|
Some(Debugger::Cdb) => configs.extend(debuggers::configure_cdb(&config)),
|
||||||
configs.extend(debuggers::configure_lldb(&config));
|
Some(Debugger::Gdb) => configs.extend(debuggers::configure_gdb(&config)),
|
||||||
|
Some(Debugger::Lldb) => configs.extend(debuggers::configure_lldb(&config)),
|
||||||
|
None => {
|
||||||
|
configs.extend(debuggers::configure_cdb(&config));
|
||||||
|
configs.extend(debuggers::configure_gdb(&config));
|
||||||
|
configs.extend(debuggers::configure_lldb(&config));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
configs.push(config.clone());
|
configs.push(config.clone());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue