Add a test to check if we can run swift-test on a complex package
diff --git a/lit.cfg b/lit.cfg
index 3046c5e..5c2c512 100644
--- a/lit.cfg
+++ b/lit.cfg
@@ -186,6 +186,14 @@
 config.substitutions.append( ('%{swiftc}', swiftc_path) )
 config.substitutions.append( ('%{FileCheck}', filecheck_path) )
 
+# Add a substitution for swiftpm build directory. This is useful for
+# running the integration tests locally, for e.g. by changing:
+# %{swift} build -> %{swiftpm_build}/swift-build
+swiftpm_build = lit_config.params.get("swiftpm-build")
+if swiftpm_build is not None:
+    config.substitutions.append( ('%{swiftpm_build}', swiftpm_build) )
+    lit_config.note("testing using swiftpm build directory: {}".format(swiftpm_build))
+
 ###
 
 # Protected against unquoted use of substitutions.
diff --git a/test-complex-xctest-package/SwiftCMixed/.gitignore b/test-complex-xctest-package/SwiftCMixed/.gitignore
new file mode 100644
index 0000000..02c0875
--- /dev/null
+++ b/test-complex-xctest-package/SwiftCMixed/.gitignore
@@ -0,0 +1,4 @@
+.DS_Store
+/.build
+/Packages
+/*.xcodeproj
diff --git a/test-complex-xctest-package/SwiftCMixed/Package.swift b/test-complex-xctest-package/SwiftCMixed/Package.swift
new file mode 100644
index 0000000..6ae4c7e
--- /dev/null
+++ b/test-complex-xctest-package/SwiftCMixed/Package.swift
@@ -0,0 +1,8 @@
+import PackageDescription
+
+let package = Package(
+    name: "SwiftCMixed",
+    targets: [
+        Target(name: "swifty", dependencies: ["see"]),
+    ]
+)
diff --git a/test-complex-xctest-package/SwiftCMixed/Sources/see/include/module.modulemap b/test-complex-xctest-package/SwiftCMixed/Sources/see/include/module.modulemap
new file mode 100644
index 0000000..1c2c41d
--- /dev/null
+++ b/test-complex-xctest-package/SwiftCMixed/Sources/see/include/module.modulemap
@@ -0,0 +1,4 @@
+module see {
+    umbrella header "see.h"
+    export *
+}
diff --git a/test-complex-xctest-package/SwiftCMixed/Sources/see/include/see.h b/test-complex-xctest-package/SwiftCMixed/Sources/see/include/see.h
new file mode 100644
index 0000000..5d5f8f0
--- /dev/null
+++ b/test-complex-xctest-package/SwiftCMixed/Sources/see/include/see.h
@@ -0,0 +1 @@
+int foo();
diff --git a/test-complex-xctest-package/SwiftCMixed/Sources/see/see.c b/test-complex-xctest-package/SwiftCMixed/Sources/see/see.c
new file mode 100644
index 0000000..56a6706
--- /dev/null
+++ b/test-complex-xctest-package/SwiftCMixed/Sources/see/see.c
@@ -0,0 +1,5 @@
+#include "see.h"
+
+int foo() {
+    return 5;
+}
diff --git a/test-complex-xctest-package/SwiftCMixed/Sources/swifty/swifty.swift b/test-complex-xctest-package/SwiftCMixed/Sources/swifty/swifty.swift
new file mode 100644
index 0000000..8abf1ec
--- /dev/null
+++ b/test-complex-xctest-package/SwiftCMixed/Sources/swifty/swifty.swift
@@ -0,0 +1,5 @@
+import see
+
+func swiftyFoo() -> Int {
+    return Int(foo())
+}
diff --git a/test-complex-xctest-package/SwiftCMixed/Tests/LinuxMain.swift b/test-complex-xctest-package/SwiftCMixed/Tests/LinuxMain.swift
new file mode 100644
index 0000000..04f8caf
--- /dev/null
+++ b/test-complex-xctest-package/SwiftCMixed/Tests/LinuxMain.swift
@@ -0,0 +1,6 @@
+import XCTest
+@testable import swiftyTests
+
+XCTMain([
+    testCase(SwiftyTests.allTests),
+])
diff --git a/test-complex-xctest-package/SwiftCMixed/Tests/swiftyTests/swiftyTests.swift b/test-complex-xctest-package/SwiftCMixed/Tests/swiftyTests/swiftyTests.swift
new file mode 100644
index 0000000..f1bd561
--- /dev/null
+++ b/test-complex-xctest-package/SwiftCMixed/Tests/swiftyTests/swiftyTests.swift
@@ -0,0 +1,13 @@
+import XCTest
+@testable import swifty
+
+class SwiftyTests: XCTestCase {
+
+    func testSwiftyFoo() {
+        XCTAssertEqual(swiftyFoo(), 5)
+    }
+
+    static var allTests = [
+        ("testSwiftyFoo", testSwiftyFoo),
+    ]
+}
diff --git a/test-complex-xctest-package/test-xctest-package.txt b/test-complex-xctest-package/test-xctest-package.txt
new file mode 100644
index 0000000..11c6997
--- /dev/null
+++ b/test-complex-xctest-package/test-xctest-package.txt
@@ -0,0 +1,15 @@
+// Check if test modules can import Swift modules which depend on C module.
+//
+// Make a sandbox dir.
+// RUN: rm -rf %t.dir
+// RUN: mkdir -p %t.dir
+// RUN: cp -r %S/SwiftCMixed %t.dir/
+// RUN: %{swift} test --chdir %t.dir/SwiftCMixed -v 2>&1 | tee %t.build-log
+//
+// Check the build log.
+//
+// RUN: %{FileCheck} --check-prefix CHECK-BUILD-LOG --input-file %t.build-log %s
+//
+// CHECK-BUILD-LOG: swiftc{{.*}} -module-name SwiftCMixedPackageTests
+// CHECK-BUILD-LOG: testSwiftyFoo{{.*}} passed
+// CHECK-BUILD-LOG: 'SwiftyTests' passed