?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1. set(LUABRIDGE_TEST_SOURCE_FILES
  2.     Source/ArrayTests.cpp
  3.     Source/ClassTests.cpp
  4.     Source/IssueTests.cpp
  5.     Source/IteratorTests.cpp
  6.     Source/LegacyTests.cpp
  7.     Source/ListTests.cpp
  8.     Source/LuaRefTests.cpp
  9.     Source/MapTests.cpp
  10.     Source/NamespaceTests.cpp
  11.     Source/PerformanceTests.cpp
  12.     Source/RefCountedObjectTests.cpp
  13.     Source/RefCountedPtrTests.cpp
  14.     Source/StackTests.cpp
  15.     Source/Tests.cpp
  16.     Source/TestBase.h
  17.     Source/TestTypes.h
  18.     Source/TestsMain.cpp
  19.     Source/UnorderedMapTests.cpp
  20.     Source/VectorTests.cpp
  21. )
  22.  
  23. if(LUABRIDGE_CXX17)
  24.     set(LUABRIDGE_TEST_SOURCE_FILES
  25.         ${LUABRIDGE_TEST_SOURCE_FILES}
  26.         Source/OptionalTests.cpp
  27.     )
  28. endif()
  29.  
  30. source_group("Source" FILES ${LUABRIDGE_TEST_SOURCE_FILES})
  31.  
  32. # Lua 5.1
  33.  
  34. file(GLOB LUABRIDGE_TEST_LUA51_FILES
  35.     RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
  36.     Lua/lua-5.1.5/src/*.c
  37.     Lua/lua-5.1.5/src/*.h
  38.     Lua/LuaLibrary.h
  39. )
  40.  
  41. add_library(Lua51 ${LUABRIDGE_TEST_LUA51_FILES})
  42. target_compile_definitions(Lua51 PUBLIC LUABRIDGE_TEST_LUA_VERSION=501)
  43. target_include_directories(Lua51 PUBLIC Lua/lua-5.1.5/src)
  44. source_group("Source" FILES ${LUABRIDGE_TEST_LUA51_FILES})
  45.  
  46. # Lua 5.2
  47.  
  48. file(GLOB LUABRIDGE_TEST_LUA52_FILES
  49.     RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
  50.     Lua/lua-5.2.4/src/*.c
  51.     Lua/lua-5.2.4/src/*.h
  52.     Lua/lua-5.2.4/src/*.hpp
  53.     Lua/LuaLibrary.h
  54. )
  55.  
  56. add_library(Lua52 ${LUABRIDGE_TEST_LUA52_FILES})
  57. target_compile_definitions(Lua52 PUBLIC LUABRIDGE_TEST_LUA_VERSION=502)
  58. target_include_directories(Lua52 PUBLIC Lua/lua-5.2.4/src)
  59. source_group("Source" FILES ${LUABRIDGE_TEST_LUA52_FILES})
  60.  
  61. # Lua 5.3
  62.  
  63. file(GLOB LUABRIDGE_TEST_LUA53_FILES
  64.     RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
  65.     Lua/lua-5.3.6/src/*.c
  66.     Lua/lua-5.3.6/src/*.h
  67.     Lua/lua-5.3.6/src/*.hpp
  68.     Lua/LuaLibrary.h
  69. )
  70.  
  71. add_library(Lua53 ${LUABRIDGE_TEST_LUA53_FILES})
  72. target_compile_definitions(Lua53 PUBLIC LUABRIDGE_TEST_LUA_VERSION=503)
  73. target_include_directories(Lua53 PUBLIC Lua/lua-5.3.6/src)
  74. source_group("Source" FILES ${LUABRIDGE_TEST_LUA53_FILES})
  75.  
  76. # Lua 5.4
  77.  
  78. file(GLOB LUABRIDGE_TEST_LUA54_FILES
  79.     RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
  80.     Lua/lua-5.4.4/src/*.c
  81.     Lua/lua-5.4.4/src/*.h
  82.     Lua/lua-5.4.4/src/*.hpp
  83.     Lua/LuaLibrary.h
  84. )
  85.  
  86. add_library(Lua54 ${LUABRIDGE_TEST_LUA54_FILES})
  87. target_compile_definitions(Lua54 PUBLIC LUABRIDGE_TEST_LUA_VERSION=504)
  88. target_include_directories(Lua54 PUBLIC Lua/lua-5.4.4/src)
  89. source_group("Source" FILES ${LUABRIDGE_TEST_LUA54_FILES})
  90.  
  91. # Common test app definitions
  92.  
  93. macro(add_test_app APP_NAME LUA_LIBRARY CXX_VERSION)
  94.     add_executable(${APP_NAME}
  95.         ${LUABRIDGE_TEST_SOURCE_FILES}
  96.     )
  97.    
  98.     set_target_properties(${APP_NAME} PROPERTIES
  99.         CXX_STANDARD ${CXX_VERSION}
  100.     )
  101.  
  102.     target_include_directories(${APP_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
  103.  
  104.     target_link_libraries(${APP_NAME}
  105.         LuaBridge
  106.         ${LUA_LIBRARY}
  107.         gtest
  108.     )
  109.  
  110.     add_test(${APP_NAME} ${APP_NAME})
  111. endmacro(add_test_app)
  112.  
  113. # Concrete test apps
  114.  
  115. add_test_app(Tests51 Lua51 14)
  116.  
  117. add_test_app(Tests51Cxx17 Lua51 17)
  118. target_compile_definitions(Tests51Cxx17 PRIVATE LUABRIDGE_CXX17)
  119.  
  120. add_test_app(Tests52 Lua52 14)
  121.  
  122. add_test_app(Tests52Cxx17 Lua52 17)
  123. target_compile_definitions(Tests52Cxx17 PRIVATE LUABRIDGE_CXX17)
  124.  
  125. add_test_app(Tests53 Lua53 14)
  126.  
  127. add_test_app(Tests53Cxx17 Lua53 17)
  128. target_compile_definitions(Tests53Cxx17 PRIVATE LUABRIDGE_CXX17)
  129.  
  130. add_test_app(Tests54 Lua54 14)
  131.  
  132. add_test_app(Tests54Cxx17 Lua54 17)
  133. target_compile_definitions(Tests54Cxx17 PRIVATE LUABRIDGE_CXX17)
  134.