Merge pull request #8 from biergaizi/upstream
[darwin-xtools.git] / dyld / unit-tests / build-iPhoneOS-unit-tests
blob93cb583f8df889df0fe386b659a0feb092d841cd
1 #!/bin/sh
3 # cd into test-cases directory
4 TEST_CASE_DIR=`echo "$0" | sed 's/build-iPhoneOS-unit-tests/test-cases/'`
5 cd ${TEST_CASE_DIR}
6 TEST_CASE_DIR=`pwd`
8 # make clean
9 ../bin/make-recursive.pl clean > /dev/null
11 # clean staging area
12 rm -rf /var/root/testing
13 mkdir /var/root/testing
15 # create scripts to run test cases on device
16 echo "#!/bin/sh" > /var/root/testing/run-all-tests
17 chmod +x /var/root/testing/run-all-tests
19 # do every combination of OS version and architectures
20 for os in "7.0"
22 for arch in armv7 arm64
24 # make copy of tests
25 cp -r ${TEST_CASE_DIR}/../../unit-tests /var/root/testing/unit-tests-${arch}-${os}
26 # build but don't run test cases
27 echo " * * * Building all unit tests for ${arch} iPhoneOS ${os} * * *"
28 cd /var/root/testing/unit-tests-${arch}-${os}/test-cases
29 ../bin/make-recursive.pl ARCH=${arch} OS_VERSION=${os} OS_NAME=iPhoneOS all | ../bin/build-results-filter.pl
30 # update script
31 echo "cd /var/root/testing/unit-tests-${arch}-${os}" >> /var/root/testing/run-all-tests
32 echo "echo \" * * * Running all unit tests for ${arch} iPhoneOS ${os} * * *\"" >> /var/root/testing/run-all-tests
33 echo "bin/make-recursive.pl OS_NAME=iPhoneOS check | bin/result-filter.pl" >> /var/root/testing/run-all-tests
34 done
35 done
37 # tar up all test cases
38 echo " * * * Making archive * * *"
39 cd /var/root
40 ditto -c -z testing /tmp/dyld-testing.cpgz
42 # create script to unpack on device
43 echo "#!/bin/sh" > /tmp/unpack-and-run-all-tests
44 echo "echo \" * * * Unpacking test cases * * *\"" >> /tmp/unpack-and-run-all-tests
45 echo "/sbin/mount -u /private/var" >> /tmp/unpack-and-run-all-tests
46 echo "chmod +x /var/root" >> /tmp/unpack-and-run-all-tests
47 echo "cd /var/root" >> /tmp/unpack-and-run-all-tests
48 echo "rm -rf /var/root/testing" >> /tmp/unpack-and-run-all-tests
49 echo "ditto -x /tmp/dyld-testing.cpgz testing" >> /tmp/unpack-and-run-all-tests
50 echo "/var/root/testing/run-all-tests" >> /tmp/unpack-and-run-all-tests
51 chmod +x /tmp/unpack-and-run-all-tests