You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use cmake to import a test library. So we can add testing to the project. #3
https://github.com/catchorg/Catch2/blob/devel/docs/other-macros.md shows STATIC_REQUIRE which can be used as a static_assert but it'll show as a pass or fail instead of just failing to compile. Since the code is constexpr I figure something like this would be a good way to go.
Or maybe we could try https://github.com/boost-ext/ut
From the talks I saw it seems neat. I don't know if it's got a static_require like thing or if it needs it. To test the constexpr, since this just uses lambdas, is just assign to a constexpr variable in the lambda and require it to be true.
example ut.cmake file.
enable_testing()
include(FetchContent)
FetchContent_Declare(
ut
GIT_REPOSITORY https://github.com/boost-ext/ut.git
GIT_TAG v1.1.8
)
#FetchContent_MakeAvailable(ut) #includes everything#Below filters out building stuff in this repo when you build all.FetchContent_GetProperties(ut)
if(NOT ut_POPULATED)
FetchContent_Populate(ut)
add_subdirectory(${ut_SOURCE_DIR}${ut_BINARY_DIR}EXCLUDE_FROM_ALL)
endif()
To use this afterwards: (based on example on ut's readme)
Okay I have been trying out ut on my codebase this week. I've mirrored what you've done and started splitting stuff off into another library that isn't gpl. I have a lot of time off next week so maybe I'll work on a PR Monday. :)
Activity
Sebanisu commentedon Mar 1, 2021
Though it seems ut is cpp20 now. I think in an older talk it was cpp17. Yeah it failed to compile, if I was in cpp17 a lot of errors in gcc.
codereport commentedon Mar 5, 2021
I am happy to use either Kris's
utorCatch2. If you open a PR, will be happy to merge.Sebanisu commentedon Mar 6, 2021
Okay I have been trying out
uton my codebase this week. I've mirrored what you've done and started splitting stuff off into another library that isn't gpl. I have a lot of time off next week so maybe I'll work on a PR Monday. :)