![]() |
|
|
|
The SenTestingKit has not yet achieved with ProjectBuilder on Mac OS X the level of integration it has before on OPENSTEP and WebObjects. However, you can still run tests from ProjectBuilder in two different ways detailed below: after each build or when running your application.
You can do this by following the next step:
make sure that otest is installed in '/usr/local/bin'
and that the file ProjectBuilderIntegration/PBX/Makefiles/Resources/OCUnit/RunTargetUnitTests is copied to /Developer/Makefiles/Resources/OCUnit/RunTargetUnitTestscreate a new Build Settings in your chosen Build Style with the name: TEST_AFTER_BUILD and the value to YES
in the Files and Build Phases of your target add a new build phase at the end (menu Project/New BuildPase).
in the text box Shell add: /bin/sh
in the text box Script add: $SYSTEM_DEVELOPER_DIR/Makefiles/Resources/OCUnit/RunTargetUnitTests
When building the active target using the build style with this new environment variable, tests run after the build, and results are logged in the build console.
You can do this by configuring the Executables tab of your target:
For executable targets such as applications, add a -SenTest launch argument (-SenTest All will run all your executable tests, including those of linked frameworks, -SenTest Self will run only your executable's tests, -SenTest None will not run any test).
If your project has no executable (for instance a framework), use otest as the executable, and specify the path of the unit to be tested. For instance: -SenTest Self ~/Developer/Builds/SenRandomTest.framework.
Tests results will appear in the Run or Debug console.Both methods can be used in alternance, as the first is useful to code, build and test in short cycle, while the second can be useful when debugging a failed test.
http://www.sente.ch/software/ocunit/
feedback@sente.ch
©Copyright 1994-2001, Sen:te (Sente, SA). All rights reserved.