Added tests directory, which will eventually contain the unit tests for the QRedis client library.
This commit is contained in:
parent
3e49dc65f8
commit
59c4beff21
|
|
@ -3,6 +3,9 @@ cmake_minimum_required(VERSION 2.8.9)
|
|||
|
||||
project(qredis)
|
||||
|
||||
# These options can be used to control the build process.
|
||||
option(BUILD_TESTS "Build the QRedis test suite" ON)
|
||||
|
||||
# These definitions are used to set the target properties later on.
|
||||
set(QREDIS_MAJOR 0)
|
||||
set(QREDIS_MINOR 1)
|
||||
|
|
@ -48,7 +51,7 @@ set_target_properties(qredis PROPERTIES
|
|||
SOVERSION ${QREDIS_MAJOR})
|
||||
|
||||
# This causes the appropriate libraries to be included in the link process.
|
||||
qt5_use_modules(qredis Network)
|
||||
qt5_use_modules(qredis Core Network)
|
||||
|
||||
# Specify the proper installation paths.
|
||||
install(TARGETS qredis
|
||||
|
|
@ -56,3 +59,9 @@ install(TARGETS qredis
|
|||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
PUBLIC_HEADER DESTINATION include/qredis)
|
||||
|
||||
# If the tests are to be built, then add them to the project.
|
||||
if(BUILD_TESTS)
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ void ClientPrivate::readReply()
|
|||
}
|
||||
|
||||
Client::Client(QObject * parent)
|
||||
: QObject(parent), d(new ClientPrivate)
|
||||
: QObject(parent), d(new ClientPrivate(this))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
# The QtTest libraries are required for building the tests.
|
||||
find_package(Qt5Test REQUIRED)
|
||||
|
||||
# Create the test executable.
|
||||
add_executable(qredis-tests
|
||||
main.cpp)
|
||||
|
||||
# Specify the Qt modules the test executable links against.
|
||||
qt5_use_modules(qredis-tests Core Test)
|
||||
|
||||
# Naturally, we also link against the QRedis library.
|
||||
target_link_libraries(qredis-tests qredis)
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
#include <iostream>
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
Loading…
Reference in New Issue