From 3b03301e61a93c61352dcb67e3a2ac7313342ad9 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Wed, 3 Aug 2016 14:05:32 -0400 Subject: [PATCH] tests: Allow disabling the Album Art Fetching test This test can take a long time to run, especially on slow internet connections. Let's add a way to disable it when testing other things. Signed-off-by: Anna Schumaker --- CMakeLists.txt | 1 + tests/CMakeLists.txt | 3 +++ tests/core/tags/album.c | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4f21d5b..7d933b07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ project(Ocarina) # Various options for users option(CONFIG_DEBUG "Compile with debugging symbols" OFF) option(CONFIG_TESTING_VERBOSE "Enable verbose output when running tests" OFF) +option(CONFIG_TESTING_ALBUM_ARTWORK "Enable album art fetching tests" ON) # Configure settings set(CONFIG_MAJOR 6) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 936ccab3..bcd91352 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,8 @@ add_definitions(${DEBUG_OPTIONS} -DCONFIG_TESTING) +if (CONFIG_TESTING_ALBUM_ARTWORK) + add_definitions(${DEBUG_OPTIONS} -DCONFIG_ALBUM_ART_TEST) +endif() # Handle files that depend on CONFIG_TESTING_DIR list(REMOVE_ITEM core ${PROJECT_SOURCE_DIR}/core/file.c) diff --git a/tests/core/tags/album.c b/tests/core/tags/album.c index 3bcb8018..8ee2eb53 100644 --- a/tests/core/tags/album.c +++ b/tests/core/tags/album.c @@ -104,6 +104,7 @@ static void test_album_db() db_deinit(&album_db); } +#ifdef CONFIG_ALBUM_ART_TEST static void test_album_artwork() { struct album *ocarina, *majora, *wind, *ocarina_3d; @@ -153,6 +154,7 @@ static void test_album_artwork() g_free(m_path); g_free(w_path); } +#endif /* CONFIG_ALBUM_ART_TEST */ int main(int argc, char **argv) { @@ -165,7 +167,9 @@ int main(int argc, char **argv) g_test_add_func("/Core/Tags/Album", test_album); g_test_add_func("/Core/Tags/Album/Comparison", test_album_compare); g_test_add_func("/Core/Tags/Album/Database", test_album_db); +#ifdef CONFIG_ALBUM_ART_TEST g_test_add_func("/Core/Tags/Album/Artwork", test_album_artwork); +#endif /* CONFIG_ALBUM_ART_TEST */ ret = g_test_run(); album_db_deinit();