Skip to content

Commit 96e0cb4

Browse files
eecksteinshahmishal
authored andcommitted
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. (cherry picked from commit 0831240)
1 parent 703c354 commit 96e0cb4

20 files changed

+27
-22
lines changed

test/lit.cfg

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,6 +2128,13 @@ config.substitutions.append(('%FileCheck', run_filecheck))
21282128
config.substitutions.append(('%raw-FileCheck', shell_quote(config.filecheck)))
21292129
config.substitutions.append(('%import-libdispatch', getattr(config, 'import_libdispatch', '')))
21302130

2131+
# Disabe COW sanity checks in the swift runtime by default.
2132+
# (But it's required to set this environment variable to something)
2133+
config.environment['SWIFT_DEBUG_ENABLE_COW_CHECKS'] = 'false'
2134+
2135+
# Add this to the command which runs an executable to enable COW checks in the swift runtime.
2136+
config.substitutions.append(('%enable-cow-checking', TARGET_ENV_PREFIX + 'SWIFT_DEBUG_ENABLE_COW_CHECKS=true;'))
2137+
21312138
if config.lldb_build_root != "":
21322139
lldb_python_path = get_lldb_python_path(config.lldb_build_root)
21332140
lldb_python_interpreter = get_lldb_python_interpreter(config.lldb_build_root)
@@ -2152,9 +2159,6 @@ config.environment[TARGET_ENV_PREFIX + 'SWIFT_DETERMINISTIC_HASHING'] = '1'
21522159
# Enable malloc scribble during tests by default.
21532160
config.environment[TARGET_ENV_PREFIX + 'SWIFT_DEBUG_ENABLE_MALLOC_SCRIBBLE'] = 'YES'
21542161

2155-
# Enable COW sanity checks in the swift runtime by default.
2156-
config.environment['SWIFT_DEBUG_ENABLE_COW_CHECKS'] = 'true'
2157-
21582162
# Run lsb_release on the target to be tested and return the results.
21592163
def linux_get_lsb_release():
21602164
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)