mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
StdlibUnittest: run tests out of process
The test harness now can recover after test crashes, allowing: - check for crashes themselves (without reporting them to the Python lit driver, which is about 10x slower -- even if CrashTracer is disabled); - recover from unexpected test crashes and run the rest of the tests; - this lays the groundwork for assertions that end the test execution, but allow the rest of the tests to run (rdar://17906801). Note that we don't spawn a fresh process for every test. We create a child process and reuse it until it crashes. Swift SVN r21090
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// RUN: rm -rf %t
|
||||
// RUN: mkdir -p %t
|
||||
// RUN: %target-build-swift -module-cache-path %t/clang-module-cache %s -o %t/a.out
|
||||
// RUN: %target-run %t/a.out %S/Inputs/NSStringAPI_test.txt | FileCheck %s
|
||||
// RUN: %target-run %t/a.out
|
||||
|
||||
//
|
||||
// Tests for the NSString APIs as exposed by String
|
||||
@@ -72,7 +72,8 @@ NSStringAPIs.test("pathWithComponents(_:)") {
|
||||
String.pathWithComponents(["flugelhorn", "baritone", "bass"]))
|
||||
}
|
||||
|
||||
var existingPath = Process.arguments[1]
|
||||
// FIXME: creating a temporary file would be better.
|
||||
var existingPath = (String(__FILE__) + "/../Inputs/NSStringAPI_test.txt").stringByStandardizingPath
|
||||
var nonExistentPath = existingPath + "-NoNeXiStEnT"
|
||||
|
||||
NSStringAPIs.test("stringWithContentsOfFile(_:encoding:error:)") {
|
||||
@@ -1594,9 +1595,6 @@ NSStringAPIs.test("uppercaseString") {
|
||||
expectEqual("\u{0046}\u{0049}", "\u{fb01}".uppercaseString)
|
||||
}
|
||||
|
||||
NSStringAPIs.run()
|
||||
// CHECK: NSStringAPIs: All tests passed
|
||||
|
||||
var CStringTests = TestCase("CStringTests")
|
||||
|
||||
func getNullCString() -> UnsafeMutablePointer<CChar> {
|
||||
@@ -1699,5 +1697,5 @@ CStringTests.test("String.fromCStringRepairingIllFormedUTF8") {
|
||||
}
|
||||
}
|
||||
|
||||
CStringTests.run()
|
||||
// CHECK: {{^}}CStringTests: All tests passed
|
||||
runAllTests()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user