summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorpreston.jackson <preston.jackson@861a406c-534a-0410-8894-cb66d6ee9925>2008-10-08 20:24:46 +0000
committerpreston.jackson <preston.jackson@861a406c-534a-0410-8894-cb66d6ee9925>2008-10-08 20:24:46 +0000
commit9210e179469ec720af19da6ad9a4656eb096d8e7 (patch)
treee648b6ebdb36b8e6702363ce5c329805c36d7cf6 /README
parent9d2c8d16f148a95f81944d2020adb987c0d55e7b (diff)
downloadgoogletest-9210e179469ec720af19da6ad9a4656eb096d8e7.tar.gz
Adding tests to Xcode project
git-svn-id: http://googletest.googlecode.com/svn/trunk@102 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'README')
-rw-r--r--README53
1 files changed, 44 insertions, 9 deletions
diff --git a/README b/README
index b2d455a..865ac69 100644
--- a/README
+++ b/README
@@ -153,17 +153,52 @@ Studio project.
Open the gtest.xcodeproj in the xcode/ folder using Xcode. Build the "gtest"
target. The universal binary framework will end up in your selected build
directory (selected in the Xcode "Preferences..." -> "Building" pane and
-defaults to xcode/build).
+defaults to xcode/build). Alternatively, at the command line, enter:
-Alternatively, run "xcodebuild" from the command line in Terminal.app. This
-will build the "Release" configuration of the gtest.framework, but you can
+ $ xcodebuild
+
+This will build the "Release" configuration of the gtest.framework, but you can
select the "Debug" configuration with a command line option. See the
-xcodebuild man page for more information.
-
-To use the gtest.framework, add the framework to your own project.
-Create a new executable target and add the framework to the "Link Binary With
-Libraries" build phase. Select "Edit Active Executable" from the "Project"
-menu. In the "Arguments" tab, add
+"xcodebuild" man page for more information.
+
+To test the gtest.framework in Xcode, change the active target to "Check" and
+then build. This target builds all of the tests and then runs them. Don't worry
+if you see some errors. Xcode reports all test failures (even the intentional
+ones) as errors. However, you should see a "Build succeeded" message at the end
+of the build log. To run all of the tests from the command line, enter:
+
+ $ xcodebuid -target Check
+
+It is also possible to build and execute individual tests within Xcode. Each
+test has its own Xcode "Target" and Xcode "Executable". To build any of the
+tests, change the active target and the active executable to the test of
+interest and then build and run.
+
+NOTE: many of the tests are executed from Python scripts. These tests are
+indicated by a trailing underscore "_" in the test name. These tests should not
+be executed directly. Instead a custom Xcode "Executable" was created to run the
+Python script from within Xcode. These custom executables do not have the
+trailing underscore in the name. For example, to run the gtest_color_test, set
+the active target to "gtest_color_test_" (with a trailing underscore). This
+target will build the gtest_color_test_, which should not be run directly.
+Then set the active executable to "gtest_color_test" (no trailing underscore).
+This executable will execute the gtest_color_test_ from within the
+gtest_color_test.py script).
+
+Individual tests can be built from the command line using:
+
+ $ xcodebuild -target <test_name>
+
+These tests can be executed from the command line by moving to the build
+directory and then (in bash)
+
+ $ export DYLD_FRAMEWORK_PATH=`pwd`
+ $ ./<test_name> # (e.g. ./gtest_unittest or ./gtest_color_test.py)
+
+To use the gtest.framework for your own tests, first, add the framework to Xcode
+project. Next, create a new executable target and add the framework to the
+"Link Binary With Libraries" build phase. Select "Edit Active Executable" from
+the "Project" menu. In the "Arguments" tab, add
"DYLD_FRAMEWORK_PATH" : "/real/framework/path"