]> git.saurik.com Git - apple/xnu.git/blobdiff - tools/tests/execperf/test.sh
xnu-1699.22.73.tar.gz
[apple/xnu.git] / tools / tests / execperf / test.sh
diff --git a/tools/tests/execperf/test.sh b/tools/tests/execperf/test.sh
new file mode 100755 (executable)
index 0000000..72917a7
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+EXECUTABLES="exit.nodyld \
+        exit.nopie.dyld-but-no-Libsystem exit.pie.dyld-but-no-Libsystem \
+        exit.nopie.dyld-and-Libsystem exit.pie.dyld-and-Libsystem \
+        exit.nopie exit.pie"
+                       
+RUN=run
+PRODUCT=`sw_vers -productName`
+COUNT=
+
+case "$PRODUCT" in
+    "iPhone OS")
+       COUNT=1000
+       ;;
+    *)
+       COUNT=10000
+       ;;
+esac
+
+for j in 1 2 3; do
+    for i in ${EXECUTABLES}; do
+       echo "Running $i"
+       /usr/bin/time ./${RUN} $j $((${COUNT}/$j)) ./$i
+       if [ $? -ne 0 ]; then
+           echo "Failed $i, exit status $?"
+           exit 1
+       fi
+    done
+done