mirror of
https://github.com/apple/swift-collections
synced 2026-11-25 04:37:48 +00:00
Speed up testing by default
This commit is contained in:
4 files changed
+11
-1
No files matched your search
+4
-1
@@ -79,7 +79,10 @@ var defines: [SwiftSetting] = [
|
||||
// This removes the distinct modules for each data structure, instead
|
||||
// putting them all directly into the `Collections` module.
|
||||
// Note: This is a source-incompatible variation of the default configuration.
|
||||
// "COLLECTIONS_SINGLE_MODULE",
|
||||
// .define("COLLECTIONS_SINGLE_MODULE"),
|
||||
|
||||
// Enables longer, more exhaustive tests.
|
||||
// .define("COLLECTIONS_LONG_TESTS"),
|
||||
]
|
||||
|
||||
let availabilityMacros: KeyValuePairs<String, String> = [
|
||||
|
||||
@@ -50,6 +50,9 @@ var defines: [String] = [
|
||||
// putting them all directly into the `Collections` module.
|
||||
// Note: This is a source-incompatible variation of the default configuration.
|
||||
// "COLLECTIONS_SINGLE_MODULE",
|
||||
|
||||
// Enables longer, more exhaustive tests.
|
||||
// "COLLECTIONS_LONG_TESTS",
|
||||
]
|
||||
|
||||
let availabilityMacros: KeyValuePairs<String, String> = [
|
||||
|
||||
@@ -30,6 +30,7 @@ let testItems: [RawCollider] = {
|
||||
RawCollider(5, "ACAD"),
|
||||
RawCollider(6, "ACAD"),
|
||||
]
|
||||
#if COLLECTIONS_LONG_TESTS
|
||||
if MemoryLayout<Int>.size == 8 {
|
||||
// Cut testing workload down a bit on 32-bit systems. In practice a 32-bit Int
|
||||
// usually means we're running on a watchOS device (arm64_32), and those are relatively slow
|
||||
@@ -47,6 +48,7 @@ let testItems: [RawCollider] = {
|
||||
RawCollider(12, "ACC"),
|
||||
]
|
||||
#endif
|
||||
#endif
|
||||
return testItems
|
||||
}()
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ let sampleString: String = {
|
||||
|
||||
🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦🇺🇸🇨🇦
|
||||
"""#
|
||||
#if COLLECTIONS_LONG_TESTS
|
||||
if MemoryLayout<Int>.size == 8 {
|
||||
/// Add even more flags and extra long combining sequences. This considerably increases test
|
||||
/// workload. (Not necessarily due to grapheme cluster length, but because test performance is
|
||||
@@ -78,6 +79,7 @@ let sampleString: String = {
|
||||
T̸h̴e̶ ̵p̷o̷w̶e̵r̷f̸u̷l̷ ̵p̴r̷o̷g̶r̷a̸m̸m̶i̸n̴g̴ ̷l̶a̴n̸g̵u̵a̶g̸e̶ ̸t̶h̴a̵t̵ ̶i̷s̶ ̵a̷l̴s̸o̷ ̵e̵a̷s̷y̴ ̵t̵o̷ ̷l̷e̶a̵r̴n̸.̵
|
||||
"""#
|
||||
}
|
||||
#endif
|
||||
return str
|
||||
}()
|
||||
|
||||
|
||||
Reference in new issue
Block a user