mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Tests importing AppKit have a tendency to be flaky when they share a module cache with other builds using a different set of framework search flags. Make sure they use a local cache, otherwise the compiler can reuse incompatible cached modules. Alternatively, we could align all builds using the same cache to have exactly the same framework search paths or enable explicit module builds. I picked the module cache as it's the most reliable solution in the short and long term. rdar://142949965
26 lines
685 B
Swift
26 lines
685 B
Swift
// RUN: %empty-directory(%t/cache)
|
|
// RUN: %target-run-simple-swift(-module-cache-path %t/cache)
|
|
// REQUIRES: executable_test
|
|
|
|
// NSButtonType (from AppKit) and UIViewAnimationCurve (from UIKit) both have
|
|
// private enumerators, so we preserve their values through raw value
|
|
// conversion operations.
|
|
// (Really we do this for all NS_ENUMs, though we reserve the right to do
|
|
// strict checking if we get a guarantee that certain types don't have
|
|
// hidden or future enumeration values.)
|
|
|
|
#if os(macOS)
|
|
import AppKit
|
|
|
|
print(NSButton.ButtonType(rawValue: 20721)!.rawValue)
|
|
#endif
|
|
|
|
#if os(iOS)
|
|
import UIKit
|
|
|
|
print(UIViewAnimationCurve(rawValue: 20721)!.rawValue)
|
|
#endif
|
|
|
|
// CHECK: 20721
|
|
|