Skip to content
This repository was archived by the owner on Jun 22, 2021. It is now read-only.

Commit 4f0e538

Browse files
committed
Fix ui-automation tests run script.
1 parent b11d7bd commit 4f0e538

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

ui-automation/run-tests.sh

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#!/bin/sh
22

3+
realpath() {
4+
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
5+
}
6+
37
XCODE_PATH=`xcode-select -print-path`
48
TRACETEMPLATE="/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate"
5-
APP_LOCATION=$1
9+
APP_LOCATION=$(realpath "$1")
610
DEVICE_ID=$2
711

812
if [ ! $# -gt 1 ]; then
@@ -12,12 +16,6 @@ if [ ! $# -gt 1 ]; then
1216
exit -1
1317
fi
1418

15-
# If running on device, only need name of app, full path not important
16-
if [ ! "$DEVICE_ID" = "" ]; then
17-
RUN_ON_SPECIFIC_DEVICE_OPTION="$DEVICE_ID"
18-
APP_LOCATION=`basename $APP_LOCATION`
19-
fi
20-
2119
# Create junit reporting directory
2220
if [ ! -d "test-reports" ]; then
2321
mkdir test-reports
@@ -28,17 +26,17 @@ for script in specs/*
2826
do
2927
if [[ -f $script ]]; then
3028
echo $script
31-
instruments -w "$RUN_ON_SPECIFIC_DEVICE_OPTION" \
29+
instruments -w "$DEVICE_ID" \
3230
-t $TRACETEMPLATE \
3331
$APP_LOCATION \
3432
-e UIASCRIPT $script \
3533
-e UIARESULTSPATH /var/tmp | grep "<" > test-reports/test-results.xml
34+
35+
# cleanup the tracefiles produced from instruments
36+
rm -rf *.trace
3637
fi
3738
done
3839

39-
# cleanup the tracefiles produced from instruments
40-
rm -rf *.trace
41-
4240
# fail script if any failures have been generated
4341
if [ `grep "<failure>" test-reports/test-results.xml | wc -l` -gt 0 ]; then
4442
echo 'Build Failed'

0 commit comments

Comments
 (0)