@@ -78,10 +78,10 @@ final class BuildPlanTests: XCTestCase {
78
78
result. checkTargetsCount ( 2 )
79
79
80
80
let exe = try result. target ( for: " exe " ) . swiftTarget ( ) . compileArguments ( )
81
- XCTAssertMatch ( exe, [ " -swift-version " , " 3 " , " -Onone " , " -g " , " -enable-testing " , . equal( j) , " -DSWIFT_PACKAGE " , " -module-cache-path " , " /path/to/build/debug/ModuleCache " , . anySequence] )
81
+ XCTAssertMatch ( exe, [ " -swift-version " , " 3 " , " -Onone " , " -g " , " -enable-testing " , . equal( j) , " -DSWIFT_PACKAGE " , " -DDEBUG " , " - module-cache-path" , " /path/to/build/debug/ModuleCache " , . anySequence] )
82
82
83
83
let lib = try result. target ( for: " lib " ) . swiftTarget ( ) . compileArguments ( )
84
- XCTAssertMatch ( lib, [ " -swift-version " , " 3 " , " -Onone " , " -g " , " -enable-testing " , . equal( j) , " -DSWIFT_PACKAGE " , " -module-cache-path " , " /path/to/build/debug/ModuleCache " , . anySequence] )
84
+ XCTAssertMatch ( lib, [ " -swift-version " , " 3 " , " -Onone " , " -g " , " -enable-testing " , . equal( j) , " -DSWIFT_PACKAGE " , " -DDEBUG " , " - module-cache-path" , " /path/to/build/debug/ModuleCache " , . anySequence] )
85
85
86
86
#if os(macOS)
87
87
let linkArguments = [
@@ -211,7 +211,7 @@ final class BuildPlanTests: XCTestCase {
211
211
result. checkTargetsCount ( 3 )
212
212
213
213
let ext = try result. target ( for: " extlib " ) . clangTarget ( )
214
- var args = [ " -g " , " -O0 " ]
214
+ var args = [ " -g " , " -O0 " , " -DSWIFT_PACKAGE=1 " , " -DDEBUG=1 " ]
215
215
#if os(macOS)
216
216
args += [ " -fobjc-arc " ]
217
217
#endif
@@ -222,7 +222,7 @@ final class BuildPlanTests: XCTestCase {
222
222
XCTAssertEqual ( ext. moduleMap, AbsolutePath ( " /path/to/build/debug/extlib.build/module.modulemap " ) )
223
223
224
224
let exe = try result. target ( for: " exe " ) . clangTarget ( )
225
- args = [ " -g " , " -O0 " ]
225
+ args = [ " -g " , " -O0 " , " -DSWIFT_PACKAGE=1 " , " -DDEBUG=1 " ]
226
226
#if os(macOS)
227
227
args += [ " -fobjc-arc " ]
228
228
#endif
@@ -324,7 +324,7 @@ final class BuildPlanTests: XCTestCase {
324
324
result. checkTargetsCount ( 2 )
325
325
326
326
let lib = try result. target ( for: " lib " ) . clangTarget ( )
327
- var args = [ " -g " , " -O0 " ]
327
+ var args = [ " -g " , " -O0 " , " -DSWIFT_PACKAGE=1 " , " -DDEBUG=1 " ]
328
328
#if os(macOS)
329
329
args += [ " -fobjc-arc " ]
330
330
#endif
@@ -335,7 +335,7 @@ final class BuildPlanTests: XCTestCase {
335
335
XCTAssertEqual ( lib. moduleMap, AbsolutePath ( " /path/to/build/debug/lib.build/module.modulemap " ) )
336
336
337
337
let exe = try result. target ( for: " exe " ) . swiftTarget ( ) . compileArguments ( )
338
- XCTAssertMatch ( exe, [ " -swift-version " , " 3 " , " -Onone " , " -g " , " -enable-testing " , . equal( j) , " -DSWIFT_PACKAGE " , " -Xcc " , " -fmodule-map-file=/path/to/build/debug/lib.build/module.modulemap " , " -I " , " /Pkg/Sources/lib/include " , " -module-cache-path " , " /path/to/build/debug/ModuleCache " , . anySequence] )
338
+ XCTAssertMatch ( exe, [ " -swift-version " , " 3 " , " -Onone " , " -g " , " -enable-testing " , . equal( j) , " -DSWIFT_PACKAGE " , " -DDEBUG " , " - Xcc" , " -fmodule-map-file=/path/to/build/debug/lib.build/module.modulemap " , " -I " , " /Pkg/Sources/lib/include " , " -module-cache-path " , " /path/to/build/debug/ModuleCache " , . anySequence] )
339
339
340
340
#if os(macOS)
341
341
XCTAssertEqual ( try result. buildProduct ( for: " exe " ) . linkArguments ( ) , [
@@ -372,10 +372,10 @@ final class BuildPlanTests: XCTestCase {
372
372
#endif
373
373
374
374
let foo = try result. target ( for: " Foo " ) . swiftTarget ( ) . compileArguments ( )
375
- XCTAssertMatch ( foo, [ " -swift-version " , " 3 " , " -Onone " , " -g " , " -enable-testing " , . equal( j) , " -DSWIFT_PACKAGE " , " -module-cache-path " , " /path/to/build/debug/ModuleCache " , . anySequence] )
375
+ XCTAssertMatch ( foo, [ " -swift-version " , " 3 " , " -Onone " , " -g " , " -enable-testing " , . equal( j) , " -DSWIFT_PACKAGE " , " -DDEBUG " , " - module-cache-path" , " /path/to/build/debug/ModuleCache " , . anySequence] )
376
376
377
377
let fooTests = try result. target ( for: " FooTests " ) . swiftTarget ( ) . compileArguments ( )
378
- XCTAssertMatch ( fooTests, [ " -swift-version " , " 3 " , " -Onone " , " -g " , " -enable-testing " , . equal( j) , " -DSWIFT_PACKAGE " , " -module-cache-path " , " /path/to/build/debug/ModuleCache " , . anySequence] )
378
+ XCTAssertMatch ( fooTests, [ " -swift-version " , " 3 " , " -Onone " , " -g " , " -enable-testing " , . equal( j) , " -DSWIFT_PACKAGE " , " -DDEBUG " , " - module-cache-path" , " /path/to/build/debug/ModuleCache " , . anySequence] )
379
379
380
380
#if os(macOS)
381
381
XCTAssertEqual ( try result. buildProduct ( for: " PkgPackageTests " ) . linkArguments ( ) , [
@@ -413,7 +413,7 @@ final class BuildPlanTests: XCTestCase {
413
413
result. checkProductsCount ( 1 )
414
414
result. checkTargetsCount ( 1 )
415
415
416
- XCTAssertMatch ( try result. target ( for: " exe " ) . swiftTarget ( ) . compileArguments ( ) , [ " -swift-version " , " 3 " , " -Onone " , " -g " , " -enable-testing " , . equal( j) , " -DSWIFT_PACKAGE " , " -Xcc " , " -fmodule-map-file=/Clibgit/module.modulemap " , " -module-cache-path " , " /path/to/build/debug/ModuleCache " , . anySequence] )
416
+ XCTAssertMatch ( try result. target ( for: " exe " ) . swiftTarget ( ) . compileArguments ( ) , [ " -swift-version " , " 3 " , " -Onone " , " -g " , " -enable-testing " , . equal( j) , " -DSWIFT_PACKAGE " , " -DDEBUG " , " - Xcc" , " -fmodule-map-file=/Clibgit/module.modulemap " , " -module-cache-path " , " /path/to/build/debug/ModuleCache " , . anySequence] )
417
417
418
418
#if os(macOS)
419
419
XCTAssertEqual ( try result. buildProduct ( for: " exe " ) . linkArguments ( ) , [
@@ -552,10 +552,10 @@ final class BuildPlanTests: XCTestCase {
552
552
result. checkTargetsCount ( 2 )
553
553
554
554
let exe = try result. target ( for: " exe " ) . swiftTarget ( ) . compileArguments ( )
555
- XCTAssertMatch ( exe, [ " -swift-version " , " 4 " , " -Onone " , " -g " , " -enable-testing " , . equal( j) , " -DSWIFT_PACKAGE " , " -module-cache-path " , " /path/to/build/debug/ModuleCache " , . anySequence] )
555
+ XCTAssertMatch ( exe, [ " -swift-version " , " 4 " , " -Onone " , " -g " , " -enable-testing " , . equal( j) , " -DSWIFT_PACKAGE " , " -DDEBUG " , " - module-cache-path" , " /path/to/build/debug/ModuleCache " , . anySequence] )
556
556
557
557
let lib = try result. target ( for: " lib " ) . swiftTarget ( ) . compileArguments ( )
558
- XCTAssertMatch ( lib, [ " -swift-version " , " 4 " , " -Onone " , " -g " , " -enable-testing " , . equal( j) , " -DSWIFT_PACKAGE " , " -module-cache-path " , " /path/to/build/debug/ModuleCache " , . anySequence] )
558
+ XCTAssertMatch ( lib, [ " -swift-version " , " 4 " , " -Onone " , " -g " , " -enable-testing " , . equal( j) , " -DSWIFT_PACKAGE " , " -DDEBUG " , " - module-cache-path" , " /path/to/build/debug/ModuleCache " , . anySequence] )
559
559
560
560
#if os(macOS)
561
561
let linkArguments = [
@@ -605,18 +605,18 @@ final class BuildPlanTests: XCTestCase {
605
605
606
606
let exe = try result. target ( for: " exe " ) . clangTarget ( )
607
607
#if os(macOS)
608
- XCTAssertEqual ( exe. basicArguments ( ) , [ " -g " , " -O0 " , " -fobjc-arc " , " -fblocks " , " -fmodules " , " -fmodule-name=exe " , " -I " , " /Pkg/Sources/exe/include " , " -fmodules-cache-path=/path/to/build/debug/ModuleCache " ] )
608
+ XCTAssertEqual ( exe. basicArguments ( ) , [ " -g " , " -O0 " , " -DSWIFT_PACKAGE=1 " , " -DDEBUG=1 " , " - fobjc-arc" , " -fblocks " , " -fmodules " , " -fmodule-name=exe " , " -I " , " /Pkg/Sources/exe/include " , " -fmodules-cache-path=/path/to/build/debug/ModuleCache " ] )
609
609
#else
610
- XCTAssertEqual ( exe. basicArguments ( ) , [ " -g " , " -O0 " , " -fblocks " , " -fmodules " , " -fmodule-name=exe " , " -I " , " /Pkg/Sources/exe/include " , " -fmodules-cache-path=/path/to/build/debug/ModuleCache " ] )
610
+ XCTAssertEqual ( exe. basicArguments ( ) , [ " -g " , " -O0 " , " -DSWIFT_PACKAGE=1 " , " -DDEBUG=1 " , " -fblocks " , " -fmodules " , " -fmodule-name=exe " , " -I " , " /Pkg/Sources/exe/include " , " -fmodules-cache-path=/path/to/build/debug/ModuleCache " ] )
611
611
#endif
612
612
XCTAssertEqual ( exe. objects, [ AbsolutePath ( " /path/to/build/debug/exe.build/main.c.o " ) ] )
613
613
XCTAssertEqual ( exe. moduleMap, nil )
614
614
615
615
let lib = try result. target ( for: " lib " ) . clangTarget ( )
616
616
#if os(macOS)
617
- XCTAssertEqual ( lib. basicArguments ( ) , [ " -g " , " -O0 " , " -fobjc-arc " , " -fblocks " , " -fmodules " , " -fmodule-name=lib " , " -I " , " /Pkg/Sources/lib/include " , " -fmodules-cache-path=/path/to/build/debug/ModuleCache " ] )
617
+ XCTAssertEqual ( lib. basicArguments ( ) , [ " -g " , " -O0 " , " -DSWIFT_PACKAGE=1 " , " -DDEBUG=1 " , " - fobjc-arc" , " -fblocks " , " -fmodules " , " -fmodule-name=lib " , " -I " , " /Pkg/Sources/lib/include " , " -fmodules-cache-path=/path/to/build/debug/ModuleCache " ] )
618
618
#else
619
- XCTAssertEqual ( lib. basicArguments ( ) , [ " -g " , " -O0 " , " -fblocks " , " -fmodules " , " -fmodule-name=lib " , " -I " , " /Pkg/Sources/lib/include " , " -fmodules-cache-path=/path/to/build/debug/ModuleCache " ] )
619
+ XCTAssertEqual ( lib. basicArguments ( ) , [ " -g " , " -O0 " , " -DSWIFT_PACKAGE=1 " , " -DDEBUG=1 " , " -fblocks " , " -fmodules " , " -fmodule-name=lib " , " -I " , " /Pkg/Sources/lib/include " , " -fmodules-cache-path=/path/to/build/debug/ModuleCache " ] )
620
620
#endif
621
621
XCTAssertEqual ( lib. objects, [ AbsolutePath ( " /path/to/build/debug/lib.build/lib.cpp.o " ) ] )
622
622
XCTAssertEqual ( lib. moduleMap, AbsolutePath ( " /path/to/build/debug/lib.build/module.modulemap " ) )
0 commit comments