Skip to content

Commit 42be78a

Browse files
committed
Added saving of errorlog to errorLog.txt
1 parent 75ff98c commit 42be78a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

run

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ on run argv
5353
set unixPathToApplication to (the POSIX path of (appFolderName as alias))
5454

5555
logEvent("Unix Path: " & unixPathToApplication)
56+
57+
set errorLog to " "
5658

5759
repeat with currentDevice in allDevices
5860
changeDevice(currentDevice)
@@ -63,9 +65,9 @@ on run argv
6365

6466
set currentResults to do shell script automationTemplate & " \"" & unixPathToApplication & "\" -e UIASCRIPT \"" & scriptName & "\" -e UIARESULTSPATH Results"
6567

66-
-- TODO: get results and maybe show error message
67-
-- Success response: Pass: xy
68-
-- Error response: Fail: xy
68+
if (currentResults as string) contains "Fail:" then
69+
set errorLog to (errorLog & currentResults)
70+
end if
6971

7072

7173
logEvent(currentResults)
@@ -82,6 +84,11 @@ on run argv
8284
end repeat
8385

8486
do shell script "rm -rf ./instrumentscli*"
87+
88+
if length of errorLog > 10 then
89+
logEvent("Some errors occurred: " & errorLog)
90+
do shell script "echo '" & errorLog & "' > Latest/errorLog.txt"
91+
end if
8592
end run
8693

8794

@@ -107,7 +114,7 @@ on setupFolders()
107114
do shell script "mkdir Results/Build-" & (do shell script "date +'%Y.%m.%d-%H:%M:%S'" as string)
108115

109116
-- Create the link to the latest build
110-
do shell script "rm -rf Latest"
117+
do shell script "rm Latest"
111118
do shell script "ln -s Results/Build-" & (do shell script "date +'%Y.%m.%d-%H:%M:%S'" as string) & " Latest"
112119
try
113120
do shell script "mv Results/Run* Results/Build-" & (do shell script "date +'%Y.%m.%d-%H:%M:%S'" as string) & "/"

0 commit comments

Comments
 (0)