Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
weihanglo committed Dec 1, 2023
1 parent ac88ccc commit 1153a28
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
- run: rustup target add ${{ matrix.other }}
- run: rustup component add rustc-dev llvm-tools-preview rust-docs
if: startsWith(matrix.rust, 'nightly')
- run: sudo apt update -y && sudo apt install lldb gcc-multilib libsecret-1-0 libsecret-1-dev -y
- run: sudo apt update -y && sudo apt install gdb lldb gcc-multilib libsecret-1-0 libsecret-1-dev -y
if: matrix.os == 'ubuntu-latest'
- run: rustup component add rustfmt || echo "rustfmt not available"
- name: Configure extra test environment
Expand Down
5 changes: 3 additions & 2 deletions crates/cargo-test-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ fn has_command(command: &str) -> bool {
// * hg is not installed on GitHub macOS or certain constrained
// environments like Docker. Consider installing it if Cargo
// gains more hg support, but otherwise it isn't critical.
// * lldb is not pre-installed on Ubuntu so skipped for convenience.
if is_ci() && !["hg", "lldb"].contains(&command) {
// * lldb is not pre-installed on Ubuntu and Windows, so skipped for convenience.
// * gdb is not pre-installed on Ubuntu and macOS, so skipped for convenience.
if is_ci() && !["hg", "lldb", "gdb"].contains(&command) {
panic!(
"expected command `{}` to be somewhere in PATH: {}",
command, e
Expand Down
16 changes: 13 additions & 3 deletions tests/testsuite/profile_trim_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ thread '[..]' panicked at [..]src/main.rs:4[..]",
}

#[cargo_test(requires_gdb, nightly, , reason = "-Zremap-path-scope is unstable")]
fn lldb_works_after_trimmed() {
fn gdb_works_after_trimmed() {
use cargo_test_support::compare::match_contains;

let run_lldb = |path| {
Expand Down Expand Up @@ -732,8 +732,18 @@ fn lldb_works_after_trimmed() {
let bin_path = p.bin("foo");
assert!(bin_path.is_file());
let stdout = String::from_utf8(run_lldb(bin_path).stdout).unwrap();
match_contains("Breakpoint 1 at [..]: file src/main.rs, line 3[..]", &stdout, None).unwrap();
match_contains("Starting program: [CWD]/target/debug/foo[EXE]", &stdout, None).unwrap();
match_contains(
"Breakpoint 1 at [..]: file src/main.rs, line 3[..]",
&stdout,
None,
)
.unwrap();
match_contains(
"Starting program: [CWD]/target/debug/foo[EXE]",
&stdout,
None,
)
.unwrap();
match_contains(
"\
Breakpoint 1, x::main () at src/main.rs:4
Expand Down

0 comments on commit 1153a28

Please sign in to comment.