]> git.saurik.com Git - apple/ld64.git/blame - ld64-134.9/unit-tests/README
ld64-134.9.tar.gz
[apple/ld64.git] / ld64-134.9 / unit-tests / README
CommitLineData
b1f7435d
A
1
2The easy way to run all tests is within Xcode. Just select "unit-tests" as the target and click Build.
3
4When run from within Xcode, the just built linker will be used. If you cd into a test case and run it, the
5installed linker (e.g. /usr/bin/ld) will be used.
6
7Each test case is a directory with a Makefile. The Makefile default target should do whatever work is necessary
8to perform the test. If successful is should print "PASS xxx" where xxx is the name of the test case. Otherwise
9it should print "FAIL xxx reason". If nothing is printed (for instance a tool crashed), the harness will
10automatically print that it failed. The harness will always pass ARCH to the Makefile to specify which
11architecture to test. The Makefile should also have a "clean" target which removes and generated files.
12
13
14There are some utility functions for use in Makefiles for generating the PASS/FAIL strings:
15
16 ${PASS_IFF} can be put in front of the last command in the make rule and it will print PASS
17 if the command returned 0 or FAIL otherwise. Example:
18 ${PASS_IFF} ${CC} foo.c -o foo
19 Will print PASS if and only if the compilation succeeded
20
21 ${PASS_IFF_EMPTY} can have data piped into it. It prints PASS if there is no data, otherwise FAIL.
22 Example:
23 otool -hv foo.o | grep SUBSECTIONS_VIA_SYMBOLS | ${PASS_IFF_EMPTY}
24 Will print PASS if and only if the output of otool does not contain SUBSECTIONS_VIA_SYMBOLS
25
26
27
28