summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/configuration.py
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-09-18 19:31:47 +0000
committerVedant Kumar <vsk@apple.com>2018-09-18 19:31:47 +0000
commit9b13bea61a576a41eda7c88d1628f9914bfc02b4 (patch)
treee3664f582263814503176f9237fa2a3b02b0f469 /lldb/packages/Python/lldbsuite/test/configuration.py
parentee679e10bbd2f9d66ecc04cac0678ffe7082f83a (diff)
downloadbcm5719-llvm-9b13bea61a576a41eda7c88d1628f9914bfc02b4.tar.gz
bcm5719-llvm-9b13bea61a576a41eda7c88d1628f9914bfc02b4.zip
Allow use of self.filecheck in LLDB tests (c.f self.expect)
Add a "filecheck" method to the LLDB test base. This allows test authors to pattern match command output using FileCheck, making it possible to write stricter tests than what `self.expect` allows. For context (motivation, examples of stricter checking, etc), see the lldb-dev thread: "Using FileCheck in lldb inline tests". Differential Revision: https://reviews.llvm.org/D50751 llvm-svn: 342508
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/configuration.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/configuration.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py
index a1a0ced4b4f..f92b898ecc9 100644
--- a/lldb/packages/Python/lldbsuite/test/configuration.py
+++ b/lldb/packages/Python/lldbsuite/test/configuration.py
@@ -46,6 +46,9 @@ count = 1
arch = None # Must be initialized after option parsing
compiler = None # Must be initialized after option parsing
+# Path to the FileCheck testing tool. Not optional.
+filecheck = None
+
# The arch might dictate some specific CFLAGS to be passed to the toolchain to build
# the inferior programs. The global variable cflags_extras provides a hook to do
# just that.
@@ -179,3 +182,11 @@ def get_absolute_path_to_root_test_dir():
return test_subdir
return os.path.dirname(os.path.realpath(__file__))
+
+
+def get_filecheck_path():
+ """
+ Get the path to the FileCheck testing tool.
+ """
+ assert os.path.lexists(filecheck)
+ return filecheck
OpenPOWER on IntegriCloud