|
1 | | -# TestSwiftFoundationValueTypes.py |
2 | | -# |
3 | | -# This source file is part of the Swift.org open source project |
4 | | -# |
5 | | -# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors |
6 | | -# Licensed under Apache License v2.0 with Runtime Library Exception |
7 | | -# |
8 | | -# See https://swift.org/LICENSE.txt for license information |
9 | | -# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors |
10 | | -# |
11 | | -# ------------------------------------------------------------------------------ |
12 | | -import lldbsuite.test.lldbinline as lldbinline |
| 1 | +import lldb |
13 | 2 | from lldbsuite.test.decorators import * |
| 3 | +import lldbsuite.test.lldbtest as lldbtest |
| 4 | +import lldbsuite.test.lldbutil as lldbutil |
14 | 5 |
|
15 | | -lldbinline.MakeInlineTest( |
16 | | - __file__, globals(), decorators= |
17 | | - [skipUnlessDarwin,swiftTest]) |
| 6 | + |
| 7 | +class TestSwiftFoundationTypeNotification(lldbtest.TestBase): |
| 8 | + |
| 9 | + mydir = lldbtest.TestBase.compute_mydir(__file__) |
| 10 | + |
| 11 | + @swiftTest |
| 12 | + def test(self): |
| 13 | + self.build() |
| 14 | + target, process, thread, bkpt = lldbutil.run_to_source_breakpoint( |
| 15 | + self, 'break here', lldb.SBFileSpec('main.swift')) |
| 16 | + self.expect("log enable lldb types -v") |
| 17 | + # global |
| 18 | + self.expect("target variable -d run g_notification", |
| 19 | + substrs=['name = ', '"MyNotification"', |
| 20 | + 'object = nil', |
| 21 | + 'userInfo = 0 key/value pairs']) |
| 22 | + self.expect("expression -d run -- g_notification", |
| 23 | + substrs=['name = ', '"MyNotification"', |
| 24 | + 'object = nil', |
| 25 | + 'userInfo = 0 key/value pairs']) |
| 26 | + # local |
| 27 | + self.expect("frame variable -d run -- notification", |
| 28 | + substrs=['name = ', '"MyNotification"', |
| 29 | + 'object = nil', |
| 30 | + 'userInfo = 0 key/value pairs']) |
| 31 | + self.expect("expression -d run -- notification", |
| 32 | + substrs=['name = ', '"MyNotification"', |
| 33 | + 'object = nil', |
| 34 | + 'userInfo = 0 key/value pairs']) |
0 commit comments