Speed up testing by default

This commit is contained in:
Karoy Lorentey committed 2026-01-20 10:54:31 -08:00
1 parent 7b5221ea24
commit cd309d5a1f
4 files changed
+11 -1

No files matched your search

+4 -1
View File
@@ -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> = [
+3
View File
@@ -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
}()