]> git.saurik.com Git - apple/ld64.git/blame - unit-tests/run-all-unit-tests
ld64-409.12.tar.gz
[apple/ld64.git] / unit-tests / run-all-unit-tests
CommitLineData
d696c285
A
1#!/bin/sh
2
2f2f92e4
A
3unset RC_TRACE_DYLIBS
4unset RC_TRACE_ARCHIVES
5unset LD_TRACE_DYLIBS
6unset LD_TRACE_ARCHIVES
7
d696c285
A
8# cd into test-cases directory
9cd `echo "$0" | sed 's/run-all-unit-tests/test-cases/'`
10
a61fdf0a
A
11[ "$PROCTORRUN" ] && exec ../proctor-run
12
afe874b1
A
13all_archs="x86_64 i386"
14valid_archs="x86_64 i386"
e456bf10 15ios_sdk_directory="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs"
afe874b1 16# only test arm code if iOS platform tools installed
e456bf10
A
17min_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}
24version_ge()
25{
26 test "$(printf '%s\n' "$@" | sort --version-sort | head -n 1)" == "$2";
27}
28if [ -d $ios_sdk_directory ]
afe874b1 29then
e456bf10
A
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}"
afe874b1
A
38fi
39
d696c285 40
77cc3118
A
41# clean first
42../bin/make-recursive.pl clean > /dev/null
43
a61fdf0a 44mkdir /tmp/$$
d696c285
A
45for arch in $all_archs
46do
47 echo ""
48 echo " * * * Running all unit tests for architecture $arch * * *"
49
50 # build architecture
a61fdf0a
A
51 [ "$NEWTEST" ] && NT=-newtest
52
2f2f92e4 53 ../bin/make-recursive$NT.pl ARCH=$arch VALID_ARCHS="$valid_archs" | ../bin/result-filter.pl
d696c285
A
54
55 # clean up so svn is happy
56 ../bin/make-recursive.pl ARCH=$arch clean > /dev/null
57
58 echo ""
59done