Skip to content

Commit

Permalink
Add doctest as a submodule, change release optimization level
Browse files Browse the repository at this point in the history
  • Loading branch information
mousebyte committed May 10, 2023
1 parent 76ea4e1 commit 72c9f31
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7,110 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "doctest"]
path = doctest
url = https://github.com/doctest/doctest
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ set_target_properties(luaclass PROPERTIES EXPORT_NAME LuaClass)
target_compile_options(luaclass PUBLIC
-fno-strict-aliasing -Wall -Wextra -Wunused -Wno-unused-function
$<$<CONFIG:Debug>:-g3 -ggdb3 -pedantic>
$<$<CONFIG:Release>:-O3 -Wfatal-errors>)
$<$<CONFIG:Release>:-O2 -Wfatal-errors>)

if(LUACLASS_MAIN_PROJECT)
include(GNUInstallDirs)
Expand Down Expand Up @@ -59,6 +59,9 @@ if(LUACLASS_MAIN_PROJECT)
COMPONENT ${projectname_target}Export)
endif()

enable_testing()
add_subdirectory(doctest)
include(doctest/scripts/cmake/doctest.cmake)
add_executable(tests
tests/classes/file.c
tests/classes/signal.c
Expand All @@ -72,7 +75,8 @@ add_executable(tests
tests/udataclass_inheritance.cpp
tests/methodinjection.cpp)
target_compile_features(tests PRIVATE cxx_std_17)
target_link_libraries(tests luaclass)
target_link_libraries(tests luaclass doctest)
doctest_discover_tests(tests)

file(GLOB asset_files ${CMAKE_SOURCE_DIR}/tests/assets/*)
add_custom_target(assets COMMAND ${CMAKE_COMMAND} -E copy_if_different
Expand Down
1 change: 1 addition & 0 deletions doctest
Submodule doctest added at ae7a13
Loading

0 comments on commit 72c9f31

Please sign in to comment.