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