]> git.saurik.com Git - apple/xnu.git/blame_incremental - tools/tests/MPMMTest/MPMMtest_run.sh
xnu-6153.141.1.tar.gz
[apple/xnu.git] / tools / tests / MPMMTest / MPMMtest_run.sh
... / ...
CommitLineData
1#!/bin/bash
2
3TESTDIR=$PWD/
4MPMMTEST="${TESTDIR}/MPMMtest"
5MPMMTEST_64="${TESTDIR}/MPMMtest_64"
6KQMPMMTEST="${TESTDIR}/KQMPMMtest"
7KQMPMMTEST_64="${TESTDIR}/KQMPMMtest_64"
8
9is_64_bit_env()
10{
11 ARCHOUT=`file /bin/ls`
12 if [[ $ARCHOUT == *"64-bit"* ]]; then
13 return 1
14 fi
15 return 0
16}
17
18is_64_bit_env;
19IS_64BIT_BOOTED_OS=$?
20
21if [ -e $MPMMTEST ] && [ -x $MPMMTEST ]
22then
23 # Tentatively test for 32-bit support
24 $MPMMTEST -count 0 -servers 0 -clients 0 &> /dev/null
25
26 if [ $? == 0 ] || [ $IS_64BIT_BOOTED_OS == 0 ]
27 then
28 # If 32-bit support appears to be present OR if this is not
29 # a 64-bit environment, run the test.
30 echo ""; echo " Running $MPMMTEST";
31 $MPMMTEST -perf || { x=$?; echo "$MPMMTEST failed $x "; exit $x; }
32 fi
33fi
34
35if [ -e $MPMMTEST_64 ] && [ -x $MPMMTEST_64 ] && [ $IS_64BIT_BOOTED_OS == 1 ]
36then
37 echo ""; echo " Running $MPMMTEST_64"
38 $MPMMTEST_64 -perf || { x=$?; echo "$MPMMTEST_64 failed $x"; exit $x; }
39fi
40
41if [ -e $KQMPMMTEST ] && [ -x $KQMPMMTEST ]
42then
43 # Tentatively test for 32-bit support
44 $KQMPMMTEST -count 0 -servers 0 -clients 0 &> /dev/null
45
46 if [ $? == 0 ] || [ $IS_64BIT_BOOTED_OS == 0 ]
47 then
48 # If 32-bit support appears to be present OR if this is not
49 # a 64-bit environment, run the test.
50 echo ""; echo " Running $KQMPMMTEST"
51 $KQMPMMTEST -perf || { x=$?; echo "$KQMPMMTEST failed $x"; exit $x; }
52 fi
53fi
54
55if [ -e $KQMPMMTEST_64 ] && [ -x $KQMPMMTEST_64 ] && [ $IS_64BIT_BOOTED_OS == 1 ]
56then
57 echo ""; echo " Running $KQMPMMTEST_64"
58 $KQMPMMTEST_64 -perf || { x=$?; echo "$KQMPMMTEST_64 failed $x"; exit $?; }
59fi
60
61echo ""; echo " SUCCESS";
62exit 0;
63
64