xref: /llvm-project/lldb/test/API/macosx/simulator/TestSimulatorPlatform.py (revision 98c3a38a1967ece4e70891aa188c51e29ca0f8d3)
1import lldb
2from lldbsuite.test.lldbtest import *
3from lldbsuite.test.decorators import *
4import lldbsuite.test.lldbutil as lldbutil
5import json
6import unittest2
7
8
9@skipIfDarwin # rdar://problem/64552748
10class TestSimulatorPlatformLaunching(TestBase):
11
12    mydir = TestBase.compute_mydir(__file__)
13    NO_DEBUG_INFO_TESTCASE = True
14
15    def run_with(self, arch, platform, os, env):
16        self.build(dictionary={'TRIPLE': arch+'-apple-'+os+'-'+env, 'ARCH': arch})
17        lldbutil.run_to_source_breakpoint(self, "break here",
18                                          lldb.SBFileSpec("hello.c"))
19        self.expect('image list -b -t',
20                    patterns=['a\.out '+arch+'-apple-'+os+'.*-'+env])
21
22    @skipUnlessDarwin
23    @skipIfDarwinEmbedded
24    @apple_simulator_test('iphone')
25    def test_ios(self):
26        """Test running an iOS simulator binary"""
27        self.run_with(arch=self.getArchitecture(),
28                      os='ios', env='simulator',
29                      platform='iphonesimulator')
30
31    @skipUnlessDarwin
32    @skipIfDarwinEmbedded
33    @apple_simulator_test('appletv')
34    def test_tvos(self):
35        """Test running an tvOS simulator binary"""
36        self.run_with(arch=self.getArchitecture(),
37                      os='tvos', env='simulator',
38                      platform='appletvsimulator')
39
40    @skipUnlessDarwin
41    @skipIfDarwinEmbedded
42    @apple_simulator_test('watch')
43    def test_watchos(self):
44        """Test running a 32-bit watchOS simulator binary"""
45        self.run_with(arch='i386',
46                      os='watchos', env='simulator',
47                      platform='watchsimulator')
48