mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
CMakeLists: Add runtime tests flag
This commit is contained in:
parent
8fbcbad9ec
commit
b490e4409b
@ -36,6 +36,10 @@ if(NOT CMAKE_BUILD_TYPE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
# Plugin tests flag
|
||||||
|
option(PLUGIN_TESTS "Enable plugin runtime tests" OFF)
|
||||||
|
|
||||||
|
|
||||||
# Qt build stuff
|
# Qt build stuff
|
||||||
set(CMAKE_PREFIX_PATH "${QTDIR}")
|
set(CMAKE_PREFIX_PATH "${QTDIR}")
|
||||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
@ -177,6 +181,10 @@ target_link_libraries(obs-websocket
|
|||||||
Qt5::Network
|
Qt5::Network
|
||||||
nlohmann_json::nlohmann_json)
|
nlohmann_json::nlohmann_json)
|
||||||
|
|
||||||
|
if(PLUGIN_TESTS)
|
||||||
|
target_compile_definitions(obs-websocket PRIVATE PLUGIN_TESTS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Windows-specific build settings and tasks
|
# Windows-specific build settings and tasks
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
@ -170,9 +170,7 @@ void WebSocketApiEventCallback(std::string vendorName, std::string eventType, ob
|
|||||||
_webSocketServer->BroadcastEvent(EventSubscription::Vendors, "VendorEvent", broadcastEventData);
|
_webSocketServer->BroadcastEvent(EventSubscription::Vendors, "VendorEvent", broadcastEventData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PLUGIN_TESTS
|
||||||
#define PLUGIN_API_TEST
|
|
||||||
#ifdef PLUGIN_API_TEST
|
|
||||||
|
|
||||||
static void test_vendor_request_cb(obs_data_t *requestData, obs_data_t *responseData, void *priv_data)
|
static void test_vendor_request_cb(obs_data_t *requestData, obs_data_t *responseData, void *priv_data)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user