Use AppleTestInfo provider for test targets

This simplifies Tulsi so it does not have to be aware of the
underlying macro structure of the test rules.

PiperOrigin-RevId: 186055968
diff --git a/src/TulsiGenerator/Bazel/tulsi/tulsi_aspects.bzl b/src/TulsiGenerator/Bazel/tulsi/tulsi_aspects.bzl
index 4fed8bf..0194eaa 100644
--- a/src/TulsiGenerator/Bazel/tulsi/tulsi_aspects.bzl
+++ b/src/TulsiGenerator/Bazel/tulsi/tulsi_aspects.bzl
@@ -21,6 +21,7 @@
 load(
     ':tulsi_aspects_paths.bzl',
      'AppleBundleInfo',
+     'AppleTestInfo',
      'IosExtensionBundleInfo',
 )
 
@@ -212,6 +213,10 @@
       is_dir=new_is_dir
   )
 
+def _depset_to_file_metadata_list(a_depset):
+  """"Converts a depset of files into a list of _file_metadata structs."""
+  return [_file_metadata(f) for f in a_depset.to_list()]
+
 
 def _collect_artifacts(obj, attr_path):
   """Returns a list of Artifact objects for the attr_path in obj."""
@@ -640,6 +645,19 @@
     target_defines = objc_provider.define.to_list()
 
   platform_type = _get_platform_type(ctx)
+  non_arc_srcs = _collect_files(rule, 'attr.non_arc_srcs')
+
+  # Collect test information.
+  if AppleTestInfo in target:
+    provider = target[AppleTestInfo]
+    srcs = _depset_to_file_metadata_list(provider.sources)
+    non_arc_srcs = _depset_to_file_metadata_list(provider.non_arc_sources)
+    target_includes = [_convert_outpath_to_symlink_path(x) for x in provider.includes.to_list()]
+    swift_transitive_modules = _depset_to_file_metadata_list(provider.swift_modules)
+    objc_module_maps = _depset_to_file_metadata_list(provider.module_maps)
+  else:
+    swift_transitive_modules = swift_transitive_modules.to_list()
+    objc_module_maps = objc_module_maps.to_list()
 
   info = _struct_omitting_none(
       artifacts=artifacts,
@@ -656,11 +674,11 @@
       includes=target_includes,
       os_deployment_target=_extract_minimum_os_for_platform(ctx, platform_type),
       label=str(target.label),
-      non_arc_srcs=_collect_files(rule, 'attr.non_arc_srcs'),
+      non_arc_srcs=non_arc_srcs,
       secondary_product_artifacts=_collect_secondary_artifacts(target, ctx),
       srcs=srcs,
-      swift_transitive_modules=swift_transitive_modules.to_list(),
-      objc_module_maps=list(objc_module_maps),
+      swift_transitive_modules=swift_transitive_modules,
+      objc_module_maps=objc_module_maps,
       type=target_kind,
       infoplist=infoplist.basename if infoplist else None,
       platform_type=platform_type,
diff --git a/src/TulsiGenerator/Bazel/tulsi/tulsi_aspects_paths.bzl b/src/TulsiGenerator/Bazel/tulsi/tulsi_aspects_paths.bzl
index c5e0266..8ce3a51 100644
--- a/src/TulsiGenerator/Bazel/tulsi/tulsi_aspects_paths.bzl
+++ b/src/TulsiGenerator/Bazel/tulsi/tulsi_aspects_paths.bzl
@@ -22,7 +22,12 @@
     _AppleBundleInfo='AppleBundleInfo',
     _IosExtensionBundleInfo='IosExtensionBundleInfo',
 )
+load(
+    '@build_bazel_rules_apple//apple/testing:apple_test_rules.bzl',
+    _AppleTestInfo='AppleTestInfo',
+)
 
 # Re-export providers.
 AppleBundleInfo = _AppleBundleInfo
+AppleTestInfo = _AppleTestInfo
 IosExtensionBundleInfo = _IosExtensionBundleInfo
diff --git a/src/TulsiGenerator/PBXTargetGenerator.swift b/src/TulsiGenerator/PBXTargetGenerator.swift
index f9d7baa..cb5a3c9 100644
--- a/src/TulsiGenerator/PBXTargetGenerator.swift
+++ b/src/TulsiGenerator/PBXTargetGenerator.swift
@@ -537,10 +537,13 @@
         ref.isInputFile = target.targetType == .sourceFile
       }
 
-      if sourceFileInfos.isEmpty &&
+      // Indexer targets aren't needed:
+      // - if the target has no source files (there's nothing to index!)
+      // - if the target is a test bundle (we generate proper targets for these).
+      if (sourceFileInfos.isEmpty &&
           nonARCSourceFileInfos.isEmpty &&
           frameworkFileInfos.isEmpty &&
-          nonSourceVersionedFileInfos.isEmpty {
+          nonSourceVersionedFileInfos.isEmpty) || ruleEntry.pbxTargetType?.isTest ?? false {
         return (frameworkSearchPaths)
       }
 
@@ -1120,8 +1123,9 @@
   private func updateTestTargetBuildPhases(_ target: PBXNativeTarget,
                                            ruleEntry: RuleEntry,
                                            ruleEntryMap: RuleEntryMap) {
-    let (testSourceFileInfos, testNonArcSourceFileInfos, containsSwift) =
-      testSourceFiles(forRuleEntry: ruleEntry, ruleEntryMap: ruleEntryMap)
+    let testSourceFileInfos = ruleEntry.sourceFiles
+    let testNonArcSourceFileInfos = ruleEntry.nonARCSourceFiles
+    let containsSwift = ruleEntry.attributes[.has_swift_dependency] as? Bool ?? false
 
     // For the Swift dummy files phase to work, it has to be placed before the Compile Sources build
     // phase.
@@ -1244,15 +1248,6 @@
       }
     }
 
-    // Traverse the apple_unit_test -> *_test_bundle -> apple_binary graph in order to get to the
-    // binary's build settings. If the chain is broken, just return the current testSettings.
-    guard let testBundleLabelString = ruleEntry.attributes[RuleEntry.Attribute.test_bundle] as? String,
-          let testBundle = ruleEntryMap.ruleEntry(buildLabel: BuildLabel(testBundleLabelString), depender: ruleEntry),
-          let testBundleBinaryLabelString = testBundle.attributes[RuleEntry.Attribute.binary] as? String,
-          let testBundleBinary = ruleEntryMap.ruleEntry(buildLabel: BuildLabel(testBundleBinaryLabelString), depender: testBundle) else {
-      return testSettings
-    }
-
     let includes = NSMutableOrderedSet()
 
     // We don't use the defines at the moment but the function will add them anyway. We could try
@@ -1268,16 +1263,6 @@
     addSwiftIncludes(ruleEntry, toSet: swiftIncludePaths)
     addOtherSwiftFlags(ruleEntry, toSet: otherSwiftFlags)
 
-    for dependency in testBundleBinary.dependencies {
-      guard let dependencyTarget = ruleEntryMap.ruleEntry(buildLabel: dependency, depender: testBundleBinary) else {
-        continue
-      }
-      addIncludes(dependencyTarget, toSet: includes)
-      addLocalSettings(dependencyTarget, localDefines: &defines, localIncludes: includes, otherCFlags: NSMutableOrderedSet())
-      addSwiftIncludes(dependencyTarget, toSet: swiftIncludePaths)
-      addOtherSwiftFlags(dependencyTarget, toSet: otherSwiftFlags)
-    }
-
     let includesArr = includes.array as! [String]
     testSettings["HEADER_SEARCH_PATHS"] = "$(inherited) " + includesArr.joined(separator: " ")
 
@@ -1292,42 +1277,6 @@
     return testSettings
   }
 
-  // Returns a tuple containing the sources and non-ARC sources for a ruleEntry of a test rule (e.g.
-  // apple_unit_test) and a boolean indicating whether the test sources include Swift files.
-  private func testSourceFiles(forRuleEntry ruleEntry: RuleEntry,
-                               ruleEntryMap: RuleEntryMap) -> ([BazelFileInfo], [BazelFileInfo], Bool) {
-    // Check if the test target returns contains a test_bundle attribute get the test sources from.
-    guard let testBundleLabelString = ruleEntry.attributes[RuleEntry.Attribute.test_bundle] as? String else {
-      return (ruleEntry.sourceFiles, ruleEntry.nonARCSourceFiles, false)
-    }
-
-    // Traverse the apple_unit_test -> *_test_bundle -> apple_binary graph in order to get to the
-    // binary's direct dependencies. If at any point the expected graph is broken, just return empty
-    // sources.
-    guard let testBundle = ruleEntryMap.ruleEntry(buildLabel: BuildLabel(testBundleLabelString), depender: ruleEntry),
-          let testBundleBinaryLabelString = testBundle.attributes[RuleEntry.Attribute.binary] as? String,
-          let testBundleBinary = ruleEntryMap.ruleEntry(buildLabel: BuildLabel(testBundleBinaryLabelString), depender: testBundle) else {
-      return ([], [], false)
-    }
-
-    var sourceFiles = [BazelFileInfo]()
-    var nonARCSourceFiles = [BazelFileInfo]()
-    var containsSwift = false
-
-    // Once we have the binary's direct dependencies, gather all the possible sources of those
-    // targets and return them.
-    for dependency in testBundleBinary.dependencies {
-      guard let dependencyTarget = ruleEntryMap.ruleEntry(buildLabel: dependency, depender: testBundleBinary) else {
-        continue
-      }
-      sourceFiles.append(contentsOf: dependencyTarget.sourceFiles)
-      nonARCSourceFiles.append(contentsOf: dependencyTarget.nonARCSourceFiles)
-      containsSwift = containsSwift || dependencyTarget.type == "swift_library"
-    }
-
-    return (sourceFiles, nonARCSourceFiles, containsSwift)
-  }
-
   // Resolves a BuildLabel to an existing PBXTarget, handling target name collisions.
   private func projectTargetForLabel(_ label: BuildLabel) -> PBXTarget? {
     guard let targetName = label.targetName else { return nil }
diff --git a/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/ComplexSingleProject.xcodeproj/project.pbxproj b/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/ComplexSingleProject.xcodeproj/project.pbxproj
index f1031bf..c8cac1b 100644
--- a/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/ComplexSingleProject.xcodeproj/project.pbxproj
+++ b/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/ComplexSingleProject.xcodeproj/project.pbxproj
@@ -741,12 +741,12 @@
 			buildActionMask = 0;
 			files = (
 				E6AF4947CFB68C6700000000 /* memleaks.m in memleaks */,
+				E6AF4947F643652200000000 /* defaultTestSource.m in srcs */,
 				E6AF4947958553E300000000 /* src5.mm in srcs */,
 				E6AF49478970786C00000000 /* src1.m in srcs */,
 				E6AF49479B31F4AA00000000 /* src2.m in srcs */,
 				E6AF4947AB2790F000000000 /* src3.m in srcs */,
 				E6AF4947BAE52D2E00000000 /* src4.m in srcs */,
-				E6AF4947F643652200000000 /* defaultTestSource.m in srcs */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/SimpleSkylarkProject.xcodeproj/project.pbxproj b/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/SimpleSkylarkProject.xcodeproj/project.pbxproj
index 91592e9..7ca609b 100644
--- a/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/SimpleSkylarkProject.xcodeproj/project.pbxproj
+++ b/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/SimpleSkylarkProject.xcodeproj/project.pbxproj
@@ -717,7 +717,7 @@
 				BAZEL_TARGET = "//tulsi_e2e_simple_skylark:XCUITest";
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1";
-				HEADER_SEARCH_PATHS = "$(inherited) $(TULSI_BWRS)/tools/cpp/gcc3 $(TULSI_WR)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_j2objc/JavaLibrary $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_WR)/third_party/java_src/j2objc/jre_emul $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul $(TULSI_WR)/third_party/protobuf/objectivec $(TULSI_WR)/_tulsi-includes/x/x/third_party/protobuf/objectivec $(TULSI_BWRS)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_j2objc/JavaLibrary $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul $(TULSI_BWRS)/third_party/protobuf/objectivec $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/protobuf/objectivec";
+				HEADER_SEARCH_PATHS = "$(inherited) $(TULSI_BWRS)/tools/cpp/gcc3 $(TULSI_WR)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_j2objc/JavaLibrary $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_WR)/third_party/java_src/j2objc/jre_emul $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul $(TULSI_WR)/third_party/protobuf/objectivec $(TULSI_WR)/_tulsi-includes/x/x/third_party/protobuf/objectivec $(TULSI_WR)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_generated_protos/ObjcProtos $(TULSI_BWRS)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_j2objc/JavaLibrary $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul $(TULSI_BWRS)/third_party/protobuf/objectivec $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/protobuf/objectivec $(TULSI_BWRS)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_generated_protos/ObjcProtos";
 				INFOPLIST_FILE = "${PROJECT_FILE_PATH}/.tulsi/Resources/StubInfoPlist.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 7.0;
 				PRODUCT_BUNDLE_IDENTIFIER = com.google.Tulsi.ApplicationTests;
@@ -757,7 +757,7 @@
 				BUNDLE_LOADER = "$(TEST_HOST)";
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1";
-				HEADER_SEARCH_PATHS = "$(inherited) $(TULSI_BWRS)/tools/cpp/gcc3 $(TULSI_WR)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_j2objc/JavaLibrary $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_WR)/third_party/java_src/j2objc/jre_emul $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul $(TULSI_WR)/third_party/protobuf/objectivec $(TULSI_WR)/_tulsi-includes/x/x/third_party/protobuf/objectivec $(TULSI_BWRS)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_j2objc/JavaLibrary $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul $(TULSI_BWRS)/third_party/protobuf/objectivec $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/protobuf/objectivec";
+				HEADER_SEARCH_PATHS = "$(inherited) $(TULSI_BWRS)/tools/cpp/gcc3 $(TULSI_WR)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_j2objc/JavaLibrary $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_WR)/third_party/java_src/j2objc/jre_emul $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul $(TULSI_WR)/third_party/protobuf/objectivec $(TULSI_WR)/_tulsi-includes/x/x/third_party/protobuf/objectivec $(TULSI_WR)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_generated_protos/ObjcProtos $(TULSI_BWRS)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_j2objc/JavaLibrary $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul $(TULSI_BWRS)/third_party/protobuf/objectivec $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/protobuf/objectivec $(TULSI_BWRS)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_generated_protos/ObjcProtos";
 				INFOPLIST_FILE = "${PROJECT_FILE_PATH}/.tulsi/Resources/StubInfoPlist.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 7.0;
 				PRODUCT_BUNDLE_IDENTIFIER = com.google.Tulsi.ApplicationTests;
@@ -922,7 +922,7 @@
 				BAZEL_TARGET = "//tulsi_e2e_simple_skylark:XCUITest";
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1";
-				HEADER_SEARCH_PATHS = "$(inherited) $(TULSI_BWRS)/tools/cpp/gcc3 $(TULSI_WR)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_j2objc/JavaLibrary $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_WR)/third_party/java_src/j2objc/jre_emul $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul $(TULSI_WR)/third_party/protobuf/objectivec $(TULSI_WR)/_tulsi-includes/x/x/third_party/protobuf/objectivec $(TULSI_BWRS)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_j2objc/JavaLibrary $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul $(TULSI_BWRS)/third_party/protobuf/objectivec $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/protobuf/objectivec";
+				HEADER_SEARCH_PATHS = "$(inherited) $(TULSI_BWRS)/tools/cpp/gcc3 $(TULSI_WR)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_j2objc/JavaLibrary $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_WR)/third_party/java_src/j2objc/jre_emul $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul $(TULSI_WR)/third_party/protobuf/objectivec $(TULSI_WR)/_tulsi-includes/x/x/third_party/protobuf/objectivec $(TULSI_WR)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_generated_protos/ObjcProtos $(TULSI_BWRS)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_j2objc/JavaLibrary $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul $(TULSI_BWRS)/third_party/protobuf/objectivec $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/protobuf/objectivec $(TULSI_BWRS)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_generated_protos/ObjcProtos";
 				INFOPLIST_FILE = "${PROJECT_FILE_PATH}/.tulsi/Resources/StubInfoPlist.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 7.0;
 				PRODUCT_BUNDLE_IDENTIFIER = com.google.Tulsi.ApplicationTests;
@@ -962,7 +962,7 @@
 				BUNDLE_LOADER = "$(TEST_HOST)";
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1";
-				HEADER_SEARCH_PATHS = "$(inherited) $(TULSI_BWRS)/tools/cpp/gcc3 $(TULSI_WR)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_j2objc/JavaLibrary $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_WR)/third_party/java_src/j2objc/jre_emul $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul $(TULSI_WR)/third_party/protobuf/objectivec $(TULSI_WR)/_tulsi-includes/x/x/third_party/protobuf/objectivec $(TULSI_BWRS)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_j2objc/JavaLibrary $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul $(TULSI_BWRS)/third_party/protobuf/objectivec $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/protobuf/objectivec";
+				HEADER_SEARCH_PATHS = "$(inherited) $(TULSI_BWRS)/tools/cpp/gcc3 $(TULSI_WR)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_j2objc/JavaLibrary $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_WR)/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_WR)/third_party/java_src/j2objc/jre_emul $(TULSI_WR)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul $(TULSI_WR)/third_party/protobuf/objectivec $(TULSI_WR)/_tulsi-includes/x/x/third_party/protobuf/objectivec $(TULSI_WR)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_generated_protos/ObjcProtos $(TULSI_BWRS)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_j2objc/JavaLibrary $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/Classes $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/libcore/luni/src/main/native $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/android/platform/libcore/ojluni/src/main/native $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul/apple_apsl $(TULSI_BWRS)/third_party/java_src/j2objc/jre_emul $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/java_src/j2objc/jre_emul $(TULSI_BWRS)/third_party/protobuf/objectivec $(TULSI_BWRS)/_tulsi-includes/x/x/third_party/protobuf/objectivec $(TULSI_BWRS)/_tulsi-includes/x/x/tulsi_e2e_simple_skylark/_generated_protos/ObjcProtos";
 				INFOPLIST_FILE = "${PROJECT_FILE_PATH}/.tulsi/Resources/StubInfoPlist.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 7.0;
 				PRODUCT_BUNDLE_IDENTIFIER = com.google.Tulsi.ApplicationTests;
diff --git a/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/TestSuiteExplicitXCTestsProject.xcodeproj/project.pbxproj b/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/TestSuiteExplicitXCTestsProject.xcodeproj/project.pbxproj
index cc8f5c6..de32121 100644
--- a/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/TestSuiteExplicitXCTestsProject.xcodeproj/project.pbxproj
+++ b/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/TestSuiteExplicitXCTestsProject.xcodeproj/project.pbxproj
@@ -438,8 +438,8 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 0;
 			files = (
-				E6AF4947D835DF2200000000 /* XCTest.m in One */,
 				E6AF4947CFB68C6700000000 /* memleaks.m in memleaks */,
+				E6AF4947D835DF2200000000 /* XCTest.m in One */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -447,8 +447,8 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 0;
 			files = (
-				E6AF4947E8EE103A00000000 /* XCTest.m in Two */,
 				E6AF4947CFB68C6700000001 /* memleaks.m in memleaks */,
+				E6AF4947E8EE103A00000000 /* XCTest.m in Two */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -456,8 +456,8 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 0;
 			files = (
-				E6AF494730D2727A00000000 /* XCTest.m in Three */,
 				E6AF4947CFB68C6700000002 /* memleaks.m in memleaks */,
+				E6AF494730D2727A00000000 /* XCTest.m in Three */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -465,8 +465,8 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 0;
 			files = (
-				E6AF49478021770E00000000 /* LogicTest.m in One */,
 				E6AF4947CFB68C6700000003 /* memleaks.m in memleaks */,
+				E6AF49478021770E00000000 /* LogicTest.m in One */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/TestSuiteLocalTaggedTestsProject.xcodeproj/project.pbxproj b/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/TestSuiteLocalTaggedTestsProject.xcodeproj/project.pbxproj
index 116ee8c..a97a32e 100644
--- a/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/TestSuiteLocalTaggedTestsProject.xcodeproj/project.pbxproj
+++ b/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/TestSuiteLocalTaggedTestsProject.xcodeproj/project.pbxproj
@@ -291,8 +291,8 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 0;
 			files = (
-				E6AF4947E1F52E9200000000 /* TestSuiteXCTest.m in TestSuite */,
 				E6AF4947CFB68C6700000000 /* memleaks.m in memleaks */,
+				E6AF4947E1F52E9200000000 /* TestSuiteXCTest.m in TestSuite */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/TestSuiteRecursiveTestSuiteProject.xcodeproj/project.pbxproj b/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/TestSuiteRecursiveTestSuiteProject.xcodeproj/project.pbxproj
index 2342675..e8a0701 100644
--- a/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/TestSuiteRecursiveTestSuiteProject.xcodeproj/project.pbxproj
+++ b/src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/TestSuiteRecursiveTestSuiteProject.xcodeproj/project.pbxproj
@@ -387,8 +387,8 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 0;
 			files = (
-				E6AF4947E1F52E9200000000 /* TestSuiteXCTest.m in TestSuite */,
 				E6AF4947CFB68C6700000000 /* memleaks.m in memleaks */,
+				E6AF4947E1F52E9200000000 /* TestSuiteXCTest.m in TestSuite */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -405,8 +405,8 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 0;
 			files = (
-				E6AF494728386DC200000000 /* tagged_xctest_1.m in Three */,
 				E6AF4947CFB68C6700000002 /* memleaks.m in memleaks */,
+				E6AF494728386DC200000000 /* tagged_xctest_1.m in Three */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/src/TulsiGeneratorTests/PBXTargetGeneratorTests.swift b/src/TulsiGeneratorTests/PBXTargetGeneratorTests.swift
index ac8e43f..f01053d 100644
--- a/src/TulsiGeneratorTests/PBXTargetGeneratorTests.swift
+++ b/src/TulsiGeneratorTests/PBXTargetGeneratorTests.swift
@@ -487,6 +487,7 @@
           "BAZEL_TARGET": "test/testbundle:TestBundle",
           "BUNDLE_LOADER": "$(TEST_HOST)",
           "DEBUG_INFORMATION_FORMAT": "dwarf",
+          "HEADER_SEARCH_PATHS": "$(inherited) $(TULSI_BWRS)/tools/cpp/gcc3",
           "INFOPLIST_FILE": stubPlistPaths.defaultStub,
           "IPHONEOS_DEPLOYMENT_TARGET": "8.0",
           "PRODUCT_NAME": rule2TargetName,
@@ -601,6 +602,7 @@
         "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME": "Stub Launch Image",
         "BAZEL_TARGET": "test/testbundle:TestBundle",
         "DEBUG_INFORMATION_FORMAT": "dwarf",
+        "HEADER_SEARCH_PATHS": "$(inherited) $(TULSI_BWRS)/tools/cpp/gcc3",
         "INFOPLIST_FILE": stubPlistPaths.defaultStub,
         "IPHONEOS_DEPLOYMENT_TARGET": "8.0",
         "PRODUCT_NAME": rule2TargetName,
@@ -721,6 +723,7 @@
         "BAZEL_TARGET": "test/testbundle:TestBundle",
         "BUNDLE_LOADER": "$(TEST_HOST)",
         "DEBUG_INFORMATION_FORMAT": "dwarf",
+        "HEADER_SEARCH_PATHS": "$(inherited) $(TULSI_BWRS)/tools/cpp/gcc3",
         "INFOPLIST_FILE": stubPlistPaths.defaultStub,
         "MACOSX_DEPLOYMENT_TARGET": "10.11",
         "PRODUCT_NAME": rule2TargetName,
@@ -840,6 +843,7 @@
         "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME": "Stub Launch Image",
         "BAZEL_TARGET": "test/testbundle:TestBundle",
         "DEBUG_INFORMATION_FORMAT": "dwarf",
+        "HEADER_SEARCH_PATHS": "$(inherited) $(TULSI_BWRS)/tools/cpp/gcc3",
         "INFOPLIST_FILE": stubPlistPaths.defaultStub,
         "MACOSX_DEPLOYMENT_TARGET": "10.11",
         "PRODUCT_NAME": rule2TargetName,
@@ -909,6 +913,7 @@
         "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME": "Stub Launch Image",
         "BAZEL_TARGET": "test/testbundle:TestBundle",
         "DEBUG_INFORMATION_FORMAT": "dwarf",
+        "HEADER_SEARCH_PATHS": "$(inherited) $(TULSI_BWRS)/tools/cpp/gcc3",
         "INFOPLIST_FILE": stubPlistPaths.defaultStub,
         "MACOSX_DEPLOYMENT_TARGET": "10.11",
         "PRODUCT_NAME": rule1TargetName,
@@ -979,6 +984,7 @@
         "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME": "Stub Launch Image",
         "BAZEL_TARGET": "test/testbundle:TestBundle",
         "DEBUG_INFORMATION_FORMAT": "dwarf",
+        "HEADER_SEARCH_PATHS": "$(inherited) $(TULSI_BWRS)/tools/cpp/gcc3",
         "INFOPLIST_FILE": stubPlistPaths.defaultStub,
         "MACOSX_DEPLOYMENT_TARGET": "10.11",
         "PRODUCT_NAME": rule1TargetName,
@@ -1099,6 +1105,7 @@
           "BAZEL_TARGET": "test/testbundle:Tests",
           "BUNDLE_LOADER": "$(TEST_HOST)",
           "DEBUG_INFORMATION_FORMAT": "dwarf",
+          "HEADER_SEARCH_PATHS": "$(inherited) $(TULSI_BWRS)/tools/cpp/gcc3",
           "INFOPLIST_FILE": stubPlistPaths.defaultStub,
           "IPHONEOS_DEPLOYMENT_TARGET": "8.0",
           "PRODUCT_NAME": testRuleTargetName,
@@ -1160,6 +1167,7 @@
       type: "\(testRuleType)",
       attributes: ["test_bundle": testBundleRuleEntry.label.value as AnyObject,
                    "test_host": testHostRuleEntry.label.value as AnyObject],
+      sourceFiles: testSources,
       productType: .UnitTest,
       platformType: "ios",
       osDeploymentTarget: "8.0")
@@ -1245,8 +1253,10 @@
                                               type: "ios_application", productType: .Application)
     let testRuleEntry = makeTestRuleEntry("\(testRulePackage):\(testRuleTargetName)",
                                           type: "\(testRuleType)",
-                                          attributes: ["test_bundle": testBundleRuleEntry.label.value as AnyObject,
+                                          attributes: ["has_swift_dependency": true as AnyObject,
+                                                       "test_bundle": testBundleRuleEntry.label.value as AnyObject,
                                                        "test_host": testHostRuleEntry.label.value as AnyObject],
+                                          sourceFiles: testSources,
                                           productType: .UnitTest,
                                           platformType: "ios",
                                           osDeploymentTarget: "8.0")
@@ -1281,7 +1291,7 @@
       "TEST_HOST": "$(BUILT_PRODUCTS_DIR)/\(testHostTargetName).app/\(testHostTargetName)",
       "TULSI_BUILD_PATH": testRulePackage,
       "TULSI_BUILD_WITHOUT_SPOTLIGHT_AT_MY_OWN_RISK": "NO",
-      "TULSI_MUST_USE_DSYM": "NO",
+      "TULSI_MUST_USE_DSYM": "YES",
       "TULSI_TEST_RUNNER_ONLY": "YES",
       ]
     let expectedTarget = TargetDefinition(
@@ -1398,6 +1408,7 @@
         "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME": "Stub Launch Image",
         "BAZEL_TARGET": "test/testbundle:TestBundle",
         "DEBUG_INFORMATION_FORMAT": "dwarf",
+        "HEADER_SEARCH_PATHS": "$(inherited) $(TULSI_BWRS)/tools/cpp/gcc3",
         "INFOPLIST_FILE": stubPlistPaths.defaultStub,
         "IPHONEOS_DEPLOYMENT_TARGET": "8.0",
         "PRODUCT_NAME": testRuleTargetName,