Skip to content

Commit 0831240

Browse files
committed
tests: disable COW checking by default, and enable it for specific tests
COW checking needs that all libraries are consistently compiled with asserts enabled. This is not the case for the Foundation overlay anymore. Therefore it does not work with some tests which interop with Foundation. The solution here is to disable COW checking by default, but enable it for Array tests which do not interop with Foundation.
1 parent 2f2c132 commit 0831240

20 files changed

+27
-22
lines changed

test/lit.cfg

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2186,6 +2186,13 @@ config.substitutions.append(('%raw-FileCheck', shell_quote(config.filecheck)))
21862186
config.substitutions.append(('%import-libdispatch', getattr(config, 'import_libdispatch', '')))
21872187
config.substitutions.append(('%import-static-libdispatch', getattr(config, 'import_libdispatch_static', '')))
21882188

2189+
# Disabe COW sanity checks in the swift runtime by default.
2190+
# (But it's required to set this environment variable to something)
2191+
config.environment['SWIFT_DEBUG_ENABLE_COW_CHECKS'] = 'false'
2192+
2193+
# Add this to the command which runs an executable to enable COW checks in the swift runtime.
2194+
config.substitutions.append(('%enable-cow-checking', TARGET_ENV_PREFIX + 'SWIFT_DEBUG_ENABLE_COW_CHECKS=true;'))
2195+
21892196
if config.lldb_build_root != "":
21902197
lldb_python_path = get_lldb_python_path(config.lldb_build_root)
21912198
lldb_python_interpreter = get_lldb_python_interpreter(config.lldb_build_root)
@@ -2210,9 +2217,6 @@ config.environment[TARGET_ENV_PREFIX + 'SWIFT_DETERMINISTIC_HASHING'] = '1'
22102217
# Enable malloc scribble during tests by default.
22112218
config.environment[TARGET_ENV_PREFIX + 'SWIFT_DEBUG_ENABLE_MALLOC_SCRIBBLE'] = 'YES'
22122219

2213-
# Enable COW sanity checks in the swift runtime by default.
2214-
config.environment['SWIFT_DEBUG_ENABLE_COW_CHECKS'] = 'true'
2215-
22162220
# Run lsb_release on the target to be tested and return the results.
22172221
def linux_get_lsb_release():
22182222
lsb_release_path = '/usr/bin/lsb_release'

validation-test/stdlib/Array.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-run-simple-swiftgyb
1+
// RUN: %enable-cow-checking %target-run-simple-swiftgyb
22
// REQUIRES: executable_test
33

44
import StdlibUnittest

validation-test/stdlib/Array/ArraySliceWithNonZeroStartIndex_MutableRandomAccessCollectionRef.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Do Not Edit Directly!
44
//===----------------------------------------------------------------------===//
55

6-
// RUN: %target-run-simple-swift
6+
// RUN: %enable-cow-checking %target-run-simple-swift
77
// REQUIRES: executable_test
88
// REQUIRES: optimized_stdlib
99

validation-test/stdlib/Array/ArraySliceWithNonZeroStartIndex_MutableRandomAccessCollectionVal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Do Not Edit Directly!
44
//===----------------------------------------------------------------------===//
55

6-
// RUN: %target-run-simple-swift
6+
// RUN: %enable-cow-checking %target-run-simple-swift
77
// REQUIRES: executable_test
88
// REQUIRES: optimized_stdlib
99

validation-test/stdlib/Array/ArraySliceWithNonZeroStartIndex_RangeReplaceableRandomAccessCollectionRef.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Do Not Edit Directly!
44
//===----------------------------------------------------------------------===//
55

6-
// RUN: %target-run-simple-swift
6+
// RUN: %enable-cow-checking %target-run-simple-swift
77
// REQUIRES: executable_test
88
// REQUIRES: optimized_stdlib
99

validation-test/stdlib/Array/ArraySliceWithNonZeroStartIndex_RangeReplaceableRandomAccessCollectionVal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Do Not Edit Directly!
44
//===----------------------------------------------------------------------===//
55

6-
// RUN: %target-run-simple-swift
6+
// RUN: %enable-cow-checking %target-run-simple-swift
77
// REQUIRES: executable_test
88
// REQUIRES: optimized_stdlib
99

validation-test/stdlib/Array/ArraySlice_MutableRandomAccessCollectionRef.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Do Not Edit Directly!
44
//===----------------------------------------------------------------------===//
55

6-
// RUN: %target-run-simple-swift
6+
// RUN: %enable-cow-checking %target-run-simple-swift
77
// REQUIRES: executable_test
88
// REQUIRES: optimized_stdlib
99

validation-test/stdlib/Array/ArraySlice_MutableRandomAccessCollectionVal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Do Not Edit Directly!
44
//===----------------------------------------------------------------------===//
55

6-
// RUN: %target-run-simple-swift
6+
// RUN: %enable-cow-checking %target-run-simple-swift
77
// REQUIRES: executable_test
88
// REQUIRES: optimized_stdlib
99

validation-test/stdlib/Array/ArraySlice_RangeReplaceableRandomAccessCollectionRef.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Do Not Edit Directly!
44
//===----------------------------------------------------------------------===//
55

