Skip to content

api-digester: teach the tool to detect new mutating functions #5284

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 13 commits into from
Oct 14, 2016
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions test/api-digester/Inputs/cake1.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
public struct S1 {
mutating public func foo1() {}
mutating public func foo2() {}
}
11 changes: 11 additions & 0 deletions test/api-digester/Outputs/Cake.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

==================================================== Removed Decls ====================================================

==================================================== Moved Decls ====================================================

==================================================== Renamed Decls ====================================================

==================================================== Type Changes ====================================================

==================================================== Decl Attribute changes ====================================================
FuncS1.foo1() is now mutating
9 changes: 9 additions & 0 deletions test/api-digester/compare-dump.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// RUN: rm -rf %t.mod && mkdir -p %t.mod
// RUN: rm -rf %t.sdk && mkdir -p %t.sdk
// RUN: rm -rf %t.module-cache && mkdir -p %t.module-cache
// RUN: %swift -emit-module -o %t.mod/cake.swiftmodule %S/Inputs/cake.swift -parse-as-library
// RUN: %swift -emit-module -o %t.mod/cake1.swiftmodule %S/Inputs/cake1.swift -parse-as-library
// RUN: %api-digester -dump-sdk -module cake -o %t.dump.json -module-cache-path %t.module-cache -sdk %t.sdk -swift-version 3.0 -I %t.mod
// RUN: %api-digester -dump-sdk -module cake1 -o %t.dump1.json -module-cache-path %t.module-cache -sdk %t.sdk -swift-version 3.0 -I %t.mod
// RUN: %api-digester -diagnose-sdk --input-paths %t.dump.json -input-paths %t.dump1.json > %t.result
// RUN: diff -u %S/Outputs/Cake.txt %t.result
4 changes: 3 additions & 1 deletion test/api-digester/source-stability.swift.expected
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ Func Float80.abs(_:) has been moved to Func abs(_:)
==================================================== Renamed Decls ====================================================

==================================================== Type Changes ====================================================
Func UnsafePointer.withMemoryRebound(to:capacity:_:) has 3rd parameter type change from (UnsafeMutablePointer<T>) throws -> Result to (UnsafePointer<T>) throws -> Result
Func UnsafePointer.withMemoryRebound(to:capacity:_:) has 3rd parameter type change from (UnsafeMutablePointer<T>) throws -> Result to (UnsafePointer<T>) throws -> Result

==================================================== Decl Attribute changes ====================================================
Loading