Skip to content

Commit 89025da

Browse files
Tom WeaverTom Weaver
Tom Weaver
authored and
Tom Weaver
committed
[Dexter] Add support for Windows to regression test suite.
This patch addresses the issue of the regression suite not running on windows hardware. It changes the following things: add new dexter regression suite command to lit.cfg.py that makes use of the clang-cl_vs2015 and dbgend builder and debuggers. sprinkle the new regression suite command through the feature and tool tests that require them. mark certain problem tests on windows There's a couple of tests that fail (or pass) in unexpected ways on Windows. Problem tests are both the penalty and perfect expect_watch_type.cpp tests. Type information reporting parity is not possible a this time in dexter due to the nature of how different debuggers report type information back to their users. reviewers: Orlando Differential Revision: https://reviews.llvm.org/D76609
1 parent cb84e48 commit 89025da

18 files changed

+57
-83
lines changed

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
// Check that \DexExpectProgramState correctly applies a penalty when
33
// an expected program state is never found.
44
//
5-
// REQUIRES: system-linux, lldb
6-
//
7-
// RUN: not %dexter_base test --fail-lt 1.0 -w \
8-
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -glldb" -- %s \
9-
// RUN: | FileCheck %s
5+
// RUN: not %dexter_regression_test -- %s | FileCheck %s
106
// CHECK: expect_program_state.cpp:
117

128
int GCD(int lhs, int rhs)

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
// Check that \DexExpectStepKind correctly applies a penalty when
33
// unexpected step kinds are encountered.
44
//
5-
// REQUIRES: system-linux, lldb
6-
//
7-
// RUN: not %dexter_base test --fail-lt 1.0 -w \
8-
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
9-
// RUN: | FileCheck %s
5+
// RUN: not %dexter_regression_test -- %s | FileCheck %s
106
// CHECK: expect_step_kinds.cpp:
117