6-
// RUN: %target-run-simple-swift
6+
// RUN: %enable-cow-checking %target-run-simple-swift
77
// REQUIRES: executable_test
88
// REQUIRES: optimized_stdlib
99

validation-test/stdlib/Array/ArraySlice_RangeReplaceableRandomAccessCollectionVal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Do Not Edit Directly!
44
//===----------------------------------------------------------------------===//
55

6-
// RUN: %target-run-simple-swift
6+
// RUN: %enable-cow-checking %target-run-simple-swift
77
// REQUIRES: executable_test
88
// REQUIRES: optimized_stdlib
99

validation-test/stdlib/Array/Array_MutableRandomAccessCollectionRef.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Do Not Edit Directly!
44
//===----------------------------------------------------------------------===//
55

6-
// RUN: %target-run-simple-swift
6+
// RUN: %enable-cow-checking %target-run-simple-swift
77
// REQUIRES: executable_test
88
// REQUIRES: optimized_stdlib
99

validation-test/stdlib/Array/Array_MutableRandomAccessCollectionVal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Do Not Edit Directly!
44
//===----------------------------------------------------------------------===//
55

6-
// RUN: %target-run-simple-swift
6+
// RUN: %enable-cow-checking %target-run-simple-swift
77
// REQUIRES: executable_test
88
// REQUIRES: optimized_stdlib
99

validation-test/stdlib/Array/Array_RangeReplaceableRandomAccessCollectionRef.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Do Not Edit Directly!
44
//===----------------------------------------------------------------------===//
55

6-
// RUN: %target-run-simple-swift
6+
// RUN: %enable-cow-checking %target-run-simple-swift
77
// REQUIRES: executable_test
88
// REQUIRES: optimized_stdlib
99

validation-test/stdlib/Array/Array_RangeReplaceableRandomAccessCollectionVal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Do Not Edit Directly!
44
//===----------------------------------------------------------------------===//
55

6-
// RUN: %target-run-simple-swift
6+
// RUN: %enable-cow-checking %target-run-simple-swift
77
// REQUIRES: executable_test
88
// REQUIRES: optimized_stdlib
99

validation-test/stdlib/Array/ContiguousArray_MutableRandomAccessCollectionRef.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Do Not Edit Directly!
44
//===----------------------------------------------------------------------===//
55

6-
// RUN: %target-run-simple-swift
6+
// RUN: %enable-cow-checking %target-run-simple-swift
77
// REQUIRES: executable_test
88
// REQUIRES: optimized_stdlib
99

validation-test/stdlib/Array/ContiguousArray_MutableRandomAccessCollectionVal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Do Not Edit Directly!
44
//===----------------------------------------------------------------------===//
55

6-
// RUN: %target-run-simple-swift
6+
// RUN: %enable-cow-checking %target-run-simple-swift
77
// REQUIRES: executable_test
88
// REQUIRES: optimized_stdlib
99

validation-test/stdlib/Array/ContiguousArray_RangeReplaceableRandomAccessCollectionRef.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Do Not Edit Directly!
44
//===----------------------------------------------------------------------===//
55

6-
// RUN: %target-run-simple-swift
6+
// RUN: %enable-cow-checking %target-run-simple-swift
77
// REQUIRES: executable_test
88
// REQUIRES: optimized_stdlib
99

validation-test/stdlib/Array/ContiguousArray_RangeReplaceableRandomAccessCollectionVal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Do Not Edit Directly!
44
//===----------------------------------------------------------------------===//
55

6-
// RUN: %target-run-simple-swift
6+
// RUN: %enable-cow-checking %target-run-simple-swift
77
// REQUIRES: executable_test
88
// REQUIRES: optimized_stdlib
99

validation-test/stdlib/Array/Inputs/ArrayConformanceTests.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// Do Not Edit Directly!
2424
//===----------------------------------------------------------------------===//
2525

26-
// RUN: %target-run-simple-swift
26+
// RUN: %enable-cow-checking %target-run-simple-swift
2727
// REQUIRES: executable_test
2828
// REQUIRES: optimized_stdlib
2929

validation-test/stdlib/Arrays.swift.gyb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
// RUN: %target-clang -fobjc-arc %S/Inputs/SlurpFastEnumeration/SlurpFastEnumeration.m -c -o %t/SlurpFastEnumeration.o
55
// RUN: %line-directive %t/main.swift -- %target-build-swift %t/main.swift %S/Inputs/DictionaryKeyValueTypes.swift -I %S/Inputs/SlurpFastEnumeration/ -Xlinker %t/SlurpFastEnumeration.o -o %t/Arrays -Xfrontend -disable-access-control
66
//
7-
// RUN: %target-codesign %t/Arrays && %line-directive %t/main.swift -- %target-run %t/Arrays
7+
// RUN: %target-codesign %t/Arrays
8+
// RUN: %enable-cow-checking %line-directive %t/main.swift -- %target-run %t/Arrays
89
// REQUIRES: executable_test
910

1011
import Swift

0 commit comments

Comments
 (0)