summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuomas Virtanen <katajakasa@gmail.com>2018-06-26 23:39:38 +0300
committerTuomas Virtanen <katajakasa@gmail.com>2018-06-26 23:39:38 +0300
commit3884cbb01d5b652a72fa576f226e2312a1512376 (patch)
tree565302964c18f047ec2efe2f4e4537a5dab81d72
parenta1408ccb182355ce36f0e41ce7a6fb7364645609 (diff)
CMakeLists tweaks, set v1.0.0
-rw-r--r--CMakeLists.txt9
-rw-r--r--tests/CMakeLists.txt18
-rw-r--r--tests/data/CEP140_512kb.mp4bin3628135 -> 0 bytes
-rw-r--r--tests/test_lib.c28
-rw-r--r--tests/test_source.c48
5 files changed, 2 insertions, 101 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9a5d90e..16c45bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,9 +3,9 @@ project(SDL_kitchensink C)
include(GNUInstallDirs)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
-set(KIT_VERSION_MAJOR "0")
+set(KIT_VERSION_MAJOR "1")
set(KIT_VERSION_MINOR "0")
-set(KIT_VERSION_PATCH "7")
+set(KIT_VERSION_PATCH "0")
set(KIT_VERSION ${KIT_VERSION_MAJOR}.${KIT_VERSION_MINOR}.${KIT_VERSION_PATCH})
add_definitions(
-DKIT_VERSION_MAJOR=${KIT_VERSION_MAJOR}
@@ -20,7 +20,6 @@ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -DNDEBUG")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -Os -DNDEBUG")
option(BUILD_EXAMPLES "Build examples" OFF)
-option(BUILD_TESTS "Build unittests" OFF)
option(USE_DYNAMIC_LIBASS "Use dynamically loaded libass" ON)
option(USE_ASAN "Use AddressSanitizer" OFF)
@@ -37,10 +36,6 @@ set(INCLUDES
${FFMPEG_INCLUDE_DIRS}
)
-if(BUILD_TESTS)
- add_subdirectory(tests)
-endif()
-
if(USE_DYNAMIC_LIBASS)
if(WIN32 OR MINGW OR MSYS)
set(DYNAMIC_LIBASS_NAME "\"libass-9.dll\"")
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
deleted file mode 100644
index ddfe4f9..0000000
--- a/tests/CMakeLists.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-find_package(CUnit)
-
-add_executable(test_lib
- test_lib.c
- test_source.c
-)
-
-include_directories(${CUNIT_INCLUDE_DIR} . ../include/)
-if(MINGW)
- target_link_libraries(test_lib mingw32)
-endif()
-target_link_libraries(test_lib
- SDL_kitchensink_static
- ${CUNIT_LIBRARIES}
- ${SDL2_LIBRARIES}
- ${FFMPEG_LIBRARIES}
-)
-add_custom_target(unittest test_lib)
diff --git a/tests/data/CEP140_512kb.mp4 b/tests/data/CEP140_512kb.mp4
deleted file mode 100644
index 4341032..0000000
--- a/tests/data/CEP140_512kb.mp4
+++ /dev/null
Binary files differ
diff --git a/tests/test_lib.c b/tests/test_lib.c
deleted file mode 100644
index 92eb058..0000000
--- a/tests/test_lib.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <CUnit/CUnit.h>
-#include <CUnit/Basic.h>
-#include "kitchensink/kitchensink.h"
-
-void source_test_suite(CU_pSuite suite);
-
-int main(int argc, char **argv) {
- CU_pSuite suite = NULL;
-
- Kit_Init(KIT_INIT_NETWORK|KIT_INIT_FORMATS);
-
- if(CU_initialize_registry() != CUE_SUCCESS) {
- return CU_get_error();
- }
-
- suite = CU_add_suite("Source functions", NULL, NULL);
- if(suite == NULL) goto end;
- source_test_suite(suite);
-
- // Run tests
- CU_basic_set_mode(CU_BRM_VERBOSE);
- CU_basic_run_tests();
-
-end:
- CU_cleanup_registry();
- Kit_Quit();
- return CU_get_error();
-}
diff --git a/tests/test_source.c b/tests/test_source.c
deleted file mode 100644
index 0f70635..0000000
--- a/tests/test_source.c
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <CUnit/CUnit.h>
-#include <CUnit/Basic.h>
-#include <kitchensink/kitchensink.h>
-
-Kit_Source *src = NULL;
-
-void test_Kit_CreateSourceFromUrl(void) {
- CU_ASSERT_PTR_NULL(Kit_CreateSourceFromUrl("nonexistent"));
- src = Kit_CreateSourceFromUrl("../../tests/data/CEP140_512kb.mp4");
- CU_ASSERT_PTR_NOT_NULL(src);
-}
-
-void test_Kit_GetBestSourceStream(void) {
- CU_ASSERT(Kit_GetBestSourceStream(src, KIT_STREAMTYPE_VIDEO) == 0);
- CU_ASSERT(Kit_GetBestSourceStream(src, KIT_STREAMTYPE_AUDIO) == 1);
- CU_ASSERT(Kit_GetBestSourceStream(src, KIT_STREAMTYPE_UNKNOWN) == -1);
- CU_ASSERT(Kit_GetBestSourceStream(src, KIT_STREAMTYPE_DATA) == -1);
- CU_ASSERT(Kit_GetBestSourceStream(src, KIT_STREAMTYPE_ATTACHMENT) == -1);
- CU_ASSERT(Kit_GetBestSourceStream(src, KIT_STREAMTYPE_SUBTITLE) == -1);
-}
-
-void test_Kit_GetSourceStreamCount(void) {
- CU_ASSERT(Kit_GetSourceStreamCount(src) == 2);
-}
-
-void test_Kit_SetSourceStream(void) {
- CU_ASSERT(Kit_SetSourceStream(src, KIT_STREAMTYPE_VIDEO, 0) == 0);
- CU_ASSERT(Kit_SetSourceStream(src, KIT_STREAMTYPE_UNKNOWN, 0) == 1);
-}
-
-void test_Kit_GetSourceStream(void) {
- CU_ASSERT(Kit_GetSourceStream(src, KIT_STREAMTYPE_VIDEO) == 0);
- CU_ASSERT(Kit_GetSourceStream(src, KIT_STREAMTYPE_AUDIO) == 1);
- CU_ASSERT(Kit_GetSourceStream(src, KIT_STREAMTYPE_UNKNOWN) == -1);
-}
-
-void test_Kit_CloseSource(void) {
- Kit_CloseSource(src);
-}
-
-void source_test_suite(CU_pSuite suite) {
- if(CU_add_test(suite, "Kit_CreateSourceFromUrl", test_Kit_CreateSourceFromUrl) == NULL) { return; }
- if(CU_add_test(suite, "Kit_GetBestSourceStream", test_Kit_GetBestSourceStream) == NULL) { return; }
- if(CU_add_test(suite, "Kit_GetSourceStreamCount", test_Kit_GetSourceStreamCount) == NULL) { return; }
- if(CU_add_test(suite, "Kit_SetSourceStream", test_Kit_SetSourceStream) == NULL) { return; }
- if(CU_add_test(suite, "Kit_GetSourceStream", test_Kit_GetSourceStream) == NULL) { return; }
- if(CU_add_test(suite, "Kit_CloseSource", test_Kit_CloseSource) == NULL) { return; }
-}