]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/env-DYLD_LIBRARY_PATH-cache.dtest/main.c
37136fc1dc9728cd97250ed5eaff028e132d7b43
2 // BUILD: mkdir -p $BUILD_DIR/override
3 // BUILD: $CC myzlib.c -dynamiclib -o $BUILD_DIR/override/libz.1.dylib -install_name /usr/lib/libz.1.dylib -compatibility_version 1.0 -framework CoreFoundation
4 // BUILD: $CC main.c -o $BUILD_DIR/main.exe -lz
5 // BUILD: $DYLD_ENV_VARS_ENABLE $BUILD_DIR/main.exe
8 // RUN: DYLD_LIBRARY_PATH=$RUN_DIR/override/ ./main.exe
16 // The test here is to override libz.1.dylib which is in the dyld cache with our own implementation.
20 bool expectMyDylib
= (getenv("DYLD_LIBRARY_PATH") != NULL
);
22 printf("[BEGIN] env-DYLD_LIBRARY_PATH-cache, %s\n", expectMyDylib
? "my" : "os");
24 bool usingMyDylib
= (strcmp(zlibVersion(), "my") == 0);
26 if ( usingMyDylib
== expectMyDylib
)
27 printf("[PASS] env-DYLD_LIBRARY_PATH-cache, %s\n", expectMyDylib
? "my" : "os");
29 printf("[FAIL] env-DYLD_LIBRARY_PATH-cache, %s\n", expectMyDylib
? "my" : "os");