mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-23 20:31:13 +08:00
Prepare project to build under Jenkins
This commit is contained in:
@@ -2578,7 +2578,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
|
||||
shellScript = "# Run the unit tests in this test bundle.\n#\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n\n# Run the unit tests in this test bundle.\n\"${SRCROOT}/Tests/RunPlatformUnitTests\"";
|
||||
};
|
||||
25160E76145651060060A5C5 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
@@ -3102,8 +3102,11 @@
|
||||
GCC_PREFIX_HEADER = "Code/Support/RestKit-Prefix.pch";
|
||||
HEADER_SEARCH_PATHS = "$(SRCROOT)/Tests/Vendor/OCMock";
|
||||
INFOPLIST_FILE = "Resources/PLISTs/RestKitTests-Info.plist";
|
||||
LIBRARY_SEARCH_PATHS = "${CONFIGURATION_BUILD_DIR}";
|
||||
OBJROOT = "$(SRCROOT)/Build";
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SYMROOT = "$(SRCROOT)/Build/Products";
|
||||
WRAPPER_EXTENSION = octest;
|
||||
};
|
||||
name = Debug;
|
||||
@@ -3121,8 +3124,11 @@
|
||||
GCC_PREFIX_HEADER = "Code/Support/RestKit-Prefix.pch";
|
||||
HEADER_SEARCH_PATHS = "$(SRCROOT)/Tests/Vendor/OCMock";
|
||||
INFOPLIST_FILE = "Resources/PLISTs/RestKitTests-Info.plist";
|
||||
LIBRARY_SEARCH_PATHS = "${CONFIGURATION_BUILD_DIR}";
|
||||
OBJROOT = "$(SRCROOT)/Build";
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SYMROOT = "$(SRCROOT)/Build/Products";
|
||||
WRAPPER_EXTENSION = octest;
|
||||
};
|
||||
name = Release;
|
||||
|
||||
142
Tests/RunPlatformUnitTests
Executable file
142
Tests/RunPlatformUnitTests
Executable file
@@ -0,0 +1,142 @@
|
||||
#!/bin/sh
|
||||
##
|
||||
# Copyright 2008 Apple Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# iPhoneSimulator platform
|
||||
# This script runs all of the unit tests for the target test bundle specified by the passed-in environment.
|
||||
# This script is generally intended to be invoked by ${DEVELOPER_TOOLS_DIR}/RunUnitTests. The interface or location of this script may change in future releases.
|
||||
##
|
||||
#
|
||||
# Input:
|
||||
# See ${DEVELOPER_TOOLS_DIR}/RunUnitTests for input variables
|
||||
|
||||
Message() {
|
||||
# usage: Message line type message
|
||||
# Echo the message to stdout as the given type of message and continue
|
||||
echo "${PLATFORM_DEVELOPER_TOOLS_DIR}/Tools/RunPlatformUnitTests:${1}: ${2}: ${3}"
|
||||
}
|
||||
|
||||
Note() {
|
||||
# usage: Notify line message
|
||||
# Echo the message to stdout as a note and continue
|
||||
Message "${1}" note "${2}"
|
||||
}
|
||||
|
||||
Warning() {
|
||||
# usage: Warning line message
|
||||
# Echo the message to stdout as a note and continue
|
||||
Message "${1}" warning "${2}"
|
||||
}
|
||||
|
||||
Error() {
|
||||
# usage: Notify line message
|
||||
# Echo the message to stdout as an error and continue
|
||||
Message "${1}" error "${2}"
|
||||
}
|
||||
|
||||
Fail() {
|
||||
# usage: Fail line message
|
||||
# Echo the message to stdout and return 1, the universal error code
|
||||
Error "${1}" "${2}"
|
||||
exit 1
|
||||
}
|
||||
|
||||
### Do not run tests on anything but a "build".
|
||||
|
||||
if [ "${ACTION}" != "build" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
### Silently skip tests if TEST_AFTER_BUILD is NO
|
||||
|
||||
if [ "${TEST_AFTER_BUILD}" = "NO" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
### Source RunUnitTests.include functionality
|
||||
|
||||
if [ "${DEVELOPER_TOOLS_DIR}" = "" ]; then
|
||||
Fail ${LINENO} "DEVELOPER_TOOLS_DIR is not set."
|
||||
fi
|
||||
|
||||
if [ "${PLATFORM_DEVELOPER_TOOLS_DIR}" = "" ]; then
|
||||
Fail ${LINENO} "PLATFORM_DEVELOPER_TOOLS_DIR is not set."
|
||||
fi
|
||||
|
||||
includeFile="${DEVELOPER_TOOLS_DIR}/RunPlatformUnitTests.include"
|
||||
if [ ! -r "${includeFile}" ]; then
|
||||
Fail ${LINENO} "Cannot read include file ${includeFile}"
|
||||
fi
|
||||
|
||||
source "${includeFile}"
|
||||
|
||||
if [ 0 != $? ]; then
|
||||
Fail ${LINENO} "Could not source include file ${includeFile}"
|
||||
fi
|
||||
|
||||
### Define a sensible default for the path to the otest
|
||||
|
||||
if [ "${OTEST}" = "" ]; then
|
||||
OTEST="${SDKROOT}/Developer/usr/bin/otest"
|
||||
fi
|
||||
|
||||
Main() {
|
||||
# usage: Main
|
||||
# Determine how tests need to be run and run them.
|
||||
|
||||
# GC not supported by the simulator
|
||||
TEST_GC_STATES="OFF"
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
### Update the dyld environment to support running tests out of the build directory.
|
||||
|
||||
# Sets and exports the following environment variables:
|
||||
# DYLD_ROOT_PATH
|
||||
# DYLD_FRAMEWORK_PATH
|
||||
# DYLD_LIBRARY_PATH
|
||||
# DYLD_NEW_LOCAL_SHARED_REGIONS
|
||||
# DYLD_NO_FIX_PREBINDING
|
||||
|
||||
if [ "${DYLD_FRAMEWORK_PATH}" != "" ]; then
|
||||
DYLD_FRAMEWORK_PATH="${BUILT_PRODUCTS_DIR}:${SDKROOT}${DEVELOPER_LIBRARY_DIR}/Frameworks:${DYLD_FRAMEWORK_PATH}"
|
||||
else
|
||||
DYLD_FRAMEWORK_PATH="${BUILT_PRODUCTS_DIR}:${SDKROOT}${DEVELOPER_LIBRARY_DIR}/Frameworks"
|
||||
fi
|
||||
|
||||
if [ "${DYLD_LIBRARY_PATH}" != "" ]; then
|
||||
DYLD_LIBRARY_PATH="${BUILT_PRODUCTS_DIR}:${DYLD_LIBRARY_PATH}"
|
||||
else
|
||||
DYLD_LIBRARY_PATH="${BUILT_PRODUCTS_DIR}"
|
||||
fi
|
||||
|
||||
if [ "${DYLD_ROOT_PATH}" != "" ]; then
|
||||
DYLD_ROOT_PATH="${SDKROOT}:${DYLD_ROOT_PATH}"
|
||||
else
|
||||
DYLD_ROOT_PATH="${SDKROOT}"
|
||||
fi
|
||||
|
||||
DYLD_NEW_LOCAL_SHARED_REGIONS=YES
|
||||
DYLD_NO_FIX_PREBINDING=YES
|
||||
IPHONE_SIMULATOR_ROOT=$SDKROOT ## rdar://6528939
|
||||
CFFIXED_USER_HOME="${HOME}/Library/Application Support/iPhone Simulator/$IPHONESIMULATOR_PLATFORM_VERSION"
|
||||
|
||||
EXPORT_VARS=(DYLD_FRAMEWORK_PATH DYLD_LIBRARY_PATH DYLD_NEW_LOCAL_SHARED_REGIONS DYLD_NO_FIX_PREBINDING DYLD_ROOT_PATH IPHONE_SIMULATOR_ROOT CFFIXED_USER_HOME )
|
||||
|
||||
### Run the tests
|
||||
|
||||
Main
|
||||
Reference in New Issue
Block a user