Files
swift-mirror/test/Interpreter/SDK/objc_ns_enum.swift
Alexis Laferrière ddb13d1cf3 Tests: Update tests importing AppKit from the SDK to use a local cache
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
2025-08-11 13:57:28 -07:00

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