My favorites | Sign in
Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 13: RunIPhoneUnitTest.sh does not break build on failure.
2 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  thomasvl
Type-Defect
Priority-Medium


Sign in to add a comment
 
Reported by clifton.craig, Jan 22, 2009
What steps will reproduce the problem?
1. Create a failing unit test using the iPhone unit test support.
2. Run the build in XCode. [Cmd+B]
3. Examine the build result.

What is the expected output? The build should report failure. What do you see instead? Instead 
reports success


What version of the product are you using? On what operating system?
Downloaded early Dec '08 or Late Nov '08, not sure.

Please provide any additional information below.
I have an update to the RunIPhoneUnitTest.sh that I'm inlining below. Feel free to add this to the 
project, mention me on the site, add me as a contributor, or donate $1 million in large bills. 
Whatever suits you.

#Begin RunIPhoneUnitTest.sh
#!/bin/sh
#  RunIPhoneUnitTest.sh
#  Copyright 2008 Google Inc.
#  
#  Licensed under the Apache License, Version 2.0 (the "License"); you may not
#  use this file except in compliance with the License.  You may obtain a copy
#  of the License at
# 
#  http://www.apache.org/licenses/LICENSE-2.0
# 
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
#  License for the specific language governing permissions and limitations under
#  the License.
#
#  Runs all unittests through the iPhone simulator

export DYLD_ROOT_PATH="$SDKROOT"
export DYLD_FRAMEWORK_PATH="$CONFIGURATION_BUILD_DIR"
export IPHONE_SIMULATOR_ROOT="$SDKROOT"
export CFFIXED_USER_HOME="$USER_LIBRARY_DIR/Application Support/iPhone Simulator/User"

echo "Props"
echo "export DYLD_ROOT_PATH=$DYLD_ROOT_PATH"
echo "export DYLD_FRAMEWORK_PATH=$DYLD_FRAMEWORK_PATH"
echo "export IPHONE_SIMULATOR_ROOT=$IPHONE_SIMULATOR_ROOT"
echo "export CFFIXED_USER_HOME=$CFFIXED_USER_HOME"

echo "Starting the build"
"$TARGET_BUILD_DIR/$EXECUTABLE_PATH" -RegisterForSystemEvents 2>&1 | tee .theresults
PASSFAIL=`cat .theresults | tail -1 | awk '{if($5 != 0) print "fail"; else print "pass"}'`
rm .theresults
echo "Build passed? $PASSFAIL"
echo "$PASSFAIL=pass"
if [ "$PASSFAIL" = pass ];
	then
	echo "Exit w/ success"
	exit 0
else
	echo "Exit w/ failure"
	exit -1
fi
#End RunIPhoneUnitTest.sh


RunIPhoneUnitTest.sh
1.5 KB   Download
Comment 1 by thomasvl, Jan 24, 2009
Looks like we might want a merge of this and the patch in http://code.google.com/p/google-toolbox-for-
mac/issues/detail?id=12 since someone can turn off the exit call from the delegate so we'll keep both issues 
opened until we land something for it.
Owner: thomasvl
Comment 2 by thomasvl, Jan 30, 2009
I just landed a code change for the exit status, but i'm gonna keep this open, i'm trying to figure out something 
for the case where the exit status doesn't get set (like for apps that drive the delegate themselves, so exit status 
might still be zero.
Comment 3 by aaronmiller, Feb 17, 2009
Voting for this fix as well so that I can be notified and drop a comment.

Having this functionality would prevent my main project from building (as I want) by making it a dependency on 
my UnitTests target building.
Sign in to add a comment