瀏覽代碼

For Travis CI - last attempt to stabilize Emscripten CI build.

Yao Wei Tjong 姚伟忠 10 年之前
父節點
當前提交
1d52a2e079
共有 1 個文件被更改,包括 4 次插入5 次删除
  1. 4 5
      CMake/Modules/Urho3D-CMake-common.cmake

+ 4 - 5
CMake/Modules/Urho3D-CMake-common.cmake

@@ -1146,12 +1146,11 @@ macro (setup_test)
         list (APPEND ARG_OPTIONS -timeout ${URHO3D_TEST_TIMEOUT})
         if (EMSCRIPTEN)
             if (DEFINED ENV{CI})
-                # The latency on Travis CI server could be very high at time, so set it to the maximum allowed by Travis CI before the process being timed out by Travis CI itself
-                set (EMRUN_TIMEOUT 590)     # 10 minutes (Travis CI timeout) - 10 seconds
-            else ()
-                # Non-CI test
-                math (EXPR EMRUN_TIMEOUT "2 * ${URHO3D_TEST_TIMEOUT}")
+                # The latency on Travis CI server could be very high at time, so add some adjustment
+                # If it is not enough causing a test case failure then so be it because it is better that than wait for it and still ends up in build error due to time limit
+                set (EMRUN_TIMEOUT_ADJUSTMENT + 8 * \\${URHO3D_TEST_TIMEOUT})
             endif ()
+            math (EXPR EMRUN_TIMEOUT "2 * ${URHO3D_TEST_TIMEOUT} ${EMRUN_TIMEOUT_ADJUSTMENT}")
             add_test (NAME ${ARG_NAME} COMMAND ${EMRUN} --browser ${EMSCRIPTEN_EMRUN_BROWSER} --timeout ${EMRUN_TIMEOUT} --timeout_returncode 1 --kill_exit ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET_NAME}.html ${ARG_OPTIONS})
         else ()
             add_test (NAME ${ARG_NAME} COMMAND ${TARGET_NAME} ${ARG_OPTIONS})