diff --git a/.travis.yml b/.travis.yml index 52c296e..44d11b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,4 +20,4 @@ install: script: - if [ "$TRAVIS_OS_NAME" == "osx" ]; then ./Scripts/ci-osx-test.sh; fi; -- if [ "$TRAVIS_OS_NAME" == "osx" ]; then ./Scripts/ci-linux-test.sh; fi; +- if [ "$TRAVIS_OS_NAME" == "linux" ]; then ./Scripts/ci-linux-test.sh; fi; diff --git a/Scripts/ci-linux-test.sh b/Scripts/ci-linux-test.sh index b0718eb..fc552ff 100644 --- a/Scripts/ci-linux-test.sh +++ b/Scripts/ci-linux-test.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -ex + /opt/Unity/Editor/Unity \ -batchmode \ -nographics \ diff --git a/Scripts/unity.ahk b/Scripts/unity.ahk index 9407ea6..998ef5f 100644 --- a/Scripts/unity.ahk +++ b/Scripts/unity.ahk @@ -17,9 +17,33 @@ SetBatchLines -1 Macro1: Run, C:\Program Files\Unity\Editor\Unity.exe, , , PID -; swap places, App window in CI never get active... Sleep, 5000 -WinActivate, ahk_pid %PID% +; App window in CI never get active... + +; method 1, activate by name +SetTitleMatchMode 2 +WinActivate Unity, , 2 +if ErrorLevel <> 0 +{ + ; method 2, activate by PID + WinActivate, ahk_pid %PID%, , 2 + if ErrorLevel <> 0 + { + ; method 3, activate last + Send !{ESC} + WinActivate, ahk_pid %PID%, , 2 + if ErrorLevel <> 0 + { + ; method 4, position in the center of the screen and click + CoordMode, Mouse, Screen + ;MouseMove, (A_ScreenWidth / 2), (A_ScreenHeight / 2) + Click, (A_ScreenWidth / 2), (A_ScreenHeight / 2) + } + } +} + + +SetTitleMatchMode 1 Sleep, 1000 WinWaitActive, ahk_pid %PID% Sleep, 2500