• 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
Unit testing a Cocoa framework with XCode 3.1.1
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unit testing a Cocoa framework with XCode 3.1.1


  • Subject: Unit testing a Cocoa framework with XCode 3.1.1
  • From: "Cyrus Najmabadi" <email@hidden>
  • Date: Mon, 6 Oct 2008 17:41:05 -0400

Hey all,

I'm currently in the process of creating a cocoa framework that will allow you to read and write Google's ProtocolBuffer format.  The library has been written, and seems to be working ok, so i've moved on to the part where i want ot write a bunch of unit tests to verify behavior, and also to catch regressions.  However, i've finding myself commonly blocked while trying to do this, and no amount of Googling has been able to get my through the issues i'm running into.  I'm hoping that people here can help me

Right now i have the following structure:

ProtocolBuffers.xcodeproj
Contains all of the real code for the framework and produces ProtocolBuffers.framework

ProtocolBuffers-Test.xcodeproj
This has an external framework reference to the framework produced by the previous project.  I've also set the "DYLD_FRAMEWORK_PATH" environment variable in its properties to point to the directory where the framework is built to.  By doing that, i've been able to verify that my test project can run code that references the classes in my framework.

Now, after that, i added a unit test bundle target to ProtocolBuffers-Test.  I added some simple 'do nothing' test methods and i built/ran the test target.  When i do that i get the following error:

    cd /Projects/metasyntactic/trunk/ProtocolBuffers-Test

    ... bunch of setenv stuff i've remove ...

    /bin/sh -c /Projects/metasyntactic/trunk/ProtocolBuffers-Test/build/ProtocolBuffers-Test.build/Debug/Tests.build/Script-74F4E4A70E9A9E6F006D4CE6.sh

/Developer/Tools/RunPlatformUnitTests.include:358: note: Started tests for architectures 'i386'

/Developer/Tools/RunPlatformUnitTests.include:365: note: Running tests for architecture 'i386' (GC OFF)

objc[21452]: GC: forcing GC OFF because OBJC_DISABLE_GC is set

objc[21452]: GC: forcing GC OFF because OBJC_DISABLE_GC is set

2008-10-06 16:49:17.615 otest[21452:80f] Error loading /Projects/metasyntactic/trunk/ProtocolBuffers-Test/build/Debug/Tests.octest/Contents/MacOS/Tests:  dlopen(/Projects/metasyntactic/trunk/ProtocolBuffers-Test/build/Debug/Tests.octest/Contents/MacOS/Tests, 265): Library not loaded: /Users/cyrusn/Library/Frameworks/ProtocolBuffers.framework/Versions/A/ProtocolBuffers

  Referenced from: /Projects/metasyntactic/trunk/ProtocolBuffers-Test/build/Debug/Tests.octest/Contents/MacOS/Tests

  Reason: image not found

2008-10-06 16:49:17.630 otest[21453:203] *** NSTask: Task create for path '/Projects/metasyntactic/trunk/ProtocolBuffers-Test/build/Debug/Tests.octest/Contents/MacOS/Tests' failed: 8, "Exec format error".  Terminating temporary process.

/Developer/Tools/RunPlatformUnitTests.include:387: error: Test rig '/Developer/Tools/otest' exited abnormally with code 5 (it may have crashed).

/Developer/Tools/RunPlatformUnitTests.include:358: note: Started tests for architectures 'i386'

/Developer/Tools/RunPlatformUnitTests.include:365: note: Running tests for architecture 'i386' (GC OFF)

/Developer/Tools/RunPlatformUnitTests.include:387: error: Test rig '/Developer/Tools/otest' exited abnormally with code 5 (it may have crashed).


As you can see, i'm getting an 'image not found' error when the unit tests look for my library.  How can i tell it to look in the build path of my other project?  Alternatively, how can i install my library as part of building so that the unit tests will be able to find it in the path they're currently looking at?


Thanks!


           -- Cyrus



 _______________________________________________
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: Unit testing a Cocoa framework with XCode 3.1.1
      • From: Chris Hanson <email@hidden>
  • Prev by Date: Re: pthread_t
  • Next by Date: Re: What happened to OSAScriptKit.ibplugin in 3.1.1. ?
  • Previous by thread: Re: What happened to OSAScriptKit.ibplugin in 3.1.1. ?
  • Next by thread: Re: Unit testing a Cocoa framework with XCode 3.1.1
  • Index(es):
    • Date
    • Thread