From 9b13bea61a576a41eda7c88d1628f9914bfc02b4 Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Tue, 18 Sep 2018 19:31:47 +0000 Subject: 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 --- lldb/packages/Python/lldbsuite/test/configuration.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lldb/packages/Python/lldbsuite/test/configuration.py') diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py index a1a0ced..f92b898 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 -- cgit v1.1