Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / python_api / sblaunchinfo / TestSBLaunchInfo.py
blob7703666ea4947d29643b377d7fecba238a4a3e81
1 """
2 Test SBLaunchInfo
3 """
6 from lldbsuite.test.lldbtest import *
9 def lookup(info, key):
10 for i in range(info.GetNumEnvironmentEntries()):
11 KeyEqValue = info.GetEnvironmentEntryAtIndex(i)
12 Key, Value = KeyEqValue.split("=")
13 if Key == key:
14 return Value
15 return ""
18 class TestSBLaunchInfo(TestBase):
19 NO_DEBUG_INFO_TESTCASE = True
21 def test_environment_getset(self):
22 info = lldb.SBLaunchInfo(None)
23 info.SetEnvironmentEntries(["FOO=BAR"], False)
24 self.assertEquals(1, info.GetNumEnvironmentEntries())
25 info.SetEnvironmentEntries(["BAR=BAZ"], True)
26 self.assertEquals(2, info.GetNumEnvironmentEntries())
27 self.assertEquals("BAR", lookup(info, "FOO"))
28 self.assertEquals("BAZ", lookup(info, "BAR"))