Skip to content

Commit 7f738c8

Browse files
committed
Fix a brain-fail with debuginfo-tests/dexter internal tests
I baked the "test" subcommand into the %dexter substituion, as that's what all of the dexter tests use. However I forgot about the internal tests for whether dexters features are working. Install a %dexter_base command to allow those tests to call dexter.py directly, and un-xfail the tests on darwin. Update too the list of paths the unittests shouldn't try and cover, as it tries to load dbgeng on unix machines. Ideally we wouldn't be using this method of test discovery in the future.
1 parent d32a6f0 commit 7f738c8

29 files changed

+40
-40
lines changed

debuginfo-tests/dexter/dex/utils/UnitTests.py

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def _match_path(self, path, full_path, pattern):
3131
else:
3232
if d == 'windows':
3333
return False
34+
elif d == 'dbgeng':
35+
return False
3436
return fnmatch(path, pattern)
3537

3638

debuginfo-tests/dexter/feature_tests/commands/penalty/expect_program_state.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// REQUIRES: system-linux, lldb
66
//
7-
// RUN: not %dexter test --fail-lt 1.0 -w \
7+
// RUN: not %dexter_base test --fail-lt 1.0 -w \
88
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -glldb" -- %s \
99
// RUN: | FileCheck %s
1010
// CHECK: expect_program_state.cpp:

debuginfo-tests/dexter/feature_tests/commands/penalty/expect_step_kinds.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// REQUIRES: system-linux, lldb
66
//
7-
// RUN: not %dexter test --fail-lt 1.0 -w \
7+
// RUN: not %dexter_base test --fail-lt 1.0 -w \
88
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
99
// RUN: | FileCheck %s
1010
// CHECK: expect_step_kinds.cpp:

debuginfo-tests/dexter/feature_tests/commands/penalty/expect_step_order.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// REQUIRES: system-linux, lldb
66
//
7-
// RUN: not %dexter test --fail-lt 1.0 -w \
7+
// RUN: not %dexter_base test --fail-lt 1.0 -w \
88
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
99
// RUN: | FileCheck %s
1010
// CHECK: expect_step_order.cpp:

debuginfo-tests/dexter/feature_tests/commands/penalty/expect_watch_type.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// REQUIRES: system-linux, lldb
66
//
7-
// RUN: not %dexter test --fail-lt 1.0 -w \
7+
// RUN: not %dexter_base test --fail-lt 1.0 -w \
88
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
99
// RUN: | FileCheck %s
1010
// CHECK: expect_watch_type.cpp:

debuginfo-tests/dexter/feature_tests/commands/penalty/expect_watch_value.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// REQUIRES: system-linux, lldb
66
//
7-
// RUN: not %dexter test --fail-lt 1.0 -w \
7+
// RUN: not %dexter_base test --fail-lt 1.0 -w \
88
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
99
// RUN: | FileCheck %s
1010
// CHECK: expect_watch_value.cpp:

debuginfo-tests/dexter/feature_tests/commands/penalty/unreachable.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// REQUIRES: system-linux, lldb
66
//
7-
// RUN: not %dexter test --fail-lt 1.0 -w \
7+
// RUN: not %dexter_base test --fail-lt 1.0 -w \
88
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
99
// RUN: | FileCheck %s
1010
// CHECK: unreachable.cpp:

debuginfo-tests/dexter/feature_tests/commands/perfect/expect_program_state.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// REQUIRES: system-linux, lldb
66
//
7-
// RUN: %dexter test --fail-lt 1.0 -w \
7+
// RUN: %dexter_base test --fail-lt 1.0 -w \
88
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -glldb" -- %s \
99
// RUN: | FileCheck %s
1010
// CHECK: expect_program_state.cpp:

debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/direction.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88
// REQUIRES: system-linux, lldb
99
//
10-
// RUN: %dexter test --fail-lt 1.0 -w \
10+
// RUN: %dexter_base test --fail-lt 1.0 -w \
1111
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
1212
// RUN: | FileCheck %s
1313
// CHECK: direction.cpp:

debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/func.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66
// REQUIRES: system-linux, lldb
77
//
8-
// RUN: %dexter test --fail-lt 1.0 -w \
8+
// RUN: %dexter_base test --fail-lt 1.0 -w \
99
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
1010
// RUN: | FileCheck %s
1111
// CHECK: func.cpp:

debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/func_external.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
// for a trivial test. Expect one 'FUNC_EXTERNAL' per external call.
44
//
55
// REQUIRES: system-linux, lldb
6+
// XFAIL: system-linux
7+
// This fails right now on my linux machine, needs examining as to why.
68
//
7-
// RUN: %dexter test --fail-lt 1.0 -w \
9+
// RUN: %dexter --fail-lt 1.0 -w \
810
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
911
// RUN: | FileCheck %s
1012
// CHECK: func_external.cpp:

debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/recursive.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66
// REQUIRES: system-linux, lldb
77
//
8-
// RUN: %dexter test --fail-lt 1.0 -w \
8+
// RUN: %dexter_base test --fail-lt 1.0 -w \
99
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
1010
// RUN: | FileCheck %s
1111
// CHECK: recursive.cpp:

debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/small_loop.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66
// REQUIRES: system-linux, lldb
77
//
8-
// RUN: %dexter test --fail-lt 1.0 -w \
8+
// RUN: %dexter_base test --fail-lt 1.0 -w \
99
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
1010
// RUN: | FileCheck %s
1111
// CHECK: small_loop.cpp:

debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_order.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// REQUIRES: system-linux, lldb
66
//
7-
// RUN: %dexter test --fail-lt 1.0 -w \
7+
// RUN: %dexter_base test --fail-lt 1.0 -w \
88
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
99
// RUN: | FileCheck %s
1010
// CHECK: expect_step_order.cpp:

debuginfo-tests/dexter/feature_tests/commands/perfect/expect_watch_type.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// REQUIRES: system-linux, lldb
66
//
7-
// RUN: %dexter test --fail-lt 1.0 -w \
7+
// RUN: %dexter_base test --fail-lt 1.0 -w \
88
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
99
// RUN: | FileCheck %s
1010
// CHECK: expect_watch_type.cpp:

debuginfo-tests/dexter/feature_tests/commands/perfect/expect_watch_value.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// REQUIRES: system-linux, lldb
66
//
7-
// RUN: %dexter test --fail-lt 1.0 -w \
7+
// RUN: %dexter_base test --fail-lt 1.0 -w \
88
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
99
// RUN: | FileCheck %s
1010
// CHECK: expect_watch_value.cpp:

debuginfo-tests/dexter/feature_tests/commands/perfect/unreachable.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// REQUIRES: system-linux, lldb
66
//
7-
// RUN: %dexter test --fail-lt 1.0 -w \
7+
// RUN: %dexter_base test --fail-lt 1.0 -w \
88
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
99
// RUN: | FileCheck %s
1010
// CHECK: unreachable.cpp:

debuginfo-tests/dexter/feature_tests/subtools/clang-opt-bisect/clang-opt-bisect.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// REQUIRES: system-linux, lldb
55
//
66
// RUN: true
7-
// RUN: %dexter clang-opt-bisect --debugger 'lldb' --builder 'clang' \
7+
// RUN: %dexter_base clang-opt-bisect --debugger 'lldb' --builder 'clang' \
88
// RUN: --cflags "-O0 -g" -- %s \
99
// RUN: | FileCheck %s
1010
// CHECK: running pass 0

debuginfo-tests/dexter/feature_tests/subtools/help/help.test

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
XFAIL: darwin
21
Purpose:
32
Check the `help` subtool runs.
43

5-
RUN: %dexter help | FileCheck %s
4+
RUN: %dexter_base help | FileCheck %s
65
CHECK: The following subtools are available:
76
CHECK: clang-opt-bisect
87
CHECK: help
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
XFAIL: darwin
21
Purpose:
32
Check the `list-debuggers` subtool runs.
43

5-
RUN: %dexter list-debuggers | FileCheck %s
4+
RUN: %dexter_base list-debuggers | FileCheck %s
65
CHECK: lldb
76
CHECK: vs2015
87
CHECK: vs2017

debuginfo-tests/dexter/feature_tests/subtools/test/err_paren.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: darwin
21
// Purpose:
32
// Check that parsing bad commands gives a useful error.
43
// - Unbalanced parenthesis
@@ -8,7 +7,7 @@
87
// Note: Despite using 'lldb' as the debugger, lldb is not actually required
98
// as the test should finish before lldb would be invoked.
109
//
11-
// RUN: not %dexter test --builder 'clang' --debugger 'lldb' \
10+
// RUN: not %dexter_base test --builder 'clang' --debugger 'lldb' \
1211
// RUN: --cflags "-O0 -g" -v -- %s \
1312
// RUN: | FileCheck %s --match-full-lines --strict-whitespace
1413
//

debuginfo-tests/dexter/feature_tests/subtools/test/err_paren_mline.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: darwin
21
// Purpose:
32
// Check that parsing bad commands gives a useful error.
43
// - Unbalanced parenthesis over multiple lines
@@ -8,7 +7,7 @@
87
// Note: Despite using 'lldb' as the debugger, lldb is not actually required
98
// as the test should finish before lldb would be invoked.
109
//
11-
// RUN: not %dexter test --builder 'clang' --debugger "lldb" \
10+
// RUN: not %dexter_base test --builder 'clang' --debugger "lldb" \
1211
// RUN: --cflags "-O0 -g" -v -- %s \
1312
// RUN: | FileCheck %s --match-full-lines --strict-whitespace
1413
//

debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: darwin
21
// Purpose:
32
// Check that parsing bad commands gives a useful error.
43
// - Syntax error (misplaced ',')
@@ -8,7 +7,7 @@
87
// Note: Despite using 'lldb' as the debugger, lldb is not actually required
98
// as the test should finish before lldb would be invoked.
109
//
11-
// RUN: not %dexter test --builder 'clang' --debugger "lldb" \
10+
// RUN: not %dexter_base test --builder 'clang' --debugger "lldb" \
1211
// RUN: --cflags "-O0 -g" -v -- %s \
1312
// RUN: | FileCheck %s --match-full-lines --strict-whitespace
1413
//

debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_mline.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: darwin
21
// Purpose:
32
// Check that parsing bad commands gives a useful error.
43
// - Syntax error (misplaced ',') over multiple lines
@@ -8,7 +7,7 @@
87
// Note: Despite using 'lldb' as the debugger, lldb is not actually required
98
// as the test should finish before lldb would be invoked.
109
//
11-
// RUN: not %dexter test --builder 'clang' --debugger "lldb" \
10+
// RUN: not %dexter_base test --builder 'clang' --debugger "lldb" \
1211
// RUN: --cflags "-O0 -g" -v -- %s \
1312
// RUN: | FileCheck %s --match-full-lines --strict-whitespace
1413
//

debuginfo-tests/dexter/feature_tests/subtools/test/err_type.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: darwin
21
// Purpose:
32
// Check that parsing bad commands gives a useful error.
43
// - Type error (missing args)
@@ -8,7 +7,7 @@
87
// Note: Despite using 'lldb' as the debugger, lldb is not actually required
98
// as the test should finish before lldb would be invoked.
109
//
11-
// RUN: not %dexter test --builder 'clang' --debugger "lldb" \
10+
// RUN: not %dexter_base test --builder 'clang' --debugger "lldb" \
1211
// RUN: --cflags "-O0 -g" -v -- %s \
1312
// RUN: | FileCheck %s --match-full-lines --strict-whitespace
1413
//

debuginfo-tests/dexter/feature_tests/subtools/test/err_type_mline.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: darwin
21
// Purpose:
32
// Check that parsing bad commands gives a useful error.
43
// - Type error (missing args) over multple lines
@@ -8,7 +7,7 @@
87
// Note: Despite using 'lldb' as the debugger, lldb is not actually required
98
// as the test should finish before lldb would be invoked.
109
//
11-
// RUN: not %dexter test --builder 'clang' --debugger "lldb" \
10+
// RUN: not %dexter_base test --builder 'clang' --debugger "lldb" \
1211
// RUN: --cflags "-O0 -g" -v -- %s \
1312
// RUN: | FileCheck %s --match-full-lines --strict-whitespace
1413
//

debuginfo-tests/dexter/feature_tests/subtools/view.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
//
44
// REQUIRES: system-linux, lldb
55
//
6-
// RUN: %dexter test --fail-lt 1.0 -w \
6+
// RUN: %dexter_base test --fail-lt 1.0 -w \
77
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" \
88
// RUN: --results %t -- %s
99
//
10-
// RUN: %dexter view %t/view.cpp.dextIR | FileCheck %s
10+
// RUN: %dexter_base view %t/view.cpp.dextIR | FileCheck %s
1111
// CHECK: ## BEGIN
1212
// CHECK: ## END
1313
//

debuginfo-tests/dexter/feature_tests/unittests/run.test

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
XFAIL: darwin
21
Purpose:
32
Run DExTer unit tests.
43

54
# Dexter returns 1 when no subtools are specified.
6-
RUN: not %dexter --unittest=show-all 2>&1 | FileCheck %s
5+
RUN: not %dexter_base --unittest=show-all 2>&1 | FileCheck %s
76

87
CHECK: Ran {{[0-9]+}} tests
98
CHECK-EMPTY:

debuginfo-tests/lit.cfg.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,18 @@ def get_required_attr(config, attr_name):
9797
config.available_features.add('lldb')
9898

9999
# Produce dexter path, lldb path, and combine into the %dexter substitution
100+
# for running a test.
100101
dexter_path = os.path.join(config.debuginfo_tests_src_root,
101102
'dexter', 'dexter.py')
102-
dexter_cmd = '"{}" "{}" test'.format(config.python3_executable, dexter_path)
103+
dexter_test_cmd = '"{}" "{}" test'.format(config.python3_executable, dexter_path)
103104
if lldb_path is not None:
104-
dexter_cmd += ' --lldb-executable {}'.format(lldb_path)
105+
dexter_test_cmd += ' --lldb-executable {}'.format(lldb_path)
106+
tools.append(ToolSubst('%dexter', dexter_test_cmd))
105107

106-
tools.append(ToolSubst('%dexter', dexter_cmd))
108+
# For testing other bits of dexter that aren't under the "test" subcommand,
109+
# have a %dexter_base substitution.
110+
dexter_base_cmd = '"{}" "{}"'.format(config.python3_executable, dexter_path)
111+
tools.append(ToolSubst('%dexter_base', dexter_base_cmd))
107112

108113
tool_dirs = [config.llvm_tools_dir]
109114

0 commit comments

Comments
 (0)