Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
5b39a72c
Commit
5b39a72c
authored
May 11, 2014
by
Hugo Beauzée-Luyssen
Browse files
Add unit tests
parent
969b94ae
Changes
4
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
5b39a72c
...
...
@@ -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
)
src/CMakeLists.txt
0 → 100644
View file @
5b39a72c
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
}
)
test/CMakeLists.txt
0 → 100644
View file @
5b39a72c
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
()
test/Tests.cpp
0 → 100644
View file @
5b39a72c
#include
"gtest/gtest.h"
TEST
(
MediaLibary
,
InsertFile
)
{
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment