Merge pull request #219 from stmontgomery/expectationForPredicate-nilObject

Make NSPredicate expectation constructor API accept nil `object`
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0630a2c..0bed793 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -94,6 +94,20 @@
                     -I${XCTEST_PATH_TO_FOUNDATION_BUILD}/Foundation
                     -I${XCTEST_PATH_TO_FOUNDATION_BUILD}/Foundation/usr/lib/swift)
 
+# Temporary staging; the various swift projects that depend on XCTest all expect
+# the swiftdoc and swiftmodule to be in the top level.
+# So for now, make a copy so we don't have to do a coordinated commit across
+# all the swift projects to change this assumption.
+add_custom_target(TARGET
+                    XCTest
+                  POST_BUILD
+                  COMMAND
+                    ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/swift/XCTest.swiftdoc ${CMAKE_CURRENT_BINARY_DIR}
+                  COMMAND
+                    ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/swift/XCTest.swiftmodule ${CMAKE_CURRENT_BINARY_DIR}
+                  COMMENT
+                    "Copying swiftmodule/swiftdoc to build directory")
+
 if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
   set(LIT_COMMAND "${PYTHON_EXECUTABLE};${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py"
       CACHE STRING "command used to spawn llvm-lit")
diff --git a/Sources/XCTest/Public/XCTAssert.swift b/Sources/XCTest/Public/XCTAssert.swift
index f16b10b..eaa0733 100644
--- a/Sources/XCTest/Public/XCTAssert.swift
+++ b/Sources/XCTest/Public/XCTAssert.swift
@@ -306,7 +306,7 @@
     }
 }
 
-public func XCTAssertThrowsError<T>(_ expression: @autoclosure () throws -> T, _ message: String = "", file: StaticString = #file, line: UInt = #line, _ errorHandler: (_ error: Swift.Error) -> Void = { _ in }) {
+public func XCTAssertThrowsError<T>(_ expression: @autoclosure () throws -> T, _ message: @autoclosure () -> String = "", file: StaticString = #file, line: UInt = #line, _ errorHandler: (_ error: Swift.Error) -> Void = { _ in }) {
     _XCTEvaluateAssertion(.throwsError, message: message, file: file, line: line) {
         var caughtErrorOptional: Swift.Error?
         do {
diff --git a/Sources/XCTest/Public/XCTestCase+Performance.swift b/Sources/XCTest/Public/XCTestCase+Performance.swift
index 28b736c..88f4df2 100644
--- a/Sources/XCTest/Public/XCTestCase+Performance.swift
+++ b/Sources/XCTest/Public/XCTestCase+Performance.swift
@@ -33,7 +33,7 @@
 
 public extension XCTPerformanceMetric {
     /// Records wall clock time in seconds between `startMeasuring`/`stopMeasuring`.
-    public static let wallClockTime = XCTPerformanceMetric(rawValue: WallClockTimeMetric.name)
+    static let wallClockTime = XCTPerformanceMetric(rawValue: WallClockTimeMetric.name)
 }
 
 /// The following methods are called from within a test method to carry out 
diff --git a/Sources/XCTest/Public/XCTestErrors.swift b/Sources/XCTest/Public/XCTestErrors.swift
index 18014a4..a18af0a 100644
--- a/Sources/XCTest/Public/XCTestErrors.swift
+++ b/Sources/XCTest/Public/XCTestErrors.swift
@@ -36,10 +36,10 @@
 public extension XCTestError {
     /// Indicates that one or more expectations failed to be fulfilled in time
     /// during a call to `waitForExpectations(timeout:handler:)`
-    public static var timeoutWhileWaiting: XCTestError.Code { return .timeoutWhileWaiting }
+    static var timeoutWhileWaiting: XCTestError.Code { return .timeoutWhileWaiting }
 
     /// Indicates that a test assertion failed while waiting for expectations
     /// during a call to `waitForExpectations(timeout:handler:)`
     /// FIXME: swift-corelibs-xctest does not currently produce this error code.
-    public static var failureWhileWaiting: XCTestError.Code { return .failureWhileWaiting }
+    static var failureWhileWaiting: XCTestError.Code { return .failureWhileWaiting }
 }