mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Tools] Add a tool to detect source-breaking API changes introduced from libraries. (#5236)
[Tools] Add a tool to detect source-breaking API changes introduced from libraries. swift-api-digester is a test utility to detect source-breaking API changes during the evolution of a swift library. The tool works on two phases: (1) dumping library contents as a json file, and (2) comparing two json files textually to report interesting changes. During phase (1), the api-digester looks up every declarations inside a module and outputs a singly-rooted tree that encloses interesting details of the API level. During phase (2), api-digester applies structure-information comparision algorithms on two given singly root trees, trying to figure out, as precise as possible, the branches/leaves in the trees that differ from each other. Further analysis decides whether the changed leaves/branches can be reflected as source-breaking changes for API users. If they are, the output of api-digester will include such changes. Also, this commit includes a regression test that make sure API changes from the Swift stdlib are expected.
This commit is contained in:
3374
tools/swift-api-digester/swift-api-digester.cpp
Normal file
3374
tools/swift-api-digester/swift-api-digester.cpp
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user