]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/macOS-cache-rebuild.dtest/main.cpp
3 // BUILD: $CXX main.cpp -o $BUILD_DIR/rebuild-dyld-cache.exe
5 // FIXME: This test will not make sense when remove update_dyld_shared_cache, and the functionality will be subsummed by root testing
6 // ./rebuild-dyld-cache.exe
17 #include <sys/types.h>
19 #include "test_support.h"
21 extern char** environ
;
23 int main(int argc
, const char* argv
[], const char* envp
[], const char* apple
[]) {
25 process
.set_executable_path("/usr/bin/update_dyld_shared_cache");
26 const char* env
[] = { "TEST_OUTPUT=None", NULL
};
28 const char* args
[] = { "-cache_dir", "/tmp/", NULL
};
29 process
.set_args(args
);
30 process
.set_exit_handler(^(pid_t pid
) {
32 (void)wait4(pid
, &childStatus
, 0, NULL
);
33 if (WIFEXITED(childStatus
) == 0)
34 FAIL("update_dyld_shared_cache did not exit");
35 else if (WEXITSTATUS(childStatus
) != 0)
36 FAIL("update_dyld_shared_cache failed");