Commit 5b39a72c authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Add unit tests

parent 969b94ae
......@@ -2,33 +2,5 @@ project(medialibrary)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
list(APPEND HEADERS_LIST
include/IAudioTrackInformation.h
include/ITrackInformation.h
include/IDescription.h
include/IVideoTrackInformation.h
include/IShow.h
include/IShowEpisode.h
include/IAlbum.h
include/IAlbumTrack.h
include/IFile.h
include/IMediaLibrary.h
)
include_directories("include")
list(APPEND SRC_LIST ${HEADERS_LIST}
src/MediaLibrary.cpp
src/SqliteTools.cpp
src/File.cpp
src/Album.cpp
src/Show.cpp
src/Label.cpp
src/AlbumTrack.cpp
src/ShowEpisode.cpp
)
find_package(Sqlite3 REQUIRED)
add_library(${PROJECT_NAME} ${SRC_LIST})
target_link_libraries(${PROJECT_NAME} ${SQLITE3_LIBRARIES})
add_subdirectory( src )
add_subdirectory( test )
project(medialibrary)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
list(APPEND HEADERS_LIST
${CMAKE_SOURCE_DIR}/include/IAudioTrackInformation.h
${CMAKE_SOURCE_DIR}/include/ITrackInformation.h
${CMAKE_SOURCE_DIR}/include/IDescription.h
${CMAKE_SOURCE_DIR}/include/IVideoTrackInformation.h
${CMAKE_SOURCE_DIR}/include/IShow.h
${CMAKE_SOURCE_DIR}/include/IShowEpisode.h
${CMAKE_SOURCE_DIR}/include/IAlbum.h
${CMAKE_SOURCE_DIR}/include/IAlbumTrack.h
${CMAKE_SOURCE_DIR}/include/IFile.h
${CMAKE_SOURCE_DIR}/include/IMediaLibrary.h
)
include_directories("${CMAKE_SOURCE_DIR}/include")
list(APPEND SRC_LIST ${HEADERS_LIST}
MediaLibrary.cpp
SqliteTools.cpp
File.cpp
Album.cpp
Show.cpp
Label.cpp
AlbumTrack.cpp
ShowEpisode.cpp
)
find_package(Sqlite3 REQUIRED)
add_library(${PROJECT_NAME} ${SRC_LIST})
target_link_libraries(${PROJECT_NAME} ${SQLITE3_LIBRARIES})
project(medialibrary)
cmake_minimum_required(VERSION 2.8)
include(ExternalProject)
# Fetch gtest
ExternalProject_Add(
gtest-dependency
SVN_REPOSITORY http://googletest.googlecode.com/svn/trunk/
TIMEOUT 10
# Disable install step
INSTALL_COMMAND ""
UPDATE_COMMAND ""
# Wrap download, configure and build steps in a script to log output
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
)
ExternalProject_Get_Property(gtest-dependency source_dir)
include_directories(${source_dir}/include)
# Also link with gtest:
# fetch the directory which contains the built libraries (gtest & gtest_main)
ExternalProject_Get_Property(gtest-dependency binary_dir)
link_directories(${binary_dir})
add_definitions("-g")
add_definitions("-Wall -Wextra")
include_directories(${CMAKE_SOURCE_DIR}/include)
list(APPEND TEST_SRCS
Tests.cpp
)
add_executable(unittest ${TEST_SRCS})
add_dependencies(unittest gtest-dependency)
target_link_libraries(unittest medialibrary)
target_link_libraries(unittest gtest gtest_main)
# Also add pthread, as gtest requires it
if(UNIX)
target_link_libraries(unittest "pthread")
endif()
#include "gtest/gtest.h"
TEST( MediaLibary, InsertFile )
{
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment