OSDN Git Service

Fix a brain-fail with debuginfo-tests/dexter internal tests
authorJeremy Morse <jeremy.morse@sony.com>
Fri, 1 Nov 2019 12:29:42 +0000 (12:29 +0000)
committerJeremy Morse <jeremy.morse@sony.com>
Fri, 1 Nov 2019 12:35:38 +0000 (12:35 +0000)
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.

29 files changed:
debuginfo-tests/dexter/dex/utils/UnitTests.py
debuginfo-tests/dexter/feature_tests/commands/penalty/expect_program_state.cpp
debuginfo-tests/dexter/feature_tests/commands/penalty/expect_step_kinds.cpp
debuginfo-tests/dexter/feature_tests/commands/penalty/expect_step_order.cpp
debuginfo-tests/dexter/feature_tests/commands/penalty/expect_watch_type.cpp
debuginfo-tests/dexter/feature_tests/commands/penalty/expect_watch_value.cpp
debuginfo-tests/dexter/feature_tests/commands/penalty/unreachable.cpp
debuginfo-tests/dexter/feature_tests/commands/perfect/expect_program_state.cpp
debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/direction.cpp
debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/func.cpp
debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/func_external.cpp
debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/recursive.cpp
debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_kind/small_loop.cpp
debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_order.cpp
debuginfo-tests/dexter/feature_tests/commands/perfect/expect_watch_type.cpp
debuginfo-tests/dexter/feature_tests/commands/perfect/expect_watch_value.cpp
debuginfo-tests/dexter/feature_tests/commands/perfect/unreachable.cpp
debuginfo-tests/dexter/feature_tests/subtools/clang-opt-bisect/clang-opt-bisect.cpp
debuginfo-tests/dexter/feature_tests/subtools/help/help.test
debuginfo-tests/dexter/feature_tests/subtools/list-debuggers/list-debuggers.test
debuginfo-tests/dexter/feature_tests/subtools/test/err_paren.cpp
debuginfo-tests/dexter/feature_tests/subtools/test/err_paren_mline.cpp
debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax.cpp
debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_mline.cpp
debuginfo-tests/dexter/feature_tests/subtools/test/err_type.cpp
debuginfo-tests/dexter/feature_tests/subtools/test/err_type_mline.cpp
debuginfo-tests/dexter/feature_tests/subtools/view.cpp
debuginfo-tests/dexter/feature_tests/unittests/run.test
debuginfo-tests/lit.cfg.py

index 5a8a0a6..cfddce5 100644 (file)
@@ -31,6 +31,8 @@ class DexTestLoader(unittest.TestLoader):
         else:
             if d == 'windows':
                 return False
+            elif d == 'dbgeng':
+                return False
         return fnmatch(path, pattern)
 
 
index 2d7c202..4769068 100644 (file)
@@ -4,7 +4,7 @@
 //
 // REQUIRES: system-linux, lldb
 //
-// RUN: not %dexter test --fail-lt 1.0 -w \
+// RUN: not %dexter_base test --fail-lt 1.0 -w \
 // RUN:     --builder 'clang' --debugger 'lldb' --cflags "-O0 -glldb" -- %s \
 // RUN:     | FileCheck %s
 // CHECK: expect_program_state.cpp:
index 54f363e..9612c06 100644 (file)
@@ -4,7 +4,7 @@
 //
 // REQUIRES: system-linux, lldb
 //
-// RUN: not %dexter test --fail-lt 1.0 -w  \
+// RUN: not %dexter_base test --fail-lt 1.0 -w  \
 // RUN:     --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
 // RUN:     | FileCheck %s
 // CHECK: expect_step_kinds.cpp:
index 84d2ab8..e52a7ff 100644 (file)
@@ -4,7 +4,7 @@
 //
 // REQUIRES: system-linux, lldb
 //
-// RUN: not %dexter test --fail-lt 1.0 -w \
+// RUN: not %dexter_base test --fail-lt 1.0 -w \
 // RUN:     --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
 // RUN:     | FileCheck %s
 // CHECK: expect_step_order.cpp:
index a619a6d..145eeed 100644 (file)
@@ -4,7 +4,7 @@
 //
 // REQUIRES: system-linux, lldb
 //
-// RUN: not %dexter test --fail-lt 1.0 -w \
+// RUN: not %dexter_base test --fail-lt 1.0 -w \
 // RUN:     --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
 // RUN:     | FileCheck %s
 // CHECK: expect_watch_type.cpp:
index ea30bc5..b4c60fa 100644 (file)
@@ -4,7 +4,7 @@
 //
 // REQUIRES: system-linux, lldb
 //
-// RUN: not %dexter test --fail-lt 1.0 -w \
+// RUN: not %dexter_base test --fail-lt 1.0 -w \
 // RUN:     --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
 // RUN:     | FileCheck %s
 // CHECK: expect_watch_value.cpp:
index b089e6f..5cea1c4 100644 (file)
@@ -4,7 +4,7 @@
 //
 // REQUIRES: system-linux, lldb
 //
-// RUN: not %dexter test --fail-lt 1.0 -w \
+// RUN: not %dexter_base test --fail-lt 1.0 -w \
 // RUN:     --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
 // RUN:     | FileCheck %s
 // CHECK: unreachable.cpp:
index 71d56bc..ebb4766 100644 (file)
@@ -4,7 +4,7 @@
 //
 // REQUIRES: system-linux, lldb
 //
-// RUN: %dexter test --fail-lt 1.0 -w \
+// RUN: %dexter_base test --fail-lt 1.0 -w \
 // RUN:     --builder 'clang' --debugger 'lldb' --cflags "-O0 -glldb" -- %s \
 // RUN:     | FileCheck %s
 // CHECK: expect_program_state.cpp:
index a4fa533..3ff0e9f 100644 (file)
@@ -7,7 +7,7 @@
 //
 // REQUIRES: system-linux, lldb
 //
-// RUN: %dexter test --fail-lt 1.0 -w  \
+// RUN: %dexter_base test --fail-lt 1.0 -w  \
 // RUN:     --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
 // RUN:     | FileCheck %s
 // CHECK: direction.cpp:
index 46a1314..d5ab3ff 100644 (file)
@@ -5,7 +5,7 @@
 //
 // REQUIRES: system-linux, lldb
 //
-// RUN: %dexter test --fail-lt 1.0 -w  \
+// RUN: %dexter_base test --fail-lt 1.0 -w  \
 // RUN:     --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
 // RUN:     | FileCheck %s
 // CHECK: func.cpp:
index 4ca8d1e..6dff5c8 100644 (file)
@@ -3,8 +3,10 @@
 //      for a trivial test. Expect one 'FUNC_EXTERNAL' per external call.
 //
 // REQUIRES: system-linux, lldb
+// XFAIL: system-linux
+// This fails right now on my linux machine, needs examining as to why.
 //
-// RUN: %dexter test --fail-lt 1.0 -w  \
+// RUN: %dexter --fail-lt 1.0 -w  \
 // RUN:     --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
 // RUN:     | FileCheck %s
 // CHECK: func_external.cpp:
index dd4af84..f2b54e4 100644 (file)
@@ -5,7 +5,7 @@
 //
 // REQUIRES: system-linux, lldb
 //
-// RUN: %dexter test --fail-lt 1.0 -w  \
+// RUN: %dexter_base test --fail-lt 1.0 -w  \
 // RUN:     --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
 // RUN:     | FileCheck %s
 // CHECK: recursive.cpp:
index b85aab1..1f90607 100644 (file)
@@ -5,7 +5,7 @@
 //
 // REQUIRES: system-linux, lldb
 //
-// RUN: %dexter test --fail-lt 1.0 -w  \
+// RUN: %dexter_base test --fail-lt 1.0 -w  \
 // RUN:     --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
 // RUN:     | FileCheck %s
 // CHECK: small_loop.cpp:
index cadc038..a89a0ce 100644 (file)
@@ -4,7 +4,7 @@
 //
 // REQUIRES: system-linux, lldb
 //
-// RUN: %dexter test --fail-lt 1.0 -w \
+// RUN: %dexter_base test --fail-lt 1.0 -w \
 // RUN:     --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
 // RUN:     | FileCheck %s
 // CHECK: expect_step_order.cpp:
index b98ef28..4159383 100644 (file)
@@ -4,7 +4,7 @@
 //
 // REQUIRES: system-linux, lldb
 //
-// RUN: %dexter test --fail-lt 1.0 -w \
+// RUN: %dexter_base test --fail-lt 1.0 -w \
 // RUN:     --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
 // RUN:     | FileCheck %s
 // CHECK: expect_watch_type.cpp:
index 7f4c365..035e411 100644 (file)
@@ -4,7 +4,7 @@
 //
 // REQUIRES: system-linux, lldb
 //
-// RUN: %dexter test --fail-lt 1.0 -w \
+// RUN: %dexter_base test --fail-lt 1.0 -w \
 // RUN:     --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
 // RUN:     | FileCheck %s
 // CHECK: expect_watch_value.cpp:
index c53e07f..b158b48 100644 (file)
@@ -4,7 +4,7 @@
 //
 // REQUIRES: system-linux, lldb
 //
-// RUN: %dexter test --fail-lt 1.0 -w \
+// RUN: %dexter_base test --fail-lt 1.0 -w \
 // RUN:     --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" -- %s \
 // RUN:     | FileCheck %s
 // CHECK: unreachable.cpp:
index bc625da..b0e1aab 100644 (file)
@@ -4,7 +4,7 @@
 // REQUIRES: system-linux, lldb
 //
 // RUN: true
-// RUN: %dexter clang-opt-bisect --debugger 'lldb' --builder 'clang' \
+// RUN: %dexter_base clang-opt-bisect --debugger 'lldb' --builder 'clang' \
 // RUN:     --cflags "-O0 -g" -- %s \
 // RUN:     | FileCheck %s
 // CHECK: running pass 0
index afc4652..fc3f455 100644 (file)
@@ -1,8 +1,7 @@
-XFAIL: darwin
 Purpose:
     Check the `help` subtool runs.
 
-RUN: %dexter help | FileCheck %s
+RUN: %dexter_base help | FileCheck %s
 CHECK: The following subtools are available:
 CHECK: clang-opt-bisect
 CHECK: help
index 2f9feaa..bbc9dd5 100644 (file)
@@ -1,8 +1,7 @@
-XFAIL: darwin
 Purpose:
     Check the `list-debuggers` subtool runs.
 
-RUN: %dexter list-debuggers | FileCheck %s
+RUN: %dexter_base list-debuggers | FileCheck %s
 CHECK: lldb
 CHECK: vs2015
 CHECK: vs2017
index a688bb0..feb26a7 100644 (file)
@@ -1,4 +1,3 @@
-// XFAIL: darwin
 // Purpose:
 //      Check that parsing bad commands gives a useful error.
 //          - Unbalanced parenthesis
@@ -8,7 +7,7 @@
 // Note: Despite using 'lldb' as the debugger, lldb is not actually required
 //       as the test should finish before lldb would be invoked.
 //
-// RUN: not %dexter test --builder 'clang' --debugger 'lldb' \
+// RUN: not %dexter_base test --builder 'clang' --debugger 'lldb' \
 // RUN:     --cflags "-O0 -g" -v -- %s \
 // RUN:     | FileCheck %s --match-full-lines --strict-whitespace
 //
index 477d05d..7cbce8d 100644 (file)
@@ -1,4 +1,3 @@
-// XFAIL: darwin
 // Purpose:
 //      Check that parsing bad commands gives a useful error.
 //          - Unbalanced parenthesis over multiple lines
@@ -8,7 +7,7 @@
 // Note: Despite using 'lldb' as the debugger, lldb is not actually required
 //       as the test should finish before lldb would be invoked.
 //
-// RUN: not %dexter test --builder 'clang' --debugger "lldb" \
+// RUN: not %dexter_base test --builder 'clang' --debugger "lldb" \
 // RUN:     --cflags "-O0 -g" -v -- %s \
 // RUN:     | FileCheck %s --match-full-lines --strict-whitespace
 //
index 8e8e401..a0b8ab7 100644 (file)
@@ -1,4 +1,3 @@
-// XFAIL: darwin
 // Purpose:
 //      Check that parsing bad commands gives a useful error.
 //          - Syntax error (misplaced ',')
@@ -8,7 +7,7 @@
 // Note: Despite using 'lldb' as the debugger, lldb is not actually required
 //       as the test should finish before lldb would be invoked.
 //
-// RUN: not %dexter test --builder 'clang' --debugger "lldb" \
+// RUN: not %dexter_base test --builder 'clang' --debugger "lldb" \
 // RUN:     --cflags "-O0 -g" -v -- %s \
 // RUN:     | FileCheck %s --match-full-lines --strict-whitespace
 //
index 98daaa6..f47ddf8 100644 (file)
@@ -1,4 +1,3 @@
-// XFAIL: darwin
 // Purpose:
 //      Check that parsing bad commands gives a useful error.
 //          - Syntax error (misplaced ',') over multiple lines
@@ -8,7 +7,7 @@
 // Note: Despite using 'lldb' as the debugger, lldb is not actually required
 //       as the test should finish before lldb would be invoked.
 //
-// RUN: not %dexter test --builder 'clang' --debugger "lldb" \
+// RUN: not %dexter_base test --builder 'clang' --debugger "lldb" \
 // RUN:     --cflags "-O0 -g" -v -- %s \
 // RUN:     | FileCheck %s --match-full-lines --strict-whitespace
 //
index 6b09aa9..d42c5a0 100644 (file)
@@ -1,4 +1,3 @@
-// XFAIL: darwin
 // Purpose:
 //      Check that parsing bad commands gives a useful error.
 //          - Type error (missing args)
@@ -8,7 +7,7 @@
 // Note: Despite using 'lldb' as the debugger, lldb is not actually required
 //       as the test should finish before lldb would be invoked.
 //
-// RUN: not %dexter test --builder 'clang' --debugger "lldb" \
+// RUN: not %dexter_base test --builder 'clang' --debugger "lldb" \
 // RUN:     --cflags "-O0 -g" -v -- %s \
 // RUN:     | FileCheck %s --match-full-lines --strict-whitespace
 //
index cbb5b75..733c0d4 100644 (file)
@@ -1,4 +1,3 @@
-// XFAIL: darwin
 // Purpose:
 //      Check that parsing bad commands gives a useful error.
 //          - Type error (missing args) over multple lines
@@ -8,7 +7,7 @@
 // Note: Despite using 'lldb' as the debugger, lldb is not actually required
 //       as the test should finish before lldb would be invoked.
 //
-// RUN: not %dexter test --builder 'clang' --debugger "lldb" \
+// RUN: not %dexter_base test --builder 'clang' --debugger "lldb" \
 // RUN:     --cflags "-O0 -g" -v -- %s \
 // RUN:     | FileCheck %s --match-full-lines --strict-whitespace
 //
index 9c4f257..43598db 100644 (file)
@@ -3,11 +3,11 @@
 //
 // REQUIRES: system-linux, lldb
 //
-// RUN: %dexter test --fail-lt 1.0 -w \
+// RUN: %dexter_base test --fail-lt 1.0 -w \
 // RUN:    --builder 'clang' --debugger 'lldb' --cflags "-O0 -g" \
 // RUN:    --results %t -- %s
 //
-// RUN: %dexter view %t/view.cpp.dextIR | FileCheck %s
+// RUN: %dexter_base view %t/view.cpp.dextIR | FileCheck %s
 // CHECK: ## BEGIN
 // CHECK: ## END
 //
index 1662649..721732a 100644 (file)
@@ -1,9 +1,8 @@
-XFAIL: darwin
 Purpose:
     Run DExTer unit tests.
 
 # Dexter returns 1 when no subtools are specified.
-RUN: not %dexter --unittest=show-all 2>&1 | FileCheck %s
+RUN: not %dexter_base --unittest=show-all 2>&1 | FileCheck %s
 
 CHECK: Ran {{[0-9]+}} tests
 CHECK-EMPTY:
index 82e9b80..f5a96c6 100644 (file)
@@ -97,13 +97,18 @@ if lldb_path is not None:
     config.available_features.add('lldb')
 
 # Produce dexter path, lldb path, and combine into the %dexter substitution
+# for running a test.
 dexter_path = os.path.join(config.debuginfo_tests_src_root,
                            'dexter', 'dexter.py')
-dexter_cmd = '"{}" "{}" test'.format(config.python3_executable, dexter_path)
+dexter_test_cmd = '"{}" "{}" test'.format(config.python3_executable, dexter_path)
 if lldb_path is not None:
-  dexter_cmd += ' --lldb-executable {}'.format(lldb_path)
+  dexter_test_cmd += ' --lldb-executable {}'.format(lldb_path)
+tools.append(ToolSubst('%dexter', dexter_test_cmd))
 
-tools.append(ToolSubst('%dexter', dexter_cmd))
+# For testing other bits of dexter that aren't under the "test" subcommand,
+# have a %dexter_base substitution.
+dexter_base_cmd = '"{}" "{}"'.format(config.python3_executable, dexter_path)
+tools.append(ToolSubst('%dexter_base', dexter_base_cmd))
 
 tool_dirs = [config.llvm_tools_dir]