Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #83 from hborders/master

Run $IPHONE_SIMULATOR_ROOT/libexec/securityd during tests
  • Loading branch information...
commit 92bf766b0d03e958f76dc4bcdc767f725b1c3cd2 2 parents de2cbbd + 56312fc
@gabriel gabriel authored
Showing with 23 additions and 0 deletions.
  1. +10 −0 Scripts/RunIPhoneSecurityd.sh
  2. +13 −0 Scripts/RunTests.sh
View
10 Scripts/RunIPhoneSecurityd.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+set -u
+
+export DYLD_ROOT_PATH="$1"
+export IPHONE_SIMULATOR_ROOT="$1"
+export CFFIXED_USER_HOME="$2"
+
+"$IPHONE_SIMULATOR_ROOT"/usr/libexec/securityd
View
13 Scripts/RunTests.sh
@@ -8,6 +8,13 @@ fi
export DYLD_ROOT_PATH="$SDKROOT"
export DYLD_FRAMEWORK_PATH="$CONFIGURATION_BUILD_DIR"
export IPHONE_SIMULATOR_ROOT="$SDKROOT"
+export CFFIXED_USER_HOME="$TEMP_FILES_DIR/iPhone Simulator User Dir" # Be compatible with google-toolbox-for-mac
+
+# Always reset CFFIXED_USER_HOME
+if [ -d $"CFFIXED_USER_HOME" ]; then
+ rm -rf "$CFFIXED_USER_HOME"
+fi
+mkdir -p "$CFFIXED_USER_HOME"
export NSDebugEnabled=YES
export NSZombieEnabled=YES
@@ -30,6 +37,12 @@ if [ ! -e "$TEST_TARGET_EXECUTABLE_PATH" ]; then
exit 1
fi
+# If trapping fails, make sure we kill any running securityd
+launchctl list | grep GHUNIT_RunIPhoneSecurityd && launchctl remove GHUNIT_RunIPhoneSecurityd
+SCRIPTS_PATH=`cd $(dirname $0); pwd`
+launchctl submit -l GHUNIT_RunIPhoneSecurityd -- "$SCRIPTS_PATH"/RunIPhoneSecurityd.sh $IPHONE_SIMULATOR_ROOT $CFFIXED_USER_HOME
+trap "launchctl remove GHUNIT_RunIPhoneSecurityd" EXIT TERM INT
+
RUN_CMD="\"$TEST_TARGET_EXECUTABLE_PATH\" -RegisterForSystemEvents"
echo "Running: $RUN_CMD"
Please sign in to comment.
Something went wrong with that request. Please try again.