CMakeLists.txt
branchqmlfrontend
changeset 10515 7705784902e1
parent 10440 b74a7bbe224e
parent 10437 e586b8af4569
child 10606 8e95911cb86b
equal deleted inserted replaced
10458:f7a199346c3e 10515:7705784902e1
   230 
   230 
   231 include(${CMAKE_MODULE_PATH}/cpackvars.cmake)
   231 include(${CMAKE_MODULE_PATH}/cpackvars.cmake)
   232 
   232 
   233 enable_testing()
   233 enable_testing()
   234 
   234 
   235 set(LUATESTS "${CMAKE_SOURCE_DIR}/tests/lua")
   235 set(LUATESTS_DIR "${CMAKE_SOURCE_DIR}/tests/lua")
   236 set(LUAAPITESTS "${LUATESTS}/luaAPI")
   236 set(TESTSDATA_DIR "${CMAKE_SOURCE_DIR}/share/hedgewars/Data")
   237 set(TESTSDATADIR "${CMAKE_SOURCE_DIR}/share/hedgewars/Data")
       
   238 
       
   239 
       
   240 add_test("LuaAPI:GetZoom/SetZoom" "bin/hwengine" "--prefix" "${TESTSDATADIR}" "--nosound" "--nomusic" "--lua-test" "${LUAAPITESTS}/zoom_get_set.lua")
       
   241 
   237 
   242 # set set this to "" if you want to see what's going on
   238 # set set this to "" if you want to see what's going on
       
   239 # TODO: engine should do this implicitly when running tests,
       
   240 # unless some env var like HWENGINE_SHOWTESTS is set or something
   243 set(STATSONLYFLAG "--stats-only")
   241 set(STATSONLYFLAG "--stats-only")
   244 add_test("LuaAPI:GetGravity/SetGravity" "bin/hwengine" "--prefix" "${TESTSDATADIR}" "--nosound" "--nomusic" ${STATSONLYFLAG} "--lua-test" "${LUAAPITESTS}/gravity_get_set.lua")
   242 
   245 add_test("DrillRockets_drill" "bin/hwengine" "--prefix" "${TESTSDATADIR}" "--nosound" "--nomusic" ${STATSONLYFLAG} "--lua-test" "${LUATESTS}/drillrockets_drill.lua")
   243 # add all lua tests
   246 add_test("DrillRockets_boom" "bin/hwengine" "--prefix" "${TESTSDATADIR}" "--nosound" "--nomusic" ${STATSONLYFLAG} "--lua-test" "${LUATESTS}/drillrockets_boom.lua")
   244 file(GLOB_RECURSE luatests RELATIVE "${LUATESTS_DIR}" "${LUATESTS_DIR}/*.lua")
   247 add_test("HellishFire_burns" "bin/hwengine" "--prefix" "${TESTSDATADIR}" "--nosound" "--nomusic" ${STATSONLYFLAG} "--lua-test" "${LUATESTS}/hellfire_burns.lua")
   245 foreach(luatest ${luatests})
       
   246     add_test("${luatest}" "bin/hwengine" "--prefix" "${TESTSDATA_DIR}" "--nosound" "--nomusic" "${STATSONLYFLAG}" "--lua-test" "${LUATESTS_DIR}/${luatest}")
       
   247 endforeach(luatest)
       
   248