lizhuext / google-toolbox-for-mac

Automatically exported from code.google.com/p/google-toolbox-for-mac
Apache License 2.0
0 stars 0 forks source link

RunIPhoneUnitTest.sh does not break build on failure. #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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

Original issue reported on code.google.com by clifton....@gmail.com on 23 Jan 2009 at 1:55

Attachments:

GoogleCodeExporter commented 9 years ago
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.

Original comment by thoma...@gmail.com on 24 Jan 2009 at 1:29

GoogleCodeExporter commented 9 years ago
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.

Original comment by thoma...@gmail.com on 30 Jan 2009 at 3:21

GoogleCodeExporter commented 9 years ago
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.

Original comment by aaronmiller@gmail.com on 18 Feb 2009 at 2:02