|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | +// RUN: %target-swift-frontend %s -module-name AvailabilityFilter -emit-module -emit-module-path %t/AvailabilityFilter.swiftmodule -emit-symbol-graph -emit-symbol-graph-dir %t/ |
| 3 | +// RUN: %FileCheck %s --input-file %t/AvailabilityFilter.symbols.json --check-prefix DEFAULT |
| 4 | + |
| 5 | +// RUN: %target-swift-symbolgraph-extract -module-name AvailabilityFilter -I %t -pretty-print -output-dir %t |
| 6 | +// RUN: %FileCheck %s --input-file %t/AvailabilityFilter.symbols.json --check-prefix DEFAULT |
| 7 | + |
| 8 | +// Now checking the allowlist behavior... |
| 9 | + |
| 10 | +// RUN: %empty-directory(%t) |
| 11 | +// RUN: %target-swift-frontend %s -module-name AvailabilityFilter -emit-module -emit-module-path %t/AvailabilityFilter.swiftmodule -emit-symbol-graph -emit-symbol-graph-dir %t/ -symbol-graph-allow-availability-platforms macOS,iOS |
| 12 | +// RUN: %FileCheck %s --input-file %t/AvailabilityFilter.symbols.json --check-prefix ALLOWLIST |
| 13 | + |
| 14 | +// RUN: %target-swift-symbolgraph-extract -module-name AvailabilityFilter -I %t -pretty-print -output-dir %t -allow-availability-platforms macOS,iOS |
| 15 | +// RUN: %FileCheck %s --input-file %t/AvailabilityFilter.symbols.json --check-prefix ALLOWLIST |
| 16 | + |
| 17 | +// Now checking the blocklist behavior... |
| 18 | + |
| 19 | +// RUN: %empty-directory(%t) |
| 20 | +// RUN: %target-swift-frontend %s -module-name AvailabilityFilter -emit-module -emit-module-path %t/AvailabilityFilter.swiftmodule -emit-symbol-graph -emit-symbol-graph-dir %t/ -symbol-graph-block-availability-platforms macOS,iOS |
| 21 | +// RUN: %FileCheck %s --input-file %t/AvailabilityFilter.symbols.json --check-prefix BLOCKLIST |
| 22 | + |
| 23 | +// RUN: %target-swift-symbolgraph-extract -module-name AvailabilityFilter -I %t -pretty-print -output-dir %t -block-availability-platforms macOS,iOS |
| 24 | +// RUN: %FileCheck %s --input-file %t/AvailabilityFilter.symbols.json --check-prefix BLOCKLIST |
| 25 | + |
| 26 | +// Now test to ensure an empty allow list filters out all availability... |
| 27 | + |
| 28 | +// RUN: %empty-directory(%t) |
| 29 | +// RUN: %target-swift-frontend %s -module-name AvailabilityFilter -emit-module -emit-module-path %t/AvailabilityFilter.swiftmodule -emit-symbol-graph -emit-symbol-graph-dir %t/ -symbol-graph-allow-availability-platforms "" |
| 30 | +// RUN: %FileCheck %s --input-file %t/AvailabilityFilter.symbols.json --check-prefix EMPTY |
| 31 | + |
| 32 | +// RUN: %target-swift-symbolgraph-extract -module-name AvailabilityFilter -I %t -pretty-print -output-dir %t -allow-availability-platforms "" |
| 33 | +// RUN: %FileCheck %s --input-file %t/AvailabilityFilter.symbols.json --check-prefix EMPTY |
| 34 | + |
| 35 | +// REQUIRES: OS=macosx |
| 36 | + |
| 37 | +@available(macOS 11.0, iOS 15.0, watchOS 15.0, *) |
| 38 | +public struct S {} |
| 39 | + |
| 40 | +/// Ensure that regardless of platforms being removed, that universal availability info, |
| 41 | +/// like unconditional deprecation, still lands in the symbol graph. |
| 42 | +@available(*, deprecated) |
| 43 | +public class C {} |
| 44 | + |
| 45 | +// DEFAULT-DAG: "domain":{{ ?}}"macOS" |
| 46 | +// DEFAULT-DAG: "domain":{{ ?}}"iOS" |
| 47 | +// DEFAULT-DAG: "domain":{{ ?}}"watchOS" |
| 48 | +// DEFAULT-DAG: "isUnconditionallyDeprecated":{{ ?}}true |
| 49 | + |
| 50 | +// ALLOWLIST-NOT: "domain":{{ ?}}"watchOS" |
| 51 | +// ALLOWLIST-DAG: "domain":{{ ?}}"macOS" |
| 52 | +// ALLOWLIST-DAG: "domain":{{ ?}}"iOS" |
| 53 | +// ALLOWLIST-DAG: "isUnconditionallyDeprecated":{{ ?}}true |
| 54 | + |
| 55 | +// BLOCKLIST-NOT: "domain":{{ ?}}"macOS" |
| 56 | +// BLOCKLIST-NOT: "domain":{{ ?}}"iOS" |
| 57 | +// BLOCKLIST-DAG: "domain":{{ ?}}"watchOS" |
| 58 | +// BLOCKLIST-DAG: "isUnconditionallyDeprecated":{{ ?}}true |
| 59 | + |
| 60 | +// EMPTY-NOT: "domain":{{ ?}}"macOS" |
| 61 | +// EMPTY-NOT: "domain":{{ ?}}"iOS" |
| 62 | +// EMPTY-NOT: "domain":{{ ?}}"watchOS" |
| 63 | +// EMPTY-DAG: "isUnconditionallyDeprecated":{{ ?}}true |
0 commit comments