]> git.saurik.com Git - apple/ld64.git/blob - unit-tests/run-all-unit-tests
ld64-409.12.tar.gz
[apple/ld64.git] / unit-tests / run-all-unit-tests
1 #!/bin/sh
2
3 unset RC_TRACE_DYLIBS
4 unset RC_TRACE_ARCHIVES
5 unset LD_TRACE_DYLIBS
6 unset LD_TRACE_ARCHIVES
7
8 # cd into test-cases directory
9 cd `echo "$0" | sed 's/run-all-unit-tests/test-cases/'`
10
11 [ "$PROCTORRUN" ] && exec ../proctor-run
12
13 all_archs="x86_64 i386"
14 valid_archs="x86_64 i386"
15 ios_sdk_directory="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs"
16 # only test arm code if iOS platform tools installed
17 min_available_ios_sdk_version()
18 {
19 ls "${ios_sdk_directory}" |
20 grep --invert-match --ignore-case "internal" | # exclude internal SDKs
21 sort --version-sort | head -n 1 | # take SDK with min version
22 sed "s/^iPhoneOS\(.*\)\.sdk$/\1/" # return only the version string
23 }
24 version_ge()
25 {
26 test "$(printf '%s\n' "$@" | sort --version-sort | head -n 1)" == "$2";
27 }
28 if [ -d $ios_sdk_directory ]
29 then
30 arm_arch="armv7"
31 # Newer SDKs don't support older architectures.
32 if version_ge "$(min_available_ios_sdk_version)" "11.0"
33 then
34 arm_arch="arm64"
35 fi
36 all_archs="${all_archs} ${arm_arch}"
37 valid_archs="${valid_archs} ${arm_arch}"
38 fi
39
40
41 # clean first
42 ../bin/make-recursive.pl clean > /dev/null
43
44 mkdir /tmp/$$
45 for arch in $all_archs
46 do
47 echo ""
48 echo " * * * Running all unit tests for architecture $arch * * *"
49
50 # build architecture
51 [ "$NEWTEST" ] && NT=-newtest
52
53 ../bin/make-recursive$NT.pl ARCH=$arch VALID_ARCHS="$valid_archs" | ../bin/result-filter.pl
54
55 # clean up so svn is happy
56 ../bin/make-recursive.pl ARCH=$arch clean > /dev/null
57
58 echo ""
59 done