Skip to content

Commit fd49e86

Browse files
committed
Convert inline test into regular test (NFC)
1 parent 68db689 commit fd49e86

File tree

2 files changed

+34
-30
lines changed

2 files changed

+34
-30
lines changed
Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
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
132
from lldbsuite.test.decorators import *
3+
import lldbsuite.test.lldbtest as lldbtest
4+
import lldbsuite.test.lldbutil as lldbutil
145

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'])
Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
1-
// main.swift
2-
//
3-
// This source file is part of the Swift.org open source project
4-
//
5-
// Copyright (c) 2014 - 2018 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-
// -----------------------------------------------------------------------------
121
import Foundation
132

143
func main() {
154
var notification = Notification(name: Notification.Name(rawValue: "MyNotification"), object: nil, userInfo: [:])
16-
print("done!") //% self.expect("frame variable -d run -- notification", substrs=['name = ', '"MyNotification"', 'object = nil', 'userInfo = 0 key/value pairs'])
17-
//% self.expect("expression -d run -- notification", substrs=['name = ', '"MyNotification"', 'object = nil', 'userInfo = 0 key/value pairs'])
5+
print("break here!")
186
}
197

208
var g_notification = Notification(name: Notification.Name(rawValue: "MyNotification"), object: nil, userInfo: [:])
219

22-
main() //% self.expect("target variable -d run g_notification", substrs=['name = ', '"MyNotification"', 'object = nil', 'userInfo = 0 key/value pairs'])
23-
//% self.expect("expression -d run -- g_notification", substrs=['name = ', '"MyNotification"', 'object = nil', 'userInfo = 0 key/value pairs'])
10+
main()

0 commit comments

Comments
 (0)