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 <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2016-08-03 14:05:32 -04:00
parent 65bbd21669
commit 3b03301e61
3 changed files with 8 additions and 0 deletions

View File

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

View File

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

View File

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