Added tests directory, which will eventually contain the unit tests for the QRedis client library.

This commit is contained in:
Nathan Osman 2013-07-01 11:25:12 -07:00
parent 3e49dc65f8
commit 59c4beff21
4 changed files with 29 additions and 2 deletions

View File

@ -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()

View File

@ -70,7 +70,7 @@ void ClientPrivate::readReply()
}
Client::Client(QObject * parent)
: QObject(parent), d(new ClientPrivate)
: QObject(parent), d(new ClientPrivate(this))
{
}

12
tests/CMakeLists.txt Normal file
View File

@ -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)

6
tests/main.cpp Normal file
View File

@ -0,0 +1,6 @@
#include <iostream>
int main(int argc, char ** argv)
{
return 0;
}