1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
|
; RUN: rm -rf %t
; RUN: split-file %s %t
; RUN: mkdir -p %t/System/Library/Frameworks
; RUN: cp -r %S/Inputs/Simple/Simple.framework %t/System/Library/Frameworks/
; RUN: cp -r %S/Inputs/Foundation/Foundation.framework %t/System/Library/Frameworks/
; RUN: sed -e "s|DSTROOT|%/t|g" %t/inputs.json.in > %t/inputs.json
; RUN: yaml2obj %S/Inputs/Simple/Simple.yaml -o %t/Simple
// Add exclude options.
; RUN: clang-installapi -target x86_64-apple-macosx10.12 \
; RUN: -install_name /System/Library/Frameworks/Simple.framework/Versions/A/Simple \
; RUN: -current_version 1.2.3 -compatibility_version 1 \
; RUN: -F%t/System/Library/Frameworks \
; RUN: %t/inputs.json -o %t/Simple.tbd \
; RUN: --verify-against=%t/Simple --verify-mode=ErrorsAndWarnings \
; RUN: --exclude-public-header=**/SimpleAPI.h \
; RUN: --exclude-private-header=**/SimplePrivateSPI.h 2>&1 | FileCheck -check-prefix=WARNINGS %s
; RUN: llvm-readtapi -compare %t/Simple.tbd %t/expected-excluded.tbd
// Add extra options.
; RUN: clang-installapi -target x86_64-apple-macosx10.12 \
; RUN: -install_name /System/Library/Frameworks/Simple.framework/Versions/A/Simple \
; RUN: -current_version 1.2.3 -compatibility_version 1 \
; RUN: -F%t/System/Library/Frameworks \
; RUN: %t/inputs.json -o %t/Simple.tbd \
; RUN: --verify-against=%t/Simple --verify-mode=Pedantic \
; RUN: --extra-project-header=%S/Inputs/Simple/SimpleInternalAPI2.h \
; RUN: --extra-project-header=%S/Inputs/Simple/SimpleInternalAPI.h \
; RUN: --extra-public-header=%S/Inputs/Simple/Extra \
; RUN: --extra-private-header=%S/Inputs/Simple/SimpleInternalSPI.h \
; RUN: --exclude-public-header=**/SimpleAPI.h \
; RUN: --exclude-private-header=**/SimplePrivateSPI.h 2>&1 | FileCheck -check-prefix=PEDANTIC -allow-empty %s
; RUN: llvm-readtapi -compare %t/Simple.tbd %t/expected-extra.tbd
// Check fatal missing file input.
; RUN: not clang-installapi -target x86_64-apple-macosx10.12 \
; RUN: -install_name /System/Library/Frameworks/Simple.framework/Versions/A/Simple \
; RUN: -current_version 1.2.3 -compatibility_version 1 \
; RUN: -F%t/System/Library/Frameworks \
; RUN: %t/inputs.json -o %t/Simple.tbd \
; RUN: --extra-public-header=%S/Inputs/Simple/NoSuchFile.h 2>&1 | FileCheck -allow-empty -check-prefix=NOPUBLIC %s
; WARNINGS: warning: no declaration was found for exported symbol '_extraGlobalAPI1' in dynamic library
; WARNINGS: warning: no declaration was found for exported symbol '_extraGlobalAPI2' in dynamic library
; WARNINGS: warning: no declaration was found for exported symbol '(ObjC Class) SimpleInternalSPI' in dynamic library
; WARNINGS: warning: no declaration was found for exported symbol '(ObjC Class) SimpleInternalAPI' in dynamic library
; PEDANTIC-NOT: error
; PEDANTIC: warning: cannot find protocol definition for 'ForwardProcotol'
; NOPUBLIC: error: no such public header file:
;--- expected-excluded.tbd
{
"main_library": {
"current_versions": [
{
"version": "1.2.3"
}
],
"exported_symbols": [
{
"data": {
"global": [
"_publicGlobalVariable",
"_privateGlobalVariable"
],
"objc_class": [
"ExternalManagedObject", "Basic6",
"Basic1", "Base", "Basic3",
"FooClass", "Simple",
"Basic4_2", "Basic5",
"Basic9","Basic8",
"Basic2", "Basic4", "A", "SubClass"
],
"objc_eh_type": [
"SubClass", "Base"
],
"objc_ivar": [
"Basic4.ivar2", "Basic4_2.ivar1", "Basic6.ivar1",
"Basic4.ivar1", "Basic4_2.ivar2"
],
"weak": [
"_weakPrivateGlobalVariable", "_weakPublicGlobalVariable"
]
}
}
],
"flags": [
{
"attributes": ["not_app_extension_safe"]
}
],
"install_names": [
{
"name": "/System/Library/Frameworks/Simple.framework/Versions/A/Simple"
}
],
"target_info": [
{"min_deployment": "10.12", "target": "x86_64-macos"}
]
},
"tapi_tbd_version": 5
}
;--- expected-extra.tbd
{
"main_library": {
"current_versions": [
{ "version": "1.2.3" }
],
"exported_symbols": [
{
"data": {
"global": [
"_publicGlobalVariable", "_extraGlobalAPI2",
"_extraGlobalAPI1", "_privateGlobalVariable"
],
"objc_class": [
"SubClass", "SimpleInternalSPI",
"Basic6", "Basic1", "Base",
"Basic3", "Simple", "Basic4_2",
"Basic5", "FooClass", "Basic9",
"Basic8", "Basic2", "Basic4",
"A", "SimpleInternalAPI",
"ExternalManagedObject"
],
"objc_eh_type": [
"SubClass", "SimpleInternalAPI",
"Base", "SimpleInternalSPI"
],
"objc_ivar": [
"Basic4.ivar2", "Basic4_2.ivar1",
"Basic6.ivar1", "Basic4.ivar1",
"Basic4_2.ivar2"
],
"weak": [
"_weakPrivateGlobalVariable", "_weakPublicGlobalVariable"
]
}
}
],
"flags": [
{
"attributes": [ "not_app_extension_safe"]
}
],
"install_names": [
{ "name": "/System/Library/Frameworks/Simple.framework/Versions/A/Simple" }
],
"target_info": [
{ "min_deployment": "10.12", "target": "x86_64-macos" }
]
},
"tapi_tbd_version": 5
}
;--- inputs.json.in
{
"headers": [
{
"path" : "DSTROOT/System/Library/Frameworks/Simple.framework/Headers/Basic.h",
"type" : "public"
},
{
"path" : "DSTROOT/System/Library/Frameworks/Simple.framework/Headers/External.h",
"type" : "public"
},
{
"path" : "DSTROOT/System/Library/Frameworks/Simple.framework/Headers/Simple.h",
"type" : "public"
},
{
"path" : "DSTROOT/System/Library/Frameworks/Simple.framework/Headers/SimpleAPI.h",
"type" : "public"
},
{
"path" : "DSTROOT/System/Library/Frameworks/Simple.framework/PrivateHeaders/SimplePrivate.h",
"type" : "private"
},
{
"path" : "DSTROOT/System/Library/Frameworks/Simple.framework/PrivateHeaders/SimplePrivateSPI.h",
"type" : "private"
}
],
"version": "3"
}
|