mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[test] Hack: run stdlib tests first to start long-running tests earlier.
This decreases total testing time by over a minute on my old Mac Pro. It probably has much less effect on systems with fewer cores, but shouldn't be any worse there. Swift SVN r22745
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
// RUN: %target-run-simple-swift | FileCheck %s
|
||||
|
||||
// CHECK-NOT: Reallocations exceeded 30
|
||||
func testReallocation() {
|
||||
var x = "The quick brown fox jumped over the lazy dog\n"._split(" ")
|
||||
|
||||
var story = "Let me tell you a story:"
|
||||
var laps = 1000
|
||||
|
||||
var reallocations = 0
|
||||
for i in 0..<laps {
|
||||
for s in x {
|
||||
var lastBase = story._core._baseAddress
|
||||
story += " "
|
||||
story += s
|
||||
if lastBase != story._core._baseAddress {
|
||||
++reallocations
|
||||
|
||||
// To avoid dumping a vast string here, just write the first
|
||||
// part of the story out each time there's a reallocation.
|
||||
var intro = story._split(":")[0]
|
||||
println("reallocation \(reallocations), with intro \(intro)")
|
||||
|
||||
if reallocations >= 30 {
|
||||
println("Reallocations exceeded 30")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
story += "."
|
||||
}
|
||||
println("total reallocations = \(reallocations)")
|
||||
}
|
||||
|
||||
testReallocation()
|
||||
println("done!")
|
||||
Reference in New Issue
Block a user