Skip to content

Commit fdc6ca4

Browse files
committed
Auto merge of #47155 - nerd2:debuginfo_test_fix, r=alexcrichton
Restore working debuginfo tests by trimming comments from non-header directive lines I noticed when adding a debuginfo test that nothing I did caused the test to fail. Tracing back this seems to have been caused by 3e6c83d which broke parsing of the command/check lines, leaving all tests passing without any checking. This commit provides a basic (although still not very robust) restoration of tests and a should-fail test which checks the parser is running
2 parents 8d370ec + 0a24acd commit fdc6ca4

25 files changed

+70
-2
lines changed

src/test/debuginfo/basic-types-globals-metadata.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// min-lldb-version: 310
12+
// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1213

1314
// compile-flags:-g
1415
// gdb-command:run

src/test/debuginfo/basic-types-globals.rs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// its numerical value.
1616

1717
// min-lldb-version: 310
18+
// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1819

1920
// compile-flags:-g
2021
// gdb-command:run

src/test/debuginfo/basic-types-metadata.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// min-lldb-version: 310
12+
// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1213

1314
// compile-flags:-g
1415
// gdb-command:run

src/test/debuginfo/basic-types-mut-globals.rs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// its numerical value.
1616

1717
// min-lldb-version: 310
18+
// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1819

1920
// compile-flags:-g
2021

src/test/debuginfo/by-value-non-immediate-argument.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// ignore-tidy-linelength
12+
// ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1213
// min-lldb-version: 310
1314

1415
// compile-flags:-g

src/test/debuginfo/c-style-enum.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// ignore-aarch64
12+
// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1213
// min-lldb-version: 310
1314

1415
// compile-flags:-g

src/test/debuginfo/drop-locations.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
// ignore-windows
1212
// ignore-android
13+
// ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1314
// min-lldb-version: 310
1415

1516
#![allow(unused)]

src/test/debuginfo/function-arg-initialization.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
// ignore-tidy-linelength
12-
12+
// ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1313
// min-lldb-version: 310
1414

1515
// This test case checks if function arguments already have the correct value

src/test/debuginfo/function-prologue-stepping-regular.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
// min-lldb-version: 310
1515
// ignore-gdb
16+
// ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1617
// compile-flags:-g
1718

1819
// lldb-command:breakpoint set --name immediate_args

src/test/debuginfo/lexical-scopes-in-block-expression.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// min-lldb-version: 310
12+
// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1213

1314
// compile-flags:-g
1415

src/test/debuginfo/limited-debuginfo.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111

1212
// ignore-lldb
13+
// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1314

1415
// compile-flags:-C debuginfo=1
1516

src/test/debuginfo/macro-stepping.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// ignore-android
1313
// ignore-aarch64
1414
// min-lldb-version: 310
15+
// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1516

1617
// aux-build:macro-stepping.rs
1718

src/test/debuginfo/method-on-enum.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
// ignore-tidy-linelength
1212
// min-lldb-version: 310
13+
// ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1314

1415
// compile-flags:-g
1516

src/test/debuginfo/option-like-enum.rs

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// except according to those terms.
1010

1111
// ignore-tidy-linelength
12+
// ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
13+
1214
// min-lldb-version: 310
1315

1416
// compile-flags:-g

src/test/debuginfo/pretty-std.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
// ignore-windows failing on win32 bot
1212
// ignore-freebsd: gdb package too new
13+
// ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1314
// ignore-android: FIXME(#10381)
1415
// compile-flags:-g
1516
// min-gdb-version 7.7

src/test/debuginfo/shadowed-variable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
// min-lldb-version: 310
12-
12+
// ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1313
// compile-flags:-g
1414

1515
// === GDB TESTS ===================================================================================

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/test/debuginfo/simple-struct.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// min-lldb-version: 310
12+
// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1213

1314
// compile-flags:-g
1415

src/test/debuginfo/simple-tuple.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// min-lldb-version: 310
12+
// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1213

1314
// compile-flags:-g
1415

src/test/debuginfo/struct-in-enum.rs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// ignore-tidy-linelength
1212
// min-lldb-version: 310
1313
// ignore-gdb-version: 7.11.90 - 7.12.9
14+
// ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1415

1516
// compile-flags:-g
1617

src/test/debuginfo/type-names.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
// ignore-tidy-linelength
1212
// ignore-lldb
13+
// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1314
// ignore-android: FIXME(#24958)
1415
// ignore-arm: FIXME(#24958)
1516
// ignore-aarch64: FIXME(#24958)

src/test/debuginfo/union-smoke.rs

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// except according to those terms.
1010

1111
// min-lldb-version: 310
12+
// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
13+
1214
// ignore-gdb-version: 7.11.90 - 7.12.9
1315

1416
// compile-flags:-g

src/test/debuginfo/vec-slices.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// ignore-windows
12+
// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1213
// min-lldb-version: 310
1314

1415
// compile-flags:-g

src/test/debuginfo/vec.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// min-lldb-version: 310
12+
// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1213

1314
// compile-flags:-g
1415

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)