Skip to content

Commit 7f8ec27

Browse files
committed
Add a testcase for explicit Swift modules
1 parent 8273f1f commit 7f8ec27

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SWIFT_SOURCES := main.swift
2+
SWIFT_ENABLE_EXPLICIT_MODULES := Yes
3+
include Makefile.rules
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import lldb
2+
from lldbsuite.test.decorators import *
3+
import lldbsuite.test.lldbtest as lldbtest
4+
import lldbsuite.test.lldbutil as lldbutil
5+
import unittest2
6+
7+
8+
class TestSwiftExplicitModules(lldbtest.TestBase):
9+
10+
@swiftTest
11+
@expectedFailureAll(bugnumber='rdar://121078994')
12+
def test_any_type(self):
13+
"""Test explicit Swift modules"""
14+
self.build()
15+
target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
16+
self, 'Set breakpoint here', lldb.SBFileSpec('main.swift'))
17+
18+
self.expect("expression c", substrs=['hello explicit'])
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Class {
2+
var msg : String = "hello explicit"
3+
}
4+
5+
func main() {
6+
let c = Class()
7+
print(c) // Set breakpoint here
8+
}
9+
10+
main()

0 commit comments

Comments
 (0)