Bus Error when trying to run unit tests

392 views
Skip to first unread message

zoul

unread,
Oct 6, 2008, 10:15:48 AM10/6/08
to google-toolbox-for-mac
Hello!

I have installed the unit testing framework and successfully run some
meta tests (checking if STAssertEquals(1, 0) bails out etc.). The
problem is that when I try to start testing my classes, I get a Bus
Error message in the build log:

----8<-----
Building target “Unit Tests” of project “BubbleHead” with
configuration “Debug”
Checking Dependencies
(…)
PhaseScriptExecution "/Users/zoul/BubbleHead/Source/build/
BubbleHead.build/Debug-iphonesimulator/Unit Tests.build/
Script-0D34B3590E960720003EDDD9.sh"
cd /Users/zoul/BubbleHead/Source
/bin/sh -c "\"/Users/zoul/BubbleHead/Source/build/BubbleHead.build/
Debug-iphonesimulator/Unit Tests.build/
Script-0D34B3590E960720003EDDD9.sh\""
No matching processes belonging to you were found
/Users/zoul/BubbleHead/Source/../Libraries/GoogleToolbox/UnitTesting/
RunIPhoneUnitTest.sh:65: note: GTM Enabling zombies
Unit Tests(3923) malloc: protecting edges
Unit Tests(3923) malloc: recording malloc stacks to disk using
standard recorder
Unit Tests(3923) malloc: enabling scribbling to detect mods to free
blocks
Unit Tests(3923) malloc: process 3893 no longer exists, stack logs
deleted from /tmp/stack-logs.3893.Unit Tests.7cwX4v
Unit Tests(3923) malloc: stack logs being written into /tmp/stack-logs.
3923.Unit Tests.doso4z
2008-10-06 16:12:03.837 Unit Tests[3923:10b] Unable to send
CPDistributedMessagingCenter message named
SBRemoteNotificationClientStartedMessage to
com.apple.remotenotification.server: (ipc/send) invalid destination
port
Test Suite '/Users/zoul/BubbleHead/Source/build/Debug-iphonesimulator/
Unit Tests.app' started at 2008-10-06 16:12:03 +0200
Test Suite 'MetaTests' started at 2008-10-06 16:12:03 +0200
Test Case '-[MetaTests testTesting]' passed (0.000 seconds).
Test Suite 'MetaTests' finished at 2008-10-06 16:12:03 +0200.
Executed 1 tests, with 0 failures (0 unexpected) in 0.001 (0.001)
seconds

Test Suite 'SenTestCase' started at 2008-10-06 16:12:03 +0200
Test Suite 'SenTestCase' finished at 2008-10-06 16:12:03 +0200.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000)
seconds

Test Suite 'SpriteTests' started at 2008-10-06 16:12:03 +0200
/Users/zoul/BubbleHead/Source/../Libraries/GoogleToolbox/UnitTesting/
RunIPhoneUnitTest.sh: line 73: 3923 Bus error
"$TARGET_BUILD_DIR/$EXECUTABLE_PATH" -RegisterForSystemEvents

Touch "/Users/zoul/BubbleHead/Source/build/Debug-iphonesimulator/Unit
Tests.app"
cd /Users/zoul/BubbleHead/Source
/usr/bin/touch -c "/Users/zoul/BubbleHead/Source/build/Debug-
iphonesimulator/Unit Tests.app"
----8<-----

What am I doing wrong? (I am using the svn version of the unit testing
code.) Is there anything else I should post to help you find the
problem?

Thanks, T.

Thomas Van Lenten

unread,
Oct 6, 2008, 10:27:21 AM10/6/08
to google-tool...@googlegroups.com

This is probably the telling line.  It's starting what I'm guessing are your tests and crashing out right.  Time to double check your code and/or put it under the debugger to see what's using a bad pointer, etc.

TVL
 

zoul

unread,
Oct 6, 2008, 1:22:11 PM10/6/08
to google-toolbox-for-mac
> > Test Suite 'SpriteTests' started at 2008-10-06 16:12:03 +0200
>
> This is probably the telling line.  It's starting what I'm guessing are your
> tests and crashing out right.  Time to double check your code and/or put it
> under the debugger to see what's using a bad pointer, etc.

OK, I’ve found an article explaining how to debug the unit tests
(http://tinyurl.com/3to2he), I’ll try it tomorrow and see what
happens. Thanks!

T.

zoul

unread,
Oct 7, 2008, 2:36:08 AM10/7/08
to google-toolbox-for-mac
> OK, I’ve found an article explaining how to debug the unit tests
> (http://tinyurl.com/3to2he), I’ll try it tomorrow and see what
> happens.

The article (“Automated Unit Testing with Xcode 3 and Objective-C”)
seems to be an updated version of the unit testing aricle linked from
the wiki, they now seem to do the unit testing a bit differently. Will
the vanilla version described there work for iPhone testing? (If yes,
what is the advantage of the Google Unit Testing toolbox?) Or could
you please explain how do I debug the unit tests done the
GTMSenTestCase way?

Thank you, T.

Dave MacLachlan

unread,
Oct 7, 2008, 10:25:30 AM10/7/08
to google-tool...@googlegroups.com

Debugging unittests on the iPhone should be nothing more than running
your unittest app with the debugger on. The thing they are describing
there is using unittests bundles and injecting them into your
application, which we don't support on the iPhone.

The advantage of GTM is that you can't do unittesting on the iPhone
right now with the standard OCUnit. Also, GTM has several other
features, such as an expanded macro set, user interface unit tests etc.

HTH,
Dave

zoul

unread,
Oct 8, 2008, 12:04:13 PM10/8/08
to google-toolbox-for-mac
> Debugging unittests on the iPhone should be nothing more than running  
> your unittest app with the debugger on.

It is, thanks. I’ve tracked the problem down to OpenGL initialization,
now everything works and I can unit test OpenGL drawing: cool.

T.
Reply all
Reply to author
Forward
0 new messages