• 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
Testing a framework using SenTestingKit and the debugger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Testing a framework using SenTestingKit and the debugger


  • Subject: Testing a framework using SenTestingKit and the debugger
  • From: Amy <email@hidden>
  • Date: Fri, 15 Jul 2005 00:54:10 -0700

I am trying to test a framework using Xcode 2.1 and the included SenTestingKit. Things aren't going too badly, but I need some help running test cases with the debugger. My system is a dual G5, with O SX 10.4.2 running.

My problem is my test will run in the debugger, but will not stop at my breakpoints and let me step through my test case code.

If somewhat could tell me what is wrong, I would be most appreciative.

Here's how I've got the whole thing set up:

I called my project AFramework.

I created my test target using the instructions in Apple's Unit Testing Guide. That didn't have the specifics for how to set it up if you are testing a framework, so I ended up with the following settings:

    test target name is AFramerworkTestTarget.
    test target is dependent on AFramework
    no Bundle Loader specified
    no Test Host specified
    no Test Rig specified
    added to the other linkers flags: -framework AFramework

At this point the tests run when I build AFramerworkTestTarget and I can see all of the test results and my NSLog output in the build results window. 

So far, so good. However, a couple of tests failed, so I would like to step through the test case code in the debugger to see what's going on.

Using info gathered from this list and the instructions in Apple's Xcode 2.1 User Guide I created a custom executable that points to otest and has the following settings:

General Pane:
    executable path: /Developer/Tools/otest
    working directory set to Build Products directory

Arguments Pane:
    Arguments to be passed on launch are:
        -SenTest All
         AFramerworkTestTarget.octest

    Variables to be set in the environment are:
        DYLD_INSERT_LIBRARIES = /System/Library/PrivateFrameworks/DevToolsBundleInjection.framework/DevToolsBundleInjection
        XCInjectBundle = $(BUILT_PRODUCTS_DIR)/AFramerworkTestTarget.octest


To run, first I click "Build" and get the results in the build results window. Then I click "Debug" to run it in the debugger.

This is the debugger console output, which shows it running in the debugger, having knowledge of the breakpoints I set (see the lines that say pending breakpoint resolved), but never stopping at the breakpoints or showing my test code in the debugger window.



[Session started at 2005-07-15 00:29:15 -0700.]
GNU gdb 6.1-20040303 (Apple version gdb-413) (Wed May 18 10:17:02 GMT 2005)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-apple-darwin".
Loading program into debugger…

tty /dev/ttyp2
Program loaded.
run
[Switching to process 6846 local thread 0xf03]
Running…
Pending breakpoint 1 - ""MyTestCase.m:151" resolved
2005-07-15 00:29:19.695 otest[6846] +[NSATSGlyphGenerator initialize] invocation.  The class is deprecated.
Test Suite 'All tests' started at 2005-07-15 00:29:19 -0700
Test Suite '/System/Library/Frameworks/SenTestingKit.framework(Tests)' started at 2005-07-15 00:29:19 -0700
Test Suite 'SenInterfaceTestCase' started at 2005-07-15 00:29:19 -0700
Test Suite 'SenInterfaceTestCase' finished at 2005-07-15 00:29:19 -0700.
Passed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds

Test Suite '/System/Library/Frameworks/SenTestingKit.framework(Tests)' finished at 2005-07-15 00:29:19 -0700.
Passed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds

Test Suite 'AFramerworkTestTarget.octest(Tests)' started at 2005-07-15 00:29:19 -0700
Test Suite 'MyTestCase' started at 2005-07-15 00:29:19 -0700
2005-07-15 00:29:19.770 otest[6846] Beginning MyTestCase
/Users/amy/AFramework/MyTestCase.m:165: error: -[MyTestCase testBasicFunctions] : "status" should be true. Failure location: Test 5, step 1
/Users/amy/AFramework/MyTestCase.m:197: error: -[MyTestCase testBasicFunctions] : "status" should be true. Failure location: Test 5, step 4
2005-07-15 00:29:21.081 otest[6846] Exiting MyTestCase
Test Case '-[MyTestCase testBasicFunctions]' failed (1.311 seconds).
Test Suite 'MyTestCase' finished at 2005-07-15 00:29:21 -0700.
Passed 1 test, with 2 failures (0 unexpected) in 1.311 (1.312) seconds

Test Suite 'AFramerworkTestTarget.octest(Tests)' finished at 2005-07-15 00:29:21 -0700.
Passed 1 test, with 2 failures (0 unexpected) in 1.311 (1.312) seconds

Test Suite 'All tests' finished at 2005-07-15 00:29:21 -0700.
Passed 1 test, with 2 failures (0 unexpected) in 1.311 (1.314) seconds


Debugger stopped.
Program exited with status value:1.(gdb) 
 _______________________________________________
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: Testing a framework using SenTestingKit and the debugger
      • From: Chris Hanson <email@hidden>
  • Prev by Date: Re: Headers copied to executable
  • Next by Date: Re: Testing a framework using SenTestingKit and the debugger
  • Previous by thread: Re: Headers copied to executable
  • Next by thread: Re: Testing a framework using SenTestingKit and the debugger
  • Index(es):
    • Date
    • Thread