llvm-project/llvm/test/tools/llvm-readtapi/stubify-delete.test
Cyndy Ishida 7189219ec9
[readtapi] Add support for stubify-ing directories (#76885)
When given a directory input `llvm-readtapi` traverses through the
directory to find dylibs or tbd files to operate on. TBD files will be
created with the same base file name as the dylib. Symlinks should be
created if the input is one.

This also introduces options to delete input files which are defined as
library files that existed before `readtapi -stubify` was invoked. Also
the ability to delete private libraries where private libraries are in a
predefined file system locations on darwin based platforms.
2024-02-03 09:33:42 -08:00

19 lines
1.2 KiB
Plaintext

; RUN: rm -rf %t
# Setup a mix of public and private libraries that resemble apple sdk.
; RUN: mkdir -p %t/sysroot/usr/local/lib/ %t/sysroot/usr/lib/
; RUN: mkdir -p %t/sysroot/System/Library/Frameworks/System.framework %t/sysroot/System/Library/PrivateFrameworks/Fat.framework
; RUN: yaml2obj %S/Inputs/libSystem.1.yaml -o %t/sysroot/System/Library/Frameworks/System.framework/System
; RUN: yaml2obj %S/Inputs/objc.yaml -o %t/sysroot/usr/lib/libobjc.dylib
; RUN: cp %t/sysroot/usr/lib/libobjc.dylib %t/sysroot/usr/local/lib/libobjc-unstable.dylib
; RUN: yaml2obj %S/Inputs/universal.yaml -o %t/sysroot/System/Library/PrivateFrameworks/Fat.framework/Fat
; RUN: llvm-readtapi -stubify %t/sysroot --delete-input --delete-private-libraries 2>&1 | FileCheck %s --allow-empty --implicit-check-not warning: --implicit-check-not error:
# Validate expected files are removed.
; RUN: not test -f %t/sysroot/System/Library/PrivateFrameworks
; RUN: not test -f %t/sysroot/usr/local
; RUN: not test -f %t/sysroot/usr/lib/libobjc.dylib
; RUN: not test -f %t/sysroot/System/Library/Frameworks/System.framework/System
; RUN: test -f %t/sysroot/System/Library/Frameworks/System.framework/System.tbd
; RUN: test -f %t/sysroot/usr/lib/libobjc.tbd