128
int abs(int i){

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
// Check that \DexExpectStepOrder correctly applies a penalty for steps
33
// found out of expected order.
44
//
5-
// REQUIRES: system-linux, lldb
6-
//
7-
// RUN: not %dexter_base test --fail-lt 1.0 -w \
8-
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
9-
// RUN: | FileCheck %s
5+
// RUN: not %dexter_regression_test -- %s | FileCheck %s
106
// CHECK: expect_step_order.cpp:
117

128
int main()

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// Check that \DexExpectWatchType applies penalties when expected
33
// types are not found and unexpected types are.
44
//
5-
// REQUIRES: system-linux, lldb
5+
// NOTE: This test passes but not in the expected way on Windows.
6+
// TODO: Reduce this test's coverage and be more specific about
7+
// expected behaviour.
68
//
7-
// RUN: not %dexter_base test --fail-lt 1.0 -w \
8-
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
9-
// RUN: | FileCheck %s
9+
// RUN: not %dexter_regression_test -- %s | FileCheck %s
1010
// CHECK: expect_watch_type.cpp:
1111

1212
template<class T>

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
// Check that \DexExpectWatchValue correctly applies a penalty when
33
// expected values are not found.
44
//
5-
// REQUIRES: system-linux, lldb
6-
//
7-
// RUN: not %dexter_base test --fail-lt 1.0 -w \
8-
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
9-
// RUN: | FileCheck %s
5+
// RUN: not %dexter_regression_test -- %s | FileCheck %s
106
// CHECK: expect_watch_value.cpp:
117

128
int main()

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
// Check that \DexUnreachable correctly applies a penalty if the command
33
// line is stepped on.
44
//
5-
// REQUIRES: system-linux, lldb
6-
//
7-
// RUN: not %dexter_base test --fail-lt 1.0 -w \
8-
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
9-
// RUN: | FileCheck %s
5+
// RUN: not %dexter_regression_test -- %s | FileCheck %s
106
// CHECK: unreachable.cpp:
117

128
int

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
// Check that \DexExpectWatchValue applies no penalties when expected
33
// program states are found.
44
//
5-
// REQUIRES: system-linux, lldb
6-
//
7-
// RUN: %dexter_base test --fail-lt 1.0 -w \
8-
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -glldb" -- %s \
9-
// RUN: | FileCheck %s
5+
// RUN: %dexter_regression_test -- %s | FileCheck %s
106
// CHECK: expect_program_state.cpp:
117

128
int GCD(int lhs, int rhs)

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
// 'VERTICAL_FORWARD' for every step onto a greater source line number in
66
// the same function.
77
//
8-
// REQUIRES: system-linux, lldb
8+
// TODO: The dbgeng debugger does not support column step reporting at present.
9+
// XFAIL: system-windows
910
//
10-
// RUN: %dexter_base test --fail-lt 1.0 -w \
11-
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
12-
// RUN: | FileCheck %s
11+
// RUN: %dexter_regression_test -- %s | FileCheck %s
1312
// CHECK: direction.cpp:
1413

1514
int func(int i) {

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
// trivial test. Expect one 'FUNC' per call to a function which is defined
44
// in one of the source files in the test directory.
55
//
6-
// REQUIRES: system-linux, lldb
7-
//
8-
// RUN: %dexter_base test --fail-lt 1.0 -w \
9-
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
10-
// RUN: | FileCheck %s
6+
// RUN: %dexter_regression_test -- %s | FileCheck %s
117
// CHECK: func.cpp:
128

139
int func(int i) {

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

+4-6
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
// Check that \DexExpectStepKind correctly counts 'FUNC_EXTERNAL' steps
33
// for a trivial test. Expect one 'FUNC_EXTERNAL' per external call.
44
//
5-
// REQUIRES: system-linux, lldb
6-
// XFAIL: system-linux
7-
// This fails right now on my linux machine, needs examining as to why.
5+
// XFAIL:*
6+
// This fails right now on my linux and windows machine, needs examining as to
7+
// why.
88
//
9-
// RUN: %dexter --fail-lt 1.0 -w \
10-
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
11-
// RUN: | FileCheck %s
9+
// RUN: %dexter_regression_test -- %s | FileCheck %s
1210
// CHECK: func_external.cpp:
1311

1412
#include <cstdlib>

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
// Specifically, ensure recursive calls count towards 'FUNC' and not
44
// 'VERTICAL_BACKWARD'.
55
//
6-
// REQUIRES: system-linux, lldb
7-
//
8-
// RUN: %dexter_base test --fail-lt 1.0 -w \
9-
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
10-
// RUN: | FileCheck %s
6+
// RUN: %dexter_regression_test -- %s | FileCheck %s
117
// CHECK: recursive.cpp:
128

139
int func(int i) {

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
// where the last source line in the loop is a call. Expect steps out
44
// of a function to a line before the call to count as 'VERTICAL_BACKWARD'.
55
//
6-
// REQUIRES: system-linux, lldb
7-
//
8-
// RUN: %dexter_base test --fail-lt 1.0 -w \
9-
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
10-
// RUN: | FileCheck %s
6+
// RUN: %dexter_regression_test -- %s | FileCheck %s
117
// CHECK: small_loop.cpp:
128

139
int func(int i){

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
// Check that \DexExpectStepOrder applies no penalty when the expected
33
// order is found.
44
//
5-
// REQUIRES: system-linux, lldb
6-
//
7-
// RUN: %dexter_base test --fail-lt 1.0 -w \
8-
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
9-
// RUN: | FileCheck %s
5+
// RUN: %dexter_regression_test -- %s | FileCheck %s
106
// CHECK: expect_step_order.cpp:
117

128
int main()

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// Check that \DexExpectWatchType applies no penalties when expected
33
// types are found.
44
//
5-
// REQUIRES: system-linux, lldb
5+
// TODO: On Windows WITH dbgeng, This test takes a long time to run and doesn't evaluate type values
6+
// in the same manner as LLDB.
7+
// XFAIL: system-windows
68
//
7-
// RUN: %dexter_base test --fail-lt 1.0 -w \
8-
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
9-
// RUN: | FileCheck %s
9+
// RUN: %dexter_regression_test -- %s | FileCheck %s
1010
// CHECK: expect_watch_type.cpp:
1111

1212
template<class T>

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
// Check that \DexExpectWatchValue applies no penalties when expected
33
// values are found.
44
//
5-
// REQUIRES: system-linux, lldb
6-
//
7-
// RUN: %dexter_base test --fail-lt 1.0 -w \
8-
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
9-
// RUN: | FileCheck %s
5+
// RUN: %dexter_regression_test -- %s | FileCheck %s
106
// CHECK: expect_watch_value.cpp:
117

128
unsigned long Factorial(int n) {

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
// Check that \DexUnreachable has no effect if the command line is never
33
// stepped on.
44
//
5-
// REQUIRES: system-linux, lldb
6-
//
7-
// RUN: %dexter_base test --fail-lt 1.0 -w \
8-
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
9-
// RUN: | FileCheck %s
5+
// RUN: %dexter_regression_test -- %s | FileCheck %s
106
// CHECK: unreachable.cpp:
117

128
int main()

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
// Purpose:
22
// Check the `view` subtool works with typical inputs.
33
//
4-
// REQUIRES: system-linux, lldb
5-
//
6-
// RUN: %dexter_base test --fail-lt 1.0 -w \
7-
// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" \
8-
// RUN: --results %t -- %s
4+
// RUN: %dexter_regression_test --results %t -- %s
95
//
106
// RUN: %dexter_base view %t/view.cpp.dextIR | FileCheck %s
117
// CHECK: ## BEGIN

debuginfo-tests/lit.cfg.py

+29
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,35 @@ def get_required_attr(config, attr_name):
112112
dexter_base_cmd = '"{}" "{}"'.format(config.python3_executable, dexter_path)
113113
tools.append(ToolSubst('%dexter_base', dexter_base_cmd))
114114

115+
# Set up commands for DexTer regression tests.
116+
# Builder, debugger, optimisation level and several other flags differ
117+
# depending on whether we're running a unix like or windows os.
118+
if platform.system() == 'Windows':
119+
dexter_regression_test_builder = '--builder clang-cl_vs2015'
120+
dexter_regression_test_debugger = '--debugger dbgeng'
121+
dexter_regression_test_cflags = '--cflags "/Zi /Od"'
122+
dexter_regression_test_ldflags = '--ldflags "/Zi"'
123+
else:
124+
dexter_regression_test_builder = '--builder clang'
125+
dexter_regression_test_debugger = "--debugger lldb"
126+
dexter_regression_test_cflags = '--cflags "-O0 -glldb"'
127+
dexter_regression_test_ldflags = ''
128+
129+
# Typical command would take the form:
130+
# ./path_to_py/python.exe ./path_to_dex/dexter.py test --fail-lt 1.0 -w --builder clang --debugger lldb --cflags '-O0 -g'
131+
dexter_regression_test_command = ' '.join(
132+
# "python3", "dexter.py", test, fail_mode, builder, debugger, cflags, ldflags
133+
["{}".format(config.python3_executable),
134+
"{}".format(dexter_path),
135+
'test',
136+
'--fail-lt 1.0 -w',
137+
dexter_regression_test_builder,
138+
dexter_regression_test_debugger,
139+
dexter_regression_test_cflags,
140+
dexter_regression_test_ldflags])
141+
142+
tools.append(ToolSubst('%dexter_regression_test', dexter_regression_test_command))
143+
115144
tool_dirs = [config.llvm_tools_dir]
116145

117146
llvm_config.add_tool_substitutions(tools, tool_dirs)

0 commit comments

Comments
 (0)