Skip to content

[6.0] [Test] Update SymbolGraphGen test to handle nondeterminism #72421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
// RUN: %FileCheck %s --input-file %t/ConditionalConformance.symbols.json --check-prefix=CONFORMS
// RUN: %FileCheck %s --input-file %t/ConditionalConformance.symbols.json --check-prefix=MEMBER

// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=SYNTHEXT,EBSOff_SYNTHEXT
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=CONFORMSEXT,EBSOff_CONFORMSEXT
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=MEMBEREXT,EBSOff_MEMBEREXT
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=SYNTHEXT -DEXTID=s:Sa
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=CONFORMSEXT -DEXTID=s:Sa
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=MEMBEREXT -DEXTID=s:Sa

// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -module-name ConditionalConformance -emit-module -emit-module-path %t/
Expand All @@ -20,9 +20,9 @@
// RUN: %FileCheck %s --input-file %t/ConditionalConformance.symbols.json --check-prefix=CONFORMS
// RUN: %FileCheck %s --input-file %t/ConditionalConformance.symbols.json --check-prefix=MEMBER

// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=SYNTHEXT,EBSOn_SYNTHEXT
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=CONFORMSEXT,EBSOn_CONFORMSEXT
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=MEMBEREXT,EBSOn_MEMBEREXT
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=SYNTHEXT -DEXTID=s:e:s:Sa22ConditionalConformanceSiRszlE3baryyF
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=CONFORMSEXT -DEXTID=s:e:s:Sa22ConditionalConformanceSiRszlE3baryyF
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=MEMBEREXT -DEXTID=s:e:s:Sa22ConditionalConformanceSiRszlE3baryyF

// Relationships to Swift.Array should only go into the @Swift file.
// C\HECK-NOT: "s:Sa"
Expand All @@ -42,10 +42,9 @@ public struct S<T> {
}
}

// CONFORMS: "kind": "conformsTo"
// CONFORMS-NEXT: "source": "s:22ConditionalConformance1SV"
// CONFORMS-NEXT: "target": "s:22ConditionalConformance1PP"
// CONFORMS-NEXT: swiftConstraints
// S<Int> will also have synthesized conformances to Copyable and Escapable, so match multiple lines
// at once to make sure we only find the conformance we want to see
// CONFORMS: "kind": "conformsTo"{{.*[[:space:]].*}} "source": "s:22ConditionalConformance1SV"{{.*[[:space:]].*}} "target": "s:22ConditionalConformance1PP"{{.*[[:space:]].*}} "swiftConstraints"
// CONFORMS: "kind": "sameType"
// CONFORMS-NEXT: "lhs": "T"
// CONFORMS-NEXT: "rhs": "Int"
Expand All @@ -61,22 +60,16 @@ extension S: P where T == Int {
}
}

// CONFORMSEXT: "kind": "conformsTo"
// EBSOff_CONFORMSEXT-NEXT: "source": "s:Sa"
// EBSOn_CONFORMSEXT-NEXT: "source": "s:e:s:Sa22ConditionalConformanceSiRszlE3baryyF"
// CONFORMSEXT-NEXT: "target": "s:22ConditionalConformance1PP"
// CONFORMSEXT-NEXT: swiftConstraints
// CONFORMSEXT: "kind": "conformsTo"{{.*[[:space:]].*}} "source": "[[EXTID]]"{{.*[[:space:]].*}} "target": "s:22ConditionalConformance1PP"{{.*[[:space:]].*}} "swiftConstraints"
// CONFORMSEXT: "kind": "sameType"
// CONFORMSEXT-NEXT: "lhs": "Element"
// CONFORMSEXT-NEXT: "rhs": "Int"

extension Array: P where Element == Int {
// SYNTHEXT: "source": "s:22ConditionalConformance1PPAAE3fooyyF::SYNTHESIZED::s:Sa"
// EBSOff_SYNTHEXT-NEXT: "target": "s:Sa"
// EBSOn_SYNTHEXT-NEXT: "target": "s:e:s:Sa22ConditionalConformanceSiRszlE3baryyF"
// SYNTHEXT-NEXT: "target": "[[EXTID]]"

// MEMBEREXT: "source": "s:Sa22ConditionalConformanceSiRszlE3baryyF"
// EBSOff_MEMBEREXT-NEXT: "target": "s:Sa"
// EBSOn_MEMBEREXT-NEXT: "target": "s:e:s:Sa22ConditionalConformanceSiRszlE3baryyF"
// MEMBEREXT-NEXT: "target": "[[EXTID]]"
public func bar() {}
}