Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita0efd25

Browse files
author
Stewart Gleadow
committed
Re-adding simulator kill, adding instructions
1 parent38bd5a5 commita0efd25

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

‎build_and_run_unit_tests.sh

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ OUTPUT_DIR=/tmp/xcodetest/${MAIN_APP_TARGET}
2525
XCODE_TEST_PATH=${OUTPUT_DIR}/${UNIT_TEST_TARGET}.octest/${UNIT_TEST_TARGET}
2626
XCODE_TEST_LDFLAGS="-all_load -ObjC -framework SenTestingKit${LINK_TO_XCODE_TEST_LIB} -F\"$\(SDKROOT\)/Developer/Library/Frameworks\""
2727

28+
# More reliable if the simulator is not already running
29+
osascript -e'tell app "iPhone Simulator" to quit'
30+
2831
# Build the unit tests bundle, so it can be fed into waxsim
2932
xcodebuild -sdk iphonesimulator -scheme${UNIT_TEST_TARGET} build CONFIGURATION_BUILD_DIR="${OUTPUT_DIR}"
3033
if [[$?!= 0 ]];then
@@ -43,26 +46,33 @@ fi
4346
which waxsim
4447
if [[$?!= 0 ]];then
4548
echo"Could not find 'waxsim', make sure it is installed and try again"
46-
exit1
49+
exit$?
4750
fi
4851

52+
# Warn users that it wont run the tests unless you tweak the linker settings
53+
echo"================="
54+
echo"If tests do not run, make sure you have included XCODE_TEST_LDFLAGS in your linker flags:"
55+
echo" In xcconfigs: OTHER_LDFLAGS =\$(inherited)\$(XCODE_TEST_LDFLAGS)"
56+
echo" In Xcode: set Other Linker Flags to include\$(XCODE_TEST_LDFLAGS)"
57+
echo"================="
58+
4959
# Run the app in the simulator, will automatically load and run unit tests
5060
OUT_FILE=${OUTPUT_DIR}/waxsim.out
51-
waxsim${OUTPUT_DIR}/${MAIN_APP_TARGET}.app -SenTest All -e XCODE_TEST_PATH=${XCODE_TEST_PATH}>${OUT_FILE}2>&1
61+
XCODE_TEST_PATH=${XCODE_TEST_PATH} waxsim${OUTPUT_DIR}/${MAIN_APP_TARGET}.app -SenTest All>${OUT_FILE}2>&1
62+
cat${OUT_FILE}
63+
osascript -e'tell app "iPhone Simulator" to quit'
5264

5365
# if there was a failure, show what waxsim was hiding and crucially return with a non-zero exit code
5466
grep -q": error:"$OUT_FILE
5567
success=`exec grep -c": error:"$OUT_FILE`
5668

5769
if [[$success!= 0 ]];then
58-
cat$OUT_FILE
59-
echo"==========================================="
60-
echo"GUI Tests failed"
61-
echo"==========================================="
70+
echo"================="
71+
echo"Unit Tests Failed"
72+
echo"================="
6273
exit 1
6374
else
64-
grep -v"started"$OUT_FILE| grep"Test Case"
65-
echo"==========================================="
66-
echo"GUI Tests passed"
67-
echo"==========================================="
75+
echo"================="
76+
echo"Unit Tests Passed"
77+
echo"================="
6878
fi

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp