xref: /llvm-project/clang/test/InstallAPI/directory-scanning-frameworks.test (revision feed66f3eae5006bb05e6cb34801930fd940daa8)
1; RUN: rm -rf %t
2; RUN: split-file %s %t
3; RUN: mkdir -p %t/SDKRoot/System/Library/Frameworks
4; RUN: cp -r %S/Inputs/Simple/* %t/SDKRoot/System/Library/Frameworks/
5; RUN: cp -r %S/Inputs/Foundation/* %t/SDKRoot/System/Library/Frameworks/
6# Skip over header that produces warnings.
7; RUN: rm %t/SDKRoot/System/Library/Frameworks/Simple.framework/Headers/Simple.h
8
9; RUN: clang-installapi -target x86_64-apple-macosx10.12 \
10; RUN: -install_name /System/Library/Frameworks/Simple.framework/Versions/A/Simple \
11; RUN: -current_version 1.2.3 -compatibility_version 1 -o %t/Simple.tbd \
12; RUN: -F %t/SDKRoot/System/Library/Frameworks --verify-mode=ErrorsOnly \
13; RUN: %t/SDKRoot/System/Library/Frameworks/Simple.framework 2>&1 | FileCheck -allow-empty %s \
14; RUN: --implicit-check-not=error --implicit-check-not=warning
15; RUN: llvm-readtapi -compare %t/expected.tbd %t/Simple.tbd
16
17# Test expected error by collecting too many frameworks.
18; RUN: not clang-installapi -target x86_64-apple-macosx10.12 \
19; RUN: -install_name /System/Library/Frameworks/Simple.framework/Versions/A/Simple \
20; RUN: -current_version 1.2.3 -compatibility_version 1 -o %t/Simple.tbd \
21; RUN: -F %t/SDKRoot/System/Library/Frameworks --verify-mode=ErrorsOnly \
22; RUN: %t/SDKRoot/ 2>&1 | FileCheck %s --check-prefix=TOO_MANY
23
24; TOO_MANY: error: more than one framework/dynamic library found
25
26;--- expected.tbd
27{
28  "main_library": {
29    "current_versions": [
30      {
31        "version": "1.2.3"
32      }
33    ],
34    "exported_symbols": [
35      {
36        "data": {
37          "global": [
38            "_otherFrameworkAPI",
39            "_otherFrameworkSPI",
40            "_privateGlobalVariable"
41          ],
42          "objc_class": [
43            "Basic6",
44            "Basic1",
45            "Basic3",
46            "Basic4_2",
47            "Basic5",
48            "Basic9",
49            "Basic8",
50            "Basic2",
51            "Basic4",
52            "A",
53            "ExternalManagedObject"
54          ],
55          "objc_ivar": [
56            "Basic4.ivar2",
57            "Basic4_2.ivar1",
58            "Basic6.ivar1",
59            "Basic4.ivar1",
60            "Basic4_2.ivar2"
61          ],
62          "weak": [
63            "_weakPrivateGlobalVariable"
64          ]
65        }
66      }
67    ],
68    "flags": [
69      {
70        "attributes": [
71          "not_app_extension_safe"
72        ]
73      }
74    ],
75    "install_names": [
76      {
77        "name": "/System/Library/Frameworks/Simple.framework/Versions/A/Simple"
78      }
79    ],
80    "target_info": [
81      {
82        "min_deployment": "10.12",
83        "target": "x86_64-macos"
84      }
85    ]
86  },
87  "tapi_tbd_version": 5
88}
89