CMakeLists.txt
branchqmlfrontend
changeset 10515 7705784902e1
parent 10440 b74a7bbe224e
parent 10437 e586b8af4569
child 10606 8e95911cb86b
--- a/CMakeLists.txt	Sun Nov 09 23:02:21 2014 +0300
+++ b/CMakeLists.txt	Tue Nov 18 23:39:30 2014 +0300
@@ -232,16 +232,17 @@
 
 enable_testing()
 
-set(LUATESTS "${CMAKE_SOURCE_DIR}/tests/lua")
-set(LUAAPITESTS "${LUATESTS}/luaAPI")
-set(TESTSDATADIR "${CMAKE_SOURCE_DIR}/share/hedgewars/Data")
-
-
-add_test("LuaAPI:GetZoom/SetZoom" "bin/hwengine" "--prefix" "${TESTSDATADIR}" "--nosound" "--nomusic" "--lua-test" "${LUAAPITESTS}/zoom_get_set.lua")
+set(LUATESTS_DIR "${CMAKE_SOURCE_DIR}/tests/lua")
+set(TESTSDATA_DIR "${CMAKE_SOURCE_DIR}/share/hedgewars/Data")
 
 # set set this to "" if you want to see what's going on
+# TODO: engine should do this implicitly when running tests,
+# unless some env var like HWENGINE_SHOWTESTS is set or something
 set(STATSONLYFLAG "--stats-only")
-add_test("LuaAPI:GetGravity/SetGravity" "bin/hwengine" "--prefix" "${TESTSDATADIR}" "--nosound" "--nomusic" ${STATSONLYFLAG} "--lua-test" "${LUAAPITESTS}/gravity_get_set.lua")
-add_test("DrillRockets_drill" "bin/hwengine" "--prefix" "${TESTSDATADIR}" "--nosound" "--nomusic" ${STATSONLYFLAG} "--lua-test" "${LUATESTS}/drillrockets_drill.lua")
-add_test("DrillRockets_boom" "bin/hwengine" "--prefix" "${TESTSDATADIR}" "--nosound" "--nomusic" ${STATSONLYFLAG} "--lua-test" "${LUATESTS}/drillrockets_boom.lua")
-add_test("HellishFire_burns" "bin/hwengine" "--prefix" "${TESTSDATADIR}" "--nosound" "--nomusic" ${STATSONLYFLAG} "--lua-test" "${LUATESTS}/hellfire_burns.lua")
+
+# add all lua tests
+file(GLOB_RECURSE luatests RELATIVE "${LUATESTS_DIR}" "${LUATESTS_DIR}/*.lua")
+foreach(luatest ${luatests})
+    add_test("${luatest}" "bin/hwengine" "--prefix" "${TESTSDATA_DIR}" "--nosound" "--nomusic" "${STATSONLYFLAG}" "--lua-test" "${LUATESTS_DIR}/${luatest}")
+endforeach(luatest)
+