From cd309d5a1ff01b077fc0fa2e6e70a44ebe3d2f49 Mon Sep 17 00:00:00 2001 From: Karoy Lorentey Date: Tue, 20 Jan 2026 10:52:06 -0800 Subject: [PATCH] Speed up testing by default --- Package.swift | 5 ++++- Package@swift-6.0.swift | 3 +++ .../TreeHashedCollections Fixtures.swift | 2 ++ Tests/RopeModuleTests/SampleStrings.swift | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 623b46e4..3c7c5a57 100644 --- a/Package.swift +++ b/Package.swift @@ -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 = [ diff --git a/Package@swift-6.0.swift b/Package@swift-6.0.swift index 30c7fde3..701b2265 100644 --- a/Package@swift-6.0.swift +++ b/Package@swift-6.0.swift @@ -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 = [ diff --git a/Tests/HashTreeCollectionsTests/TreeHashedCollections Fixtures.swift b/Tests/HashTreeCollectionsTests/TreeHashedCollections Fixtures.swift index c61dc868..e993d291 100644 --- a/Tests/HashTreeCollectionsTests/TreeHashedCollections Fixtures.swift +++ b/Tests/HashTreeCollectionsTests/TreeHashedCollections Fixtures.swift @@ -30,6 +30,7 @@ let testItems: [RawCollider] = { RawCollider(5, "ACAD"), RawCollider(6, "ACAD"), ] +#if COLLECTIONS_LONG_TESTS if MemoryLayout.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 }() diff --git a/Tests/RopeModuleTests/SampleStrings.swift b/Tests/RopeModuleTests/SampleStrings.swift index f0da1454..f1e73286 100644 --- a/Tests/RopeModuleTests/SampleStrings.swift +++ b/Tests/RopeModuleTests/SampleStrings.swift @@ -61,6 +61,7 @@ let sampleString: String = { 馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘馃嚭馃嚫馃嚚馃嚘 """# + #if COLLECTIONS_LONG_TESTS if MemoryLayout.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 }()