[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / lldb / packages / Python / lldbsuite / test / macosx / version_zero / TestGetVersionZeroVersion.py
blobf7e4da73dda65ceb3ec12f5a244e3f7688634a3c
1 """
2 Read in a library with a version number of 0.0.0, make sure we produce a good version.
3 """
7 import lldb
8 from lldbsuite.test import decorators
9 import lldbsuite.test.lldbutil as lldbutil
10 from lldbsuite.test.lldbtest import *
13 class TestGetVersionForZero(TestBase):
15 mydir = TestBase.compute_mydir(__file__)
17 # If your test case doesn't stress debug info, the
18 # set this to true. That way it won't be run once for
19 # each debug info format.
20 NO_DEBUG_INFO_TESTCASE = True
22 def test_get_version_zero(self):
23 """Read in a library with a version of 0.0.0. Test SBModule::GetVersion"""
24 self.yaml2obj("libDylib.dylib.yaml", self.getBuildArtifact("libDylib.dylib"))
25 self.do_test()
27 def do_test(self):
28 lib_name = "libDylib.dylib"
29 target = lldbutil.run_to_breakpoint_make_target(self, exe_name=lib_name)
30 module = target.FindModule(lldb.SBFileSpec(lib_name))
31 self.assertTrue(module.IsValid(), "Didn't find the libDylib.dylib module")
32 # For now the actual version numbers are wrong for a library of 0.0.0
33 # but the previous code would crash iterating over the resultant
34 # list. So we are testing that that doesn't happen.
35 did_iterate = False
36 for elem in module.GetVersion():
37 did_iterate = True
38 self.assertTrue(did_iterate, "Didn't get into the GetVersion loop")