xref: /llvm-project/clang/test/InstallAPI/directory-scanning-dylib.test (revision feed66f3eae5006bb05e6cb34801930fd940daa8)
1; RUN: rm -rf %t
2; RUN: split-file %s %t
3; RUN: mkdir -p %t/DstRoot/
4; RUN: cp -r %S/Inputs/LibFoo/* %t/DstRoot/
5
6; RUN: clang-installapi \
7; RUN: -target arm64-apple-macos12 -install_name @rpath/libfoo.dylib \
8; RUN: -current_version 1 -compatibility_version 1 \
9; RUN: -I%t/DstRoot/usr/include -dynamiclib \
10; RUN: -exclude-public-header %t/DstRoot/usr/include/public.h \
11; RUN: %t/DstRoot -o %t/output.tbd 2>&1 | FileCheck %s --allow-empty \
12; RUN: --implicit-check-not=error --implicit-check-not=warning
13; RUN: llvm-readtapi --compare %t/output.tbd %t/expected.tbd
14
15# Test expected error by empty directory.
16; RUN: mkdir -p %t/EmptyRoot
17; RUN: not clang-installapi \
18; RUN: -target arm64-apple-macos12 -install_name @rpath/libfoo.dylib \
19; RUN: -current_version 1 -compatibility_version 1 \
20; RUN: %t/DstRoot/usr/include -dynamiclib \
21; RUN: %t/EmptyRoot -o %t/output.tbd 2>&1 | FileCheck %s --check-prefix=EMPTY
22
23; EMPTY: could not read directory {{.*}} cannot find any public (usr/include) or private (usr/local/include) header directory
24
25;--- expected.tbd
26{
27  "main_library": {
28    "exported_symbols": [
29      {
30        "text": {
31          "global": [
32            "_foo"
33          ]
34        }
35      }
36    ],
37    "flags": [
38      {
39        "attributes": [
40          "not_app_extension_safe"
41        ]
42      }
43    ],
44    "install_names": [
45      {
46        "name": "@rpath/libfoo.dylib"
47      }
48    ],
49    "target_info": [
50      {
51        "min_deployment": "12",
52        "target": "arm64-macos"
53      }
54    ]
55  },
56  "tapi_tbd_version": 5
57}
58