1# encoding: utf-8
2"""
3Test lldb data formatter subsystem.
4"""
5
6
7import lldb
8from lldbsuite.test.decorators import *
9from lldbsuite.test.lldbtest import *
10from lldbsuite.test import lldbutil
11
12from ObjCDataFormatterTestCase import ObjCDataFormatterTestCase
13
14
15class ObjCDataFormatterNSBundle(ObjCDataFormatterTestCase):
16
17    def test_nsbundle_with_run_command(self):
18        """Test formatters for NSBundle."""
19        self.appkit_tester_impl(self.nsbundle_data_formatter_commands, True)
20
21    @skipUnlessDarwin
22    def test_nsbundle_with_run_command_no_sonct(self):
23        """Test formatters for NSBundle."""
24        self.appkit_tester_impl(self.nsbundle_data_formatter_commands, False)
25
26    def nsbundle_data_formatter_commands(self):
27        self.expect(
28            'frame variable bundle_string bundle_url main_bundle',
29            substrs=[
30                '(NSBundle *) bundle_string = ',
31                ' @"/System/Library/Frameworks/Accelerate.framework"',
32                '(NSBundle *) bundle_url = ',
33                ' @"/System/Library/Frameworks/Foundation.framework"',
34                '(NSBundle *) main_bundle = ', 'data-formatter-objc'
35            ])
36