Skip to content

Instantly share code, notes, and snippets.

@vgrichina
Created November 15, 2011 00:27
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vgrichina/1365687 to your computer and use it in GitHub Desktop.
Save vgrichina/1365687 to your computer and use it in GitHub Desktop.
Patch for RunPlatformUnitTests to allow running iOS application tests in Simulator using xcodebuild
*** /Developer/Platforms/iPhoneSimulator.platform/Developer/Tools/RunPlatformUnitTests 2011-08-30 06:49:13.000000000 +0300
--- /Developer/Platforms/iPhoneSimulator.platform/Developer/Tools/RunPlatformUnitTests.new 2011-11-15 02:21:59.000000000 +0200
***************
*** 90,101 ****
Configure_TEST_ARCHS
if [ "${TEST_HOST}" != "" ]; then
! Warning ${LINENO} "Skipping tests; the iPhoneSimulator platform does not currently support application-hosted tests (TEST_HOST set)."
else
# If no TEST_HOST is specified, assume we're running the test bundle.
RunTestsForBundle "${TEST_BUNDLE_PATH}"
fi
--- 90,103 ----
Configure_TEST_ARCHS
if [ "${TEST_HOST}" != "" ]; then
! #Warning ${LINENO} "Skipping tests; the iPhoneSimulator platform does not currently support application-hosted tests (TEST_HOST set)."
+ export OTHER_TEST_FLAGS="-RegisterForSystemEvents"
+ RunTestsForApplication "${TEST_HOST}" "${TEST_BUNDLE_PATH}"
else
# If no TEST_HOST is specified, assume we're running the test bundle.
RunTestsForBundle "${TEST_BUNDLE_PATH}"
fi
@vgrichina
Copy link
Author

Can be applied using such command:

patch -p0 --ignore-whitespace < RunPlatformUnitTests.patch

@vgrichina
Copy link
Author

Now can be applied as:

cd /Applications/Xcode.app/Contents/Developer
patch -p2 --ignore-whitespace <  /path/to/RunPlatformUnitTests.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment