[xcode] Fix running XCTests and XCUITests with New Build System

A hack was used to allow Xcode to associate source files with the
test module and correctly find the list of tests without builing
the app first.

This hack breaks when using the New Build System as Xcode tries to
build those files and complains about missing output files. As it
prevents from running the tests, disable the hack when using the
New Build System.

Bug: chromium:1103230
Change-Id: I70e3b359af4f27a2a3af8bd2a339187e1b9d916c
Reviewed-on: https://gn-review.googlesource.com/c/gn/+/9300
Reviewed-by: Brett Wilson <brettw@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
diff --git a/src/gn/xcode_writer.cc b/src/gn/xcode_writer.cc
index 0060545..44f0c25 100644
--- a/src/gn/xcode_writer.cc
+++ b/src/gn/xcode_writer.cc
@@ -776,6 +776,12 @@
 bool XcodeProject::AddCXTestSourceFilesForTestModuleTargets(
     const std::map<const Target*, PBXNativeTarget*>& bundle_targets,
     Err* err) {
+  // With the New Build System, the hack of calling clang with --help to get
+  // Xcode to see and parse the file without building them no longer work so
+  // disable it for the moment. See https://crbug.com/1103230 for details.
+  if (options_.build_system == XcodeBuildSystem::kNew)
+    return true;
+
   const SourceDir source_dir("//");
 
   // Needs to search for xctest files under the application targets, and this