• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Debugging dependent unit tests under Xcode 3
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Debugging dependent unit tests under Xcode 3


  • Subject: Debugging dependent unit tests under Xcode 3
  • From: Fritz Anderson <email@hidden>
  • Date: Mon, 10 Mar 2008 14:14:26 -0500

I am sure I saw this answered on this list some time in the past, but Google is not helping me. I am not able to debug dependent unit tests on my application under Xcode 3.

My project has two targets, an application and a unit test bundle. The unit test depends on the application.

The test bundle started out as an independent test, but the following changes were made:

BUNDLE_LOADER => $(BUILT_PRODUCTS_DIR}/MyApp.app/Contents/MacOS/MyApp
TEST_HOST => $(BUNDLE_LOADER)

I set one breakpoint in the application, and one in the setUp method of my test suite.

Building the test bundle runs the test and produces expected results. As expected, neither breakpoint is triggered.

Debugging the bundle runs the application; the application breakpoint is hit, the test breakpoint is not. I kind of expect this.

I added to the application executable the following argument:

	-SenTest All

Also the following environment variables (escaped linebreaks not actually present):

XCInjectBundle => $(BUILT_PRODUCTS_DIR)/Tests.octest

DYLD_INSERT_LIBRARIES => /Developer/Library/PrivateFrameworks/\
			DevToolsBundleInjection.framework/Versions/\
			Current/DevToolsBundleInjection
	(Earlier attempts with $(DEVELOPER_LIBRARY_DIR) failed, saying the path
	 could not be resolved.)

DYLD_FALLBACK_FRAMEWORK_PATH => /Developer/Library/Frameworks:\
				/Developer/Library/PrivateFrameworks

Building the test bundle: As before ("Executed 3 tests"). No breakpoints hit.

Building + debugging the test bundle: As before. The test runs with no breakpoints hit, the application launches under the debugger. The following appears in the Debugger Console:

[Switching to process 72847 local thread 0x2f1f]
Test Suite 'All tests' started at 2008-03-10 14:01:56 -0500
Test Suite '/Developer/Library/Frameworks/ SenTestingKit.framework(Tests)' started at 2008-03-10 14:01:56 -0500
Test Suite 'SenInterfaceTestCase' started at 2008-03-10 14:01:56 -0500
Test Suite 'SenInterfaceTestCase' finished at 2008-03-10 14:01:56 -0500.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds


Test Suite '/Developer/Library/Frameworks/ SenTestingKit.framework(Tests)' finished at 2008-03-10 14:01:56 -0500.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds


Test Suite '/Users/fritza/Projects/BuildProducts/Debug/ Tests.octest(Tests)' started at 2008-03-10 14:01:56 -0500
Test Suite 'TestRegression' started at 2008-03-10 14:01:56 -0500
warning: The target crashed on startup, maybe the shell is crashing.
"Try set start-with-shell 0" to workaround.


The Debugger has exited due to signal 6 (SIGABRT).The Debugger has exited due to signal 6 (SIGABRT).

Note that the process reports 0 tests from a couple of SenTestingKit.framework(Tests) suites that I don't know what it is. Then my suite is run, and the application apparently crashes. The application's UI does not appear, and its icon does not appear in the Dock (as it usually does, briefly, under dependent testing).


Debugging the application produces the same results as debugging the test.

Debugging the application: Same

Building + debugging the application: As before. No testing, only the application breakpoint hits.

Turning off all the arguments and environment variables for the executable restores the expected (non-test) behavior.

I'm stuck. Will someone please help me? I'd be grateful.

	— F

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Debugging dependent unit tests under Xcode 3
      • From: Chris Hanson <email@hidden>
  • Prev by Date: Linking to third-party Frameworks and dylibs from a plug-in
  • Next by Date: Re: iPhone Simulator Won't Start w/ Xcode 3.1
  • Previous by thread: Re: Leopard man pages
  • Next by thread: Re: Debugging dependent unit tests under Xcode 3
  • Index(es):
    • Date
    • Thread