@@ -68,13 +68,20 @@ def build(args):
68
68
swiftc = os .path .abspath (args .swiftc )
69
69
build_dir = os .path .abspath (args .build_dir )
70
70
71
+ if args .build_style == "debug" :
72
+ style_options = "Debug"
73
+ else :
74
+ style_options = "Release"
75
+
71
76
run ("xcodebuild -workspace {source_dir}/XCTest.xcworkspace "
72
77
"-scheme SwiftXCTest "
78
+ "-configuration {style_options} "
73
79
"SWIFT_EXEC=\" {swiftc}\" "
74
80
"SWIFT_LINK_OBJC_RUNTIME=YES "
75
81
"SYMROOT=\" {build_dir}\" OBJROOT=\" {build_dir}\" " .format (
76
82
swiftc = swiftc ,
77
83
build_dir = build_dir ,
84
+ style_options = style_options ,
78
85
source_dir = SOURCE_DIR ))
79
86
80
87
if args .test :
@@ -92,14 +99,21 @@ def test(args):
92
99
swiftc = os .path .abspath (args .swiftc )
93
100
build_dir = os .path .abspath (args .build_dir )
94
101
102
+ if args .build_style == "debug" :
103
+ style_options = "Debug"
104
+ else :
105
+ style_options = "Release"
106
+
95
107
run ("xcodebuild -workspace {source_dir}/XCTest.xcworkspace "
96
108
"-scheme SwiftXCTestFunctionalTests "
109
+ "-configuration {style_options} "
97
110
"SWIFT_EXEC=\" {swiftc}\" "
98
111
"SWIFT_LINK_OBJC_RUNTIME=YES "
99
112
"SYMROOT=\" {build_dir}\" OBJROOT=\" {build_dir}\" "
100
113
"| grep -v \" export\" " .format (
101
114
swiftc = swiftc ,
102
115
build_dir = build_dir ,
116
+ style_options = style_options ,
103
117
source_dir = SOURCE_DIR ))
104
118
105
119
@staticmethod
@@ -443,6 +457,20 @@ def main(args=sys.argv[1:]):
443
457
"--libdispatch-src-dir" ,
444
458
help = "Path to swift-corelibs-libdispatch source tree, which "
445
459
"the built XCTest.so will be linked against." )
460
+ test_parser .add_argument (
461
+ "--release" ,
462
+ help = "builds the tests for release" ,
463
+ action = "store_const" ,
464
+ dest = "build_style" ,
465
+ const = "release" ,
466
+ default = "debug" )
467
+ test_parser .add_argument (
468
+ "--debug" ,
469
+ help = "builds the tests for debug (the default)" ,
470
+ action = "store_const" ,
471
+ dest = "build_style" ,
472
+ const = "debug" ,
473
+ default = "debug" )
446
474
447
475
install_parser = subparsers .add_parser (
448
476
"install" ,
0 commit comments