mirror of
https://github.com/apple/swift.git
synced 2026-02-27 18:26:24 +01:00
Every time DarwinSDKInfo reads a new key out of SDKSettings, a boatload of test SDKSettings files need to be updated across several repositories and forks and branches. It’s tedious to be careful to update those with real values so that the tests are properly regression testing older SDKs. It’s important to be careful so that the tests are accurate, e.g. to prevent the scenario where DarwinSDKInfo starts reading a new key out of SDKSettings and assumes that it’s always available everywhere, when in reality it was only added a few releases ago and will break with older SDKs. If the test SDKSettings files continue to be updated ad hoc, it’s going to be really easy to copy/paste a default value everywhere, and then clients will see incorrect behaviors with the real SDKs, or even compiler crashes if the key is unconditionally read. Preemptively add all of the maybe-possibly-compiler relevant keys to the test SDKSettings files from the real SDKs so that the test files are an accurate representation and shouldn't need to be touched in the future. Where the test SDKSettings have intentionally doctored data, add a Comments key explaining what is changed from the real SDK, and alter the SDK name with a tag indicating the change. rdar://168700857
9 lines
660 B
Swift
9 lines
660 B
Swift
// Check reading the SDKSettings.json from an SDK
|
|
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 -sdk %S/Inputs/MacOSX10.15.sdk %s 2>&1 | %FileCheck -check-prefix MACOS_10_15 %s
|
|
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 -sdk %S/Inputs/MacOSX10.15.4.sdk %s 2>&1 | %FileCheck -check-prefix MACOS_10_15_4 %s
|
|
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 -sdk %S/Inputs/NonExistent.sdk %s 2>&1 | %FileCheck -check-prefix MACOS_UNVERSIONED %s
|
|
|
|
// MACOS_10_15: -target-sdk-version 10.15
|
|
// MACOS_10_15_4: -target-sdk-version 10.15.4
|
|
// MACOS_UNVERSIONED-NOT: -target-sdk-version
|