summaryrefslogtreecommitdiffstats
path: root/debuginfo-tests/dexter/feature_tests/commands
diff options
context:
space:
mode:
Diffstat (limited to 'debuginfo-tests/dexter/feature_tests/commands')
-rw-r--r--debuginfo-tests/dexter/feature_tests/commands/penalty/expect_program_state.cpp37
-rw-r--r--debuginfo-tests/dexter/feature_tests/commands/penalty/expect_step_kinds.cpp27
-rw-r--r--debuginfo-tests/dexter/feature_tests/commands/penalty/expect_step_order.cpp18
-rw-r--r--debuginfo-tests/dexter/feature_tests/commands/penalty/expect_watch_type.cpp54
-rw-r--r--debuginfo-tests/dexter/feature_tests/commands/penalty/expect_watch_value.cpp21
-rw-r--r--debuginfo-tests/dexter/feature_tests/commands/penalty/unreachable.cpp16
-rw-r--r--debuginfo-tests/dexter/feature_tests/commands/perfect/expect_program_state.cpp52
-rw-r--r--debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/direction.cpp33
-rw-r--r--debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/func.cpp25
-rw-r--r--debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/func_external.cpp25
-rw-r--r--debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/recursive.cpp26
-rw-r--r--debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/small_loop.cpp25
-rw-r--r--debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_order.cpp18
-rw-r--r--debuginfo-tests/dexter/feature_tests/commands/perfect/expect_watch_type.cpp52
-rw-r--r--debuginfo-tests/dexter/feature_tests/commands/perfect/expect_watch_value.cpp39
-rw-r--r--debuginfo-tests/dexter/feature_tests/commands/perfect/unreachable.cpp16
16 files changed, 0 insertions, 484 deletions
diff --git a/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_program_state.cpp b/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_program_state.cpp
deleted file mode 100644
index 2d7c202f407..00000000000
--- a/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_program_state.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-// Purpose:
-// Check that \DexExpectProgramState correctly applies a penalty when
-// an expected program state is never found.
-//
-// REQUIRES: system-linux, lldb
-//
-// RUN: not %dexter test --fail-lt 1.0 -w \
-// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -glldb" -- %s \
-// RUN: | FileCheck %s
-// CHECK: expect_program_state.cpp:
-
-int GCD(int lhs, int rhs)
-{
- if (rhs == 0) // DexLabel('check')
- return lhs;
- return GCD(rhs, lhs % rhs);
-}
-
-int main()
-{
- return GCD(111, 259);
-}
-
-/*
-DexExpectProgramState({
- 'frames': [
- {
- 'location': {
- 'lineno': 'check'
- },
- 'watches': {
- 'lhs': '0', 'rhs': '0'
- }
- },
- ]
-})
-*/
diff --git a/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_step_kinds.cpp b/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_step_kinds.cpp
deleted file mode 100644
index 54f363e6fd0..00000000000
--- a/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_step_kinds.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-// Purpose:
-// Check that \DexExpectStepKind correctly applies a penalty when
-// unexpected step kinds are encountered.
-//
-// REQUIRES: system-linux, lldb
-//
-// RUN: not %dexter test --fail-lt 1.0 -w \
-// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
-// RUN: | FileCheck %s
-// CHECK: expect_step_kinds.cpp:
-
-int abs(int i){
- return i < 0? i * -1: i;
-}
-
-int main()
-{
- volatile int x = 2;
- for (int i = 0; i < x; ++i) {
- abs(i);
- }
- return 0;
-}
-
-// DexExpectStepKind('FUNC', 5)
-// DexExpectStepKind('FUNC_EXTERNAL', 2)
-// DexExpectStepKind('VERTICAL_BACKWARD', 2)
diff --git a/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_step_order.cpp b/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_step_order.cpp
deleted file mode 100644
index 84d2ab81d55..00000000000
--- a/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_step_order.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-// Purpose:
-// Check that \DexExpectStepOrder correctly applies a penalty for steps
-// found out of expected order.
-//
-// REQUIRES: system-linux, lldb
-//
-// RUN: not %dexter test --fail-lt 1.0 -w \
-// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
-// RUN: | FileCheck %s
-// CHECK: expect_step_order.cpp:
-
-int main()
-{
- volatile int x = 1; // DexExpectStepOrder(3)
- volatile int y = 1; // DexExpectStepOrder(1)
- volatile int z = 1; // DexExpectStepOrder(2)
- return 0;
-}
diff --git a/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_watch_type.cpp b/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_watch_type.cpp
deleted file mode 100644
index a619a6d224f..00000000000
--- a/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_watch_type.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-// Purpose:
-// Check that \DexExpectWatchType applies penalties when expected
-// types are not found and unexpected types are.
-//
-// REQUIRES: system-linux, lldb
-//
-// RUN: not %dexter test --fail-lt 1.0 -w \
-// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
-// RUN: | FileCheck %s
-// CHECK: expect_watch_type.cpp:
-
-template<class T>
-class Doubled {
-public:
- Doubled(const T & to_double)
- : m_member(to_double * 2) {}
-
- T GetVal() {
- T to_return = m_member; // DexLabel('gv_start')
- return to_return; // DexLabel('gv_end')
- }
-
- static T static_doubler(const T & to_double) {
- T result = 0; // DexLabel('sd_start')
- result = to_double * 2;
- return result; // DexLabel('sd_end')
- }
-
-private:
- T m_member;
-};
-
-int main() {
- auto myInt = Doubled<int>(5); // DexLabel('main_start')
- auto myDouble = Doubled<double>(5.5);
- auto staticallyDoubledInt = Doubled<int>::static_doubler(5);
- auto staticallyDoubledDouble = Doubled<double>::static_doubler(5.5);
- return int(double(myInt.GetVal())
- + double(staticallyDoubledInt)
- + myDouble.GetVal()
- + staticallyDoubledDouble); // DexLabel('main_end')
-}
-
-
-// DexExpectWatchType('m_member', 'int', 'double', from_line='gv_start', to_line='gv_end')
-
-// THIS COMMAND should create a penalty for a missing type 'const double' and unexpected type 'const double &'
-// DexExpectWatchType('to_double', 'const double', 'const int &', from_line='sd_start', to_line='sd_end')
-
-// DexExpectWatchType('myInt', 'Doubled<int>', from_line='main_start', to_line='main_end')
-// DexExpectWatchType('myDouble', 'Doubled<double>', from_line='main_start', to_line='main_end')
-// DexExpectWatchType('staticallyDoubledInt', 'int', from_line='main_start', to_line='main_end')
-// DexExpectWatchType('staticallyDoubledDouble', 'double', from_line='main_start', to_line='main_end')
-
diff --git a/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_watch_value.cpp b/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_watch_value.cpp
deleted file mode 100644
index ea30bc53a1b..00000000000
--- a/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_watch_value.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-// Purpose:
-// Check that \DexExpectWatchValue correctly applies a penalty when
-// expected values are not found.
-//
-// REQUIRES: system-linux, lldb
-//
-// RUN: not %dexter test --fail-lt 1.0 -w \
-// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
-// RUN: | FileCheck %s
-// CHECK: expect_watch_value.cpp:
-
-int main()
-{
- for (int i = 0; i < 3; ++i)
- int a = i; // DexLabel('loop')
- return 0; // DexLabel('ret')
-}
-
-// DexExpectWatchValue('i', '0', '1', '2', on_line='loop')
-// DexExpectWatchValue('i', '3', on_line='ret')
-// ---------------------^ out of scope
diff --git a/debuginfo-tests/dexter/feature_tests/commands/penalty/unreachable.cpp b/debuginfo-tests/dexter/feature_tests/commands/penalty/unreachable.cpp
deleted file mode 100644
index b089e6f6498..00000000000
--- a/debuginfo-tests/dexter/feature_tests/commands/penalty/unreachable.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-// Purpose:
-// Check that \DexUnreachable correctly applies a penalty if the command
-// line is stepped on.
-//
-// REQUIRES: system-linux, lldb
-//
-// RUN: not %dexter test --fail-lt 1.0 -w \
-// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
-// RUN: | FileCheck %s
-// CHECK: unreachable.cpp:
-
-int
-main()
-{
- return 1; // DexUnreachable()
-}
diff --git a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_program_state.cpp b/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_program_state.cpp
deleted file mode 100644
index 71d56bcc448..00000000000
--- a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_program_state.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-// Purpose:
-// Check that \DexExpectWatchValue applies no penalties when expected
-// program states are found.
-//
-// REQUIRES: system-linux, lldb
-//
-// RUN: %dexter test --fail-lt 1.0 -w \
-// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -glldb" -- %s \
-// RUN: | FileCheck %s
-// CHECK: expect_program_state.cpp:
-
-int GCD(int lhs, int rhs)
-{
- if (rhs == 0)
- return lhs; // DexLabel('check')
- return GCD(rhs, lhs % rhs);
-}
-
-int main()
-{
- return GCD(111, 259);
-}
-
-/*
-DexExpectProgramState({
- 'frames': [
- {
- 'location': {
- 'lineno': 'check'
- },
- 'watches': {
- 'lhs': '37', 'rhs': '0'
- }
- },
- {
- 'watches': {
- 'lhs': {'value': '111'}, 'rhs': {'value': '37'}
- }
- },
- {
- 'watches': {
- 'lhs': {'value': '259'}, 'rhs': {'value': '111'}
- }
- },
- {
- 'watches': {
- 'lhs': {'value': '111'}, 'rhs': {'value': '259'}
- }
- }
- ]
-})
-*/
diff --git a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/direction.cpp b/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/direction.cpp
deleted file mode 100644
index a4fa5330f35..00000000000
--- a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/direction.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-// Purpose:
-// Check that \DexExpectStepKind correctly counts 'VERTICAL_BACKWARD' steps
-// for a trivial test. Expect one 'VERTICAL_BACKWARD' for every step onto
-// a lesser source line number in the same function. Expect one
-// 'VERTICAL_FORWARD' for every step onto a greater source line number in
-// the same function.
-//
-// REQUIRES: system-linux, lldb
-//
-// RUN: %dexter test --fail-lt 1.0 -w \
-// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
-// RUN: | FileCheck %s
-// CHECK: direction.cpp:
-
-int func(int i) {
- return i; // step 7, 9, 11
-}
-
-int main()
-{
- for (int i = 0; i < 2; ++i) { // step 1: FUNC, step 3, 5: VERTICAL_BACKWARD
- i = i; // step 2, 4: VERTICAL_FORWARD
- }
- // ---------1 - step 6: VERTICAL_FORWARD
- // ---------|---------2 - step 8: HORIZONTAL_FORWARD
- // ----3----|---------| - step 10: HORIZONTAL_BACKWARD
- return func(func(0) + func(1));
-}
-
-// DexExpectStepKind('VERTICAL_BACKWARD', 2)
-// DexExpectStepKind('VERTICAL_FORWARD', 3)
-// DexExpectStepKind('HORIZONTAL_FORWARD', 1)
-// DexExpectStepKind('HORIZONTAL_BACKWARD', 1)
diff --git a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/func.cpp b/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/func.cpp
deleted file mode 100644
index 46a13143c50..00000000000
--- a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/func.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-// Purpose:
-// Check that \DexExpectStepKind correctly counts 'FUNC' steps for a
-// trivial test. Expect one 'FUNC' per call to a function which is defined
-// in one of the source files in the test directory.
-//
-// REQUIRES: system-linux, lldb
-//
-// RUN: %dexter test --fail-lt 1.0 -w \
-// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
-// RUN: | FileCheck %s
-// CHECK: func.cpp:
-
-int func(int i) {
- return i;
-}
-
-int main()
-{
- func(0);
- func(1);
- return 0;
-}
-
-// main, func, func
-// DexExpectStepKind('FUNC', 3)
diff --git a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/func_external.cpp b/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/func_external.cpp
deleted file mode 100644
index 4ca8d1e746d..00000000000
--- a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/func_external.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-// Purpose:
-// Check that \DexExpectStepKind correctly counts 'FUNC_EXTERNAL' steps
-// for a trivial test. Expect one 'FUNC_EXTERNAL' per external call.
-//
-// REQUIRES: system-linux, lldb
-//
-// RUN: %dexter test --fail-lt 1.0 -w \
-// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
-// RUN: | FileCheck %s
-// CHECK: func_external.cpp:
-
-#include <cstdlib>
-
-int func(int i){
- return abs(i);
-}
-
-int main()
-{
- func(0);
- func(1);
- return 0;
-}
-
-// DexExpectStepKind('FUNC_EXTERNAL', 2)
diff --git a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/recursive.cpp b/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/recursive.cpp
deleted file mode 100644
index dd4af84363b..00000000000
--- a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/recursive.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-// Purpose:
-// Check that \DexExpectStepKind correctly handles recursive calls.
-// Specifically, ensure recursive calls count towards 'FUNC' and not
-// 'VERTICAL_BACKWARD'.
-//
-// REQUIRES: system-linux, lldb
-//
-// RUN: %dexter test --fail-lt 1.0 -w \
-// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
-// RUN: | FileCheck %s
-// CHECK: recursive.cpp:
-
-int func(int i) {
- if (i > 1)
- return i + func(i - 1);
- return i;
-}
-
-int main()
-{
- return func(3);
-}
-
-// main, func, func, func
-// DexExpectStepKind('FUNC', 4)
-// DexExpectStepKind('VERTICAL_BACKWARD', 0)
diff --git a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/small_loop.cpp b/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/small_loop.cpp
deleted file mode 100644
index b85aab1d848..00000000000
--- a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/small_loop.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-// Purpose:
-// Check that \DexExpectStepKind correctly counts function calls in loops
-// where the last source line in the loop is a call. Expect steps out
-// of a function to a line before the call to count as 'VERTICAL_BACKWARD'.
-//
-// REQUIRES: system-linux, lldb
-//
-// RUN: %dexter test --fail-lt 1.0 -w \
-// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
-// RUN: | FileCheck %s
-// CHECK: small_loop.cpp:
-
-int func(int i){
- return i;
-}
-
-int main()
-{
- for (int i = 0; i < 2; ++i) {
- func(i);
- }
- return 0;
-}
-
-// DexExpectStepKind('VERTICAL_BACKWARD', 2)
diff --git a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_order.cpp b/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_order.cpp
deleted file mode 100644
index cadc0387d9b..00000000000
--- a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_order.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-// Purpose:
-// Check that \DexExpectStepOrder applies no penalty when the expected
-// order is found.
-//
-// REQUIRES: system-linux, lldb
-//
-// RUN: %dexter test --fail-lt 1.0 -w \
-// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
-// RUN: | FileCheck %s
-// CHECK: expect_step_order.cpp:
-
-int main()
-{
- volatile int x = 1; // DexExpectStepOrder(1)
- volatile int y = 1; // DexExpectStepOrder(2)
- volatile int z = 1; // DexExpectStepOrder(3)
- return 0;
-}
diff --git a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_watch_type.cpp b/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_watch_type.cpp
deleted file mode 100644
index b98ef28ad98..00000000000
--- a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_watch_type.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-// Purpose:
-// Check that \DexExpectWatchType applies no penalties when expected
-// types are found.
-//
-// REQUIRES: system-linux, lldb
-//
-// RUN: %dexter test --fail-lt 1.0 -w \
-// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
-// RUN: | FileCheck %s
-// CHECK: expect_watch_type.cpp:
-
-template<class T>
-class Doubled {
-public:
- Doubled(const T & to_double)
- : m_member(to_double * 2) {}
-
- T GetVal() {
- T to_return = m_member; // DexLabel('gv_start')
- return to_return; // DexLabel('gv_end')
- }
-
- static T static_doubler(const T & to_double) {
- T result = 0; // DexLabel('sd_start')
- result = to_double * 2;
- return result; // DexLabel('sd_end')
- }
-
-private:
- T m_member;
-};
-
-int main() {
- auto myInt = Doubled<int>(5); // DexLabel('main_start')
- auto myDouble = Doubled<double>(5.5);
- auto staticallyDoubledInt = Doubled<int>::static_doubler(5);
- auto staticallyDoubledDouble = Doubled<double>::static_doubler(5.5);
- return int(double(myInt.GetVal())
- + double(staticallyDoubledInt)
- + myDouble.GetVal()
- + staticallyDoubledDouble); // DexLabel('main_end')
-}
-
-// DexExpectWatchType('m_member', 'int', 'double', from_line='gv_start', to_line='gv_end')
-
-// DexExpectWatchType('to_double', 'const int &', 'const double &', from_line='sd_start', to_line='sd_end')
-
-// DexExpectWatchType('myInt', 'Doubled<int>', from_line='main_start', to_line='main_end')
-// DexExpectWatchType('myDouble', 'Doubled<double>', from_line='main_start', to_line='main_end')
-// DexExpectWatchType('staticallyDoubledInt', 'int', from_line='main_start', to_line='main_end')
-// DexExpectWatchType('staticallyDoubledDouble', 'double', from_line='main_start', to_line='main_end')
-
diff --git a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_watch_value.cpp b/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_watch_value.cpp
deleted file mode 100644
index 7f4c365cab6..00000000000
--- a/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_watch_value.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-// Purpose:
-// Check that \DexExpectWatchValue applies no penalties when expected
-// values are found.
-//
-// REQUIRES: system-linux, lldb
-//
-// RUN: %dexter test --fail-lt 1.0 -w \
-// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
-// RUN: | FileCheck %s
-// CHECK: expect_watch_value.cpp:
-
-unsigned long Factorial(int n) {
- volatile unsigned long fac = 1; // DexLabel('entry')
-
- for (int i = 1; i <= n; ++i)
- fac *= i; // DexLabel('loop')
-
- return fac; // DexLabel('ret')
-}
-
-int main()
-{
- return Factorial(8);
-}
-
-/*
-DexExpectWatchValue('n', '8', on_line='entry')
-DexExpectWatchValue('i',
- '1', '2', '3', '4', '5', '6', '7', '8',
- on_line='loop')
-
-DexExpectWatchValue('fac',
- '1', '2', '6', '24', '120', '720', '5040',
- on_line='loop')
-
-DexExpectWatchValue('n', '8', on_line='loop')
-DexExpectWatchValue('fac', '40320', on_line='ret')
-DexExpectWatchValue('n', '8', on_line='ret')
-*/
diff --git a/debuginfo-tests/dexter/feature_tests/commands/perfect/unreachable.cpp b/debuginfo-tests/dexter/feature_tests/commands/perfect/unreachable.cpp
deleted file mode 100644
index c53e07fe4a4..00000000000
--- a/debuginfo-tests/dexter/feature_tests/commands/perfect/unreachable.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-// Purpose:
-// Check that \DexUnreachable has no effect if the command line is never
-// stepped on.
-//
-// REQUIRES: system-linux, lldb
-//
-// RUN: %dexter test --fail-lt 1.0 -w \
-// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
-// RUN: | FileCheck %s
-// CHECK: unreachable.cpp:
-
-int main()
-{
- return 0;
- return 1; // DexUnreachable()
-}
OpenPOWER on IntegriCloud