diff options
author | David Spickett <david.spickett@linaro.org> | 2024-07-31 08:37:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-31 08:37:42 +0100 |
commit | aa07282a25c3d6df04af9a4d34874cc433c9c68a (patch) | |
tree | f3ef516e42b027a917cce5d98a5bc2a74723bea1 /lldb/packages/Python/lldbsuite/test/lldbtest.py | |
parent | 07d2709a17860a202d91781769a88837e4fb5f2a (diff) | |
download | llvm-aa07282a25c3d6df04af9a4d34874cc433c9c68a.zip llvm-aa07282a25c3d6df04af9a4d34874cc433c9c68a.tar.gz llvm-aa07282a25c3d6df04af9a4d34874cc433c9c68a.tar.bz2 |
[lldb][test] Fix TestMultipleDebuggers test on non-x86, other small issues (#101169)
This test has been flaky lately
(https://github.com/llvm/llvm-project/issues/101162) and I disabled it
everywhere initially.
I found that it always uses "x86_64" for the program architecture so the
test was "passing" elsewhere but I don't think it was meant to. So I
have added a define to pass on the host's architecture when compiling.
This makes it work on AArch64 as well.
While I'm here I've fixed the uint64_t formatting warnings by using the
defined formats that'll work everywhere.
In addition, I found that the function names include "()" on Linux, so
now we check for "foo" or "foo()".
The test cpp file has never been, or was only partially formatted so
I've not formatted the changes, just kept to the local style.
I've removed the Linux skip to see if any of this helps the timeouts,
and to verify the build command changes. If the timeouts come back I'll
disable it again.
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbtest.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/lldbtest.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py index f97c41d..b57c3bd 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbtest.py +++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -1514,19 +1514,23 @@ class Base(unittest.TestCase): stdflag = "-std=c++11" return stdflag - def buildDriver(self, sources, exe_name): + def buildDriver(self, sources, exe_name, defines=None): """Platform-specific way to build a program that links with LLDB (via the liblldb.so or LLDB.framework). """ + if defines is None: + defines = [] + stdflag = self.getstdFlag() stdlibflag = self.getstdlibFlag() + defines = " ".join(["-D{}={}".format(name, value) for name, value in defines]) lib_dir = configuration.lldb_libs_dir if self.hasDarwinFramework(): d = { "CXX_SOURCES": sources, "EXE": exe_name, - "CFLAGS_EXTRAS": "%s %s" % (stdflag, stdlibflag), + "CFLAGS_EXTRAS": "%s %s %s" % (stdflag, stdlibflag, defines), "FRAMEWORK_INCLUDES": "-F%s" % self.framework_dir, "LD_EXTRAS": "%s -Wl,-rpath,%s" % (self.lib_lldb, self.framework_dir), } @@ -1534,12 +1538,13 @@ class Base(unittest.TestCase): d = { "CXX_SOURCES": sources, "EXE": exe_name, - "CFLAGS_EXTRAS": "%s %s -I%s -I%s" + "CFLAGS_EXTRAS": "%s %s -I%s -I%s %s" % ( stdflag, stdlibflag, os.path.join(os.environ["LLDB_SRC"], "include"), os.path.join(configuration.lldb_obj_root, "include"), + defines, ), "LD_EXTRAS": "-L%s -lliblldb" % lib_dir, } @@ -1547,12 +1552,13 @@ class Base(unittest.TestCase): d = { "CXX_SOURCES": sources, "EXE": exe_name, - "CFLAGS_EXTRAS": "%s %s -I%s -I%s" + "CFLAGS_EXTRAS": "%s %s -I%s -I%s %s" % ( stdflag, stdlibflag, os.path.join(os.environ["LLDB_SRC"], "include"), os.path.join(configuration.lldb_obj_root, "include"), + defines, ), "LD_EXTRAS": "-L%s -llldb -Wl,-rpath,%s" % (lib_dir, lib_dir), } |