Skip to content

Commit 28dd4d9

Browse files
author
Sam
committed
Restore working debuginfo tests by trimming comments from non-header directive lines
1 parent b9cf26c commit 28dd4d9

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

src/test/debuginfo/should-fail.rs

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// min-lldb-version: 310
12+
13+
// == Test [gdb|lldb]-[command|check] are parsed correctly ===
14+
// should-fail
15+
// compile-flags:-g
16+
17+
// === GDB TESTS ===================================================================================
18+
19+
// gdb-command: run
20+
21+
// gdb-command: print x
22+
// gdb-check:$1 = 5
23+
24+
// === LLDB TESTS ==================================================================================
25+
26+
// lldb-command:run
27+
28+
// lldb-command:print x
29+
// lldb-check:[...]$0 = 5
30+
31+
fn main() {
32+
let x = 1;
33+
34+
zzz(); // #break
35+
}
36+
37+
fn zzz() {()}
38+

src/tools/compiletest/src/runtest.rs

+7
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,13 @@ impl<'test> TestCx<'test> {
901901
for line in reader.lines() {
902902
match line {
903903
Ok(line) => {
904+
let line =
905+
if line.starts_with("//") {
906+
line[2..].trim_left()
907+
} else {
908+
line.as_str()
909+
};
910+
904911
if line.contains("#break") {
905912
breakpoint_lines.push(counter);
906913
}

0 commit comments

Comments
 (0)