Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed unittest for mac, ctest now works #1001

Merged
merged 2 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ config.json
.misspell-fixer.ignore
compile_commands.json
src/dpp/dpp.rc
.DS_STORE
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ if (NOT DPP_NO_VCPKG AND EXISTS "${_VCPKG_ROOT_DIR}")
HOMEPAGE_URL "https://dpp.dev/"
DESCRIPTION "An incredibly lightweight C++ Discord library."
)

# Required before we add any subdirectories.
if (DPP_BUILD_TEST)
enable_testing(${CMAKE_CURRENT_SOURCE_DIR})
endif()

add_subdirectory(library-vcpkg)
else()
set(PROJECT_NAME "libdpp")
Expand All @@ -79,6 +85,12 @@ else()
HOMEPAGE_URL "https://dpp.dev/"
DESCRIPTION "An incredibly lightweight C++ Discord library."
)

# Required before we add any subdirectories.
if (DPP_BUILD_TEST)
enable_testing(${CMAKE_CURRENT_SOURCE_DIR})
endif()

add_subdirectory(library)
endif()

Expand Down
5 changes: 2 additions & 3 deletions library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,8 @@ if (DPP_BUILD_TEST)
endif()
endforeach()
add_test(
NAME unittests
COMMAND library/unittest
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/library
NAME unittest
COMMAND unittest
)
endif()

Expand Down
2 changes: 2 additions & 0 deletions src/unittest/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ _Pragma("warning( disable : 5105 )"); // 4251 warns when we export classes or st

#ifdef _WIN32
#define SHARED_OBJECT "dpp.dll"
#elif __APPLE__
#define SHARED_OBJECT "libdpp.dylib"
#else
#define SHARED_OBJECT "libdpp.so"
#endif
Expand Down
Loading