ADC Home > Reference Library > Reference > Mac OS X > Mac OS X Man Pages

 

This document is a Mac OS X manual page. Manual pages are a command-line technology for providing documentation. You can view these manual pages locally using the man(1) command. These manual pages come from many different sources, and thus, have a variety of writing styles.

This manual page is associated with the Mac OS X developer tools. The software or headers described may not be present on your Mac OS X installation until you install the developer tools package. This package is available on your Mac OS X installation DVD, and the latest versions can be downloaded from developer.apple.com.

For more information about the manual page format, see the manual page for manpages(5).



RunUnitTests(1)           BSD General Commands Manual          RunUnitTests(1)

NAME
     RunUnitTests -- run unit tests for the current target

SYNOPSIS
     RunUnitTests

DESCRIPTION
     RunUnitTests examines its environment to determine what type of test bundle the current target repre-sents, represents,
     sents, and runs the tests in the most appropriate fashion.  If possible, it will run the tests for all
     appropriate architectures in sequence.

     RunUnitTests is intended to be called from a shell script build phase in a unit test bundle target.  It
     expects certain environment variables to be configured from Xcode project build settings; these envi-ronment environment
     ronment variables are described below.  When called from a shell script build phase, RunUnitTests will
     only run tests on build, not on install or any other build action.  See xcodebuild(1) for more informa-tion information
     tion on build actions.

     If no host application is specified in the TEST_HOST environment variable, RunUnitTests will use the
     extension of the test bundle (as specified by the WRAPPER_EXTENSION environment variable) to determine
     whether to use CPlusTestRig(1) or otest(1) to load and run the tests in the test bundle, for extensions
     "cptest" and "octest" respectively.

     If a host application is specified, RunUnitTests will execute the application directly and inject the
     test bundle into the application, and pass arguments to the application to cause its tests to be run
     based on the extension of the test bundle.

     If RunUnitTests is not run from a shell script build phase, unless otherwise specified it will use the
     current working directory as BUILT_PRODUCTS_DIR and assume "build" is the current build action.

ENVIRONMENT
     ACTION              The current build action.  Tests are only run for "build" builds, not "install" or
                         other builds.  Defaults to "build" if unspecified.

     ARCHS               (Optional) The architectures the tests have been built for.  Defaults to the result
                         of arch(1) if not specified.

     DEVELOPER_DIR       The Xcode folder, e.g. "/Developer". Defaults to "/Developer" if unspecified.

     BUILT_PRODUCTS_DIR  The directory containing built products; when tests are run, this is specified as
                         DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH.  Defaults to the current working direc-tory directory
                         tory if unspecified.

     NATIVE_ARCH_ACTUAL  (Optional) The native architecture of the hardware running tests; used to determine
                         the architectures of tests that can be run.  For example, ppc64 hardware can run
                         tests for ppc and ppc64 while i386 hardware can run tests for i386 and ppc.
                         Defaults to the result of arch(1) if not specified.

     PRODUCT_NAME        The name (with no extension) of the product generated by the unit test bundle tar-get. target.
                         get.

     TEST_HOST           (Optional) The full path to an executable into which to "inject" the specified unit
                         test bundle.  For an application, this must be the full path to the application
                         within its wrapper.  Do not set this for frameworks or libraries.

     TEST_RIG            (Optional) The full path to an executable to use as a test rig instead of either
                         CPlusTestRig(1) or otest(1).  The executable must take a path to a test bundle as
                         its sole argument.  Its DYLD_FRAMEWORK_PATH and DYLD_LIBRARY_PATH will be config-ured configured
                         ured to point to the BUILT_PRODUCTS_DIR prior to execution.  Do not set this if you
                         are using one of the default test rigs.

     VALID_ARCHS         (Optional) The architectures for which it is valid to build and run tests, which is
                         normally a superset of the architectures for which the tests are actually built.
                         Defaults to the result of arch(1) if not specified.

     WRAPPER_EXTENSION   The extension of the product generated by the unit test bundle target.
                         RunUnitTests will use this to infer the appropriate test rig to use.  For "cptest"
                         it will use CPlusTestRig(1).  For "octest" it will use otest(1).  For anything
                         else, it will return an error unless a TEST_RIG is also specified.

FILES
     /Developer/Tools/RunUnitTests

SEE ALSO
     arch(1), CPlusTestRig(1), otest(1), xcodebuild(1)

Mac OS X                         April 2, 2008                        Mac OS X

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.