]>
git.saurik.com Git - apple/dyld.git/blob - testing/kernel-cache-tests/kmod-info-errors/test.py
4 import KernelCollection
6 # Error for bad kmod info
8 def check(kernel_cache
):
9 kernel_cache
.buildKernelCollection("x86_64", "/kmod-info-errors/main.kc", "/kmod-info-errors/main.kernel", "/kmod-info-errors/extensions", ["com.apple.foo", "com.apple.bar"], ["-json-errors"])
11 assert len(kernel_cache
.dictionary()) == 2
13 assert kernel_cache
.dictionary()[0]["id"] == "com.apple.bar"
14 assert len(kernel_cache
.dictionary()[0]["errors"]) == 1
15 assert kernel_cache
.dictionary()[0]["errors"][0] == "unsupported kmod_info version of 2"
17 assert kernel_cache
.dictionary()[1]["id"] == "com.apple.foo"
18 assert len(kernel_cache
.dictionary()[1]["errors"]) == 1
19 assert kernel_cache
.dictionary()[1]["errors"][0] == "unsupported kmod_info version of 2"
21 # [~]> xcrun -sdk macosx.internal cc -arch x86_64 -Wl,-static -mkernel -nostdlib -Wl,-e,__start -Wl,-pie main.c -Wl,-pagezero_size,0x0 -o main.kernel -Wl,-image_base,0x200000 -Wl,-segaddr,__HIB,0x100000 -Wl,-add_split_seg_info -Wl,-install_name,/usr/lib/swift/split.seg.v2.hack
22 # [~]> xcrun -sdk macosx.internal cc -arch x86_64 -Wl,-kext -mkernel -nostdlib -Wl,-add_split_seg_info foo.c -o extensions/foo.kext/foo
23 # [~]> xcrun -sdk macosx.internal cc -arch x86_64 -Wl,-kext -mkernel -nostdlib -Wl,-add_split_seg_info bar.c -o extensions/bar.kext/bar
24 # [~]> rm -r extensions/*.kext/*.ld