[grilo-plugins] tests: split tests by plugin
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo-plugins] tests: split tests by plugin
- Date: Sun, 23 Jun 2013 13:28:06 +0000 (UTC)
commit 2f30ba15e34ea613deb74cec1bc8b6d72e343c48
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date: Fri Jun 21 18:56:47 2013 +0000
tests: split tests by plugin
Reorganize files and directories to group tests by plugin.
configure.ac | 2 +
tests/Makefile.am | 119 ++------------------
tests/local-metadata/Makefile.am | 48 ++++++++
.../{test_data => local-metadata/data}/image1.png | 0
.../{test_data => local-metadata/data}/image2.png | 0
.../data}/thumbnail.png | 0
tests/{ => local-metadata}/test_local_metadata.c | 2 +-
tests/tmdb/Makefile.am | 104 +++++++++++++++++
tests/{test_data/tmdb => tmdb/data}/casts.txt | 0
.../tmdb => tmdb/data}/configuration.txt | 0
tests/{test_data/tmdb => tmdb/data}/details.txt | 0
tests/{test_data/tmdb => tmdb/data}/empty-data.ini | 0
tests/{test_data/tmdb => tmdb/data}/fast-by-id.ini | 0
tests/{test_data/tmdb => tmdb/data}/images.txt | 0
tests/{test_data/tmdb => tmdb/data}/keywords.txt | 0
tests/{test_data/tmdb => tmdb/data}/no-details.ini | 0
tests/{test_data/tmdb => tmdb/data}/releases.txt | 0
tests/{test_data/tmdb => tmdb/data}/search.txt | 0
tests/{test_data/tmdb => tmdb/data}/sherlock.ini | 0
tests/{ => tmdb}/test_tmdb_fast_resolution.c | 0
tests/{ => tmdb}/test_tmdb_fast_resolution_by_id.c | 0
tests/{ => tmdb}/test_tmdb_full_resolution.c | 0
tests/{ => tmdb}/test_tmdb_missing_configuration.c | 0
tests/{ => tmdb}/test_tmdb_preconditions.c | 0
tests/{ => tmdb}/test_tmdb_utils.c | 3 +-
tests/{ => tmdb}/test_tmdb_utils.h | 0
26 files changed, 167 insertions(+), 111 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index dcf4b2e..3c1a5e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1190,6 +1190,8 @@ AC_CONFIG_FILES([
src/vimeo/Makefile
src/youtube/Makefile
tests/Makefile
+ tests/local-metadata/Makefile
+ tests/tmdb/Makefile
])
AC_OUTPUT
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a71d0ea..04763bb 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,123 +1,26 @@
#
# Makefile.am
#
-# Author: Iago Toral <itoral igalia com>
+# Author: Juan A. Suarez Romero <jasuarez igalia com>
#
-# Copyright (C) 2010, 2011 Igalia S.L.
+# Copyright (C) 2013 Igalia S.L.
-INCLUDES = @DEPS_CFLAGS@
-
-TESTS =
+SUBDIRS =
if LOCALMETADATA_PLUGIN
-TESTS += \
- test_local_metadata
+SUBDIRS += local-metadata
endif
if TMDB_PLUGIN
-TESTS += \
- test_tmdb_fast_resolution \
- test_tmdb_fast_resolution_by_id \
- test_tmdb_full_resolution \
- test_tmdb_missing_configuration \
- test_tmdb_preconditions
+SUBDIRS += tmdb
endif
-check_PROGRAMS = $(TESTS)
-
-# Let the .c source code know about these paths,
-# even when sourcedir!=builddir, such as during make distcheck:
-#
-# We could set GRL_PLUGIN_PATH here in TESTS_ENVIRONMENT, specifying all the paths (separated by :) to all
the plugins,
-# but it is cleaner to restrict the test to just one plugin by doing it in the code.
-# Note that the tmdb plugin Makefile.am copies the .xml file into .libs so we can use the plugin.
-test_local_metadata_defines = \
- -DGRILO_PLUGINS_TESTS_LOCAL_METADATA_PLUGIN_PATH=\""$(abs_top_builddir)/src/local-metadata/.libs/"\"
-
-test_local_metadata_SOURCES = \
- test_local_metadata.c
-
-test_local_metadata_LDADD = \
- @DEPS_LIBS@ \
- @GTHREAD_LIBS@ \
- @GIO_LIBS@
-
-test_local_metadata_CFLAGS = \
- -DPREFIX=$(prefix) $(test_local_metadata_defines) \
- @GTHREAD_CFLAGS@ \
- @GIO_CFLAGS@
-
-test_tmdb_defines = \
- -DGRILO_PLUGINS_TESTS_TMDB_PLUGIN_PATH=\""$(abs_top_builddir)/src/tmdb/.libs/"\" \
- -DGRILO_PLUGINS_TESTS_TMDB_DATA_PATH=\""$(abs_top_srcdir)/tests/test_data/tmdb/"\"
-
-test_tmdb_preconditions_SOURCES = \
- test_tmdb_preconditions.c \
- test_tmdb_utils.h test_tmdb_utils.c
-
-test_tmdb_preconditions_LDADD = \
- @DEPS_LIBS@
-
-test_tmdb_preconditions_CFLAGS = \
- -DPREFIX=$(prefix) $(test_tmdb_defines)
-
-
-test_tmdb_missing_configuration_SOURCES = \
- test_tmdb_missing_configuration.c \
- test_tmdb_utils.h test_tmdb_utils.c
-
-test_tmdb_missing_configuration_LDADD = \
- @DEPS_LIBS@
-
-test_tmdb_missing_configuration_CFLAGS = \
- -DPREFIX=$(prefix) $(test_tmdb_defines)
-
-test_tmdb_fast_resolution_SOURCES = \
- test_tmdb_fast_resolution.c \
- test_tmdb_utils.h test_tmdb_utils.c
-
-test_tmdb_fast_resolution_LDADD = \
- @DEPS_LIBS@
-
-test_tmdb_fast_resolution_CFLAGS = \
- -DPREFIX=$(prefix) $(test_tmdb_defines)
-
-test_tmdb_fast_resolution_by_id_SOURCES = \
- test_tmdb_fast_resolution_by_id.c \
- test_tmdb_utils.h test_tmdb_utils.c
-
-test_tmdb_fast_resolution_by_id_LDADD = \
- @DEPS_LIBS@
-
-test_tmdb_fast_resolution_by_id_CFLAGS = \
- -DPREFIX=$(prefix) $(test_tmdb_defines)
-
-test_tmdb_full_resolution_SOURCES = \
- test_tmdb_full_resolution.c \
- test_tmdb_utils.h test_tmdb_utils.c
-
-test_tmdb_full_resolution_LDADD = \
- @DEPS_LIBS@
-
-test_tmdb_full_resolution_CFLAGS = \
- -DPREFIX=$(prefix) $(test_tmdb_defines)
-
-# Distribute the tests data:
-dist_noinst_DATA = \
- test_data/tmdb/casts.txt \
- test_data/tmdb/configuration.txt \
- test_data/tmdb/details.txt \
- test_data/tmdb/empty-data.ini \
- test_data/tmdb/fast-by-id.ini \
- test_data/tmdb/images.txt \
- test_data/tmdb/keywords.txt \
- test_data/tmdb/no-details.ini \
- test_data/tmdb/releases.txt \
- test_data/tmdb/search.txt \
- test_data/tmdb/sherlock.ini
+DIST_SUBDIRS = \
+ local-metadata \
+ tmdb
-MAINTAINERCLEANFILES = \
- *.in \
- *~
+MAINTAINERCLEANFILES = \
+ *.in \
+ *~
DISTCLEANFILES = $(MAINTAINERCLEANFILES)
diff --git a/tests/local-metadata/Makefile.am b/tests/local-metadata/Makefile.am
new file mode 100644
index 0000000..2d5a3ab
--- /dev/null
+++ b/tests/local-metadata/Makefile.am
@@ -0,0 +1,48 @@
+#
+# Makefile.am
+#
+# Author: Iago Toral <itoral igalia com>
+#
+# Copyright (C) 2010-2013 Igalia S.L.
+
+INCLUDES = @DEPS_CFLAGS@
+
+TESTS = \
+ test_local_metadata
+
+check_PROGRAMS = $(TESTS)
+
+# Let the .c source code know about these paths,
+# even when sourcedir!=builddir, such as during make distcheck:
+#
+# We could set GRL_PLUGIN_PATH here in TESTS_ENVIRONMENT, specifying all the paths (separated by :) to all
the plugins,
+# but it is cleaner to restrict the test to just one plugin by doing it in the code.
+
+test_local_metadata_defines = \
+ -DGRILO_PLUGINS_TESTS_LOCAL_METADATA_PLUGIN_PATH=\""$(abs_top_builddir)/src/local-metadata/.libs/"\"
+
+test_local_metadata_SOURCES = \
+ test_local_metadata.c
+
+test_local_metadata_LDADD = \
+ @DEPS_LIBS@ \
+ @GTHREAD_LIBS@ \
+ @GIO_LIBS@
+
+test_local_metadata_CFLAGS = \
+ -DPREFIX=$(prefix) \
+ $(test_local_metadata_defines) \
+ @GTHREAD_CFLAGS@ \
+ @GIO_CFLAGS@
+
+# Distribute the tests data:
+dist_noinst_DATA = \
+ data/image1.png \
+ data/image2.png \
+ data/thumbnail.png
+
+MAINTAINERCLEANFILES = \
+ *.in \
+ *~
+
+DISTCLEANFILES = $(MAINTAINERCLEANFILES)
diff --git a/tests/test_data/image1.png b/tests/local-metadata/data/image1.png
similarity index 100%
rename from tests/test_data/image1.png
rename to tests/local-metadata/data/image1.png
diff --git a/tests/test_data/image2.png b/tests/local-metadata/data/image2.png
similarity index 100%
rename from tests/test_data/image2.png
rename to tests/local-metadata/data/image2.png
diff --git a/tests/test_data/thumbnail.png b/tests/local-metadata/data/thumbnail.png
similarity index 100%
rename from tests/test_data/thumbnail.png
rename to tests/local-metadata/data/thumbnail.png
diff --git a/tests/test_local_metadata.c b/tests/local-metadata/test_local_metadata.c
similarity index 99%
rename from tests/test_local_metadata.c
rename to tests/local-metadata/test_local_metadata.c
index add3da4..a6fe9d2 100644
--- a/tests/test_local_metadata.c
+++ b/tests/local-metadata/test_local_metadata.c
@@ -24,7 +24,7 @@
* A small program to test the local-metadata plugin.
*/
-#define TEST_DATA "./test_data"
+#define TEST_DATA "./data"
#define TEST_IMAGE1 TEST_DATA"/image1.png"
#define TEST_IMAGE2 TEST_DATA"/image2.png"
#define TEST_THUMBNAIL TEST_DATA"/thumbnail.png"
diff --git a/tests/tmdb/Makefile.am b/tests/tmdb/Makefile.am
new file mode 100644
index 0000000..8fa2957
--- /dev/null
+++ b/tests/tmdb/Makefile.am
@@ -0,0 +1,104 @@
+#
+# Makefile.am
+#
+# Author: Iago Toral <itoral igalia com>
+#
+# Copyright (C) 2010-2013 Igalia S.L.
+
+INCLUDES = @DEPS_CFLAGS@
+
+TESTS = \
+ test_tmdb_fast_resolution \
+ test_tmdb_fast_resolution_by_id \
+ test_tmdb_full_resolution \
+ test_tmdb_missing_configuration \
+ test_tmdb_preconditions
+
+check_PROGRAMS = $(TESTS)
+
+# Let the .c source code know about these paths,
+# even when sourcedir!=builddir, such as during make distcheck:
+#
+# We could set GRL_PLUGIN_PATH here in TESTS_ENVIRONMENT, specifying all the paths (separated by :) to all
the plugins,
+# but it is cleaner to restrict the test to just one plugin by doing it in the code.
+# Note that the tmdb plugin Makefile.am copies the .xml file into .libs so we can use the plugin.
+
+test_tmdb_defines =
\
+ -DGRILO_PLUGINS_TESTS_TMDB_PLUGIN_PATH=\""$(abs_top_builddir)/src/tmdb/.libs/"\" \
+ -DGRILO_PLUGINS_TESTS_TMDB_DATA_PATH=\""$(abs_top_srcdir)/tests/tmdb/data/"\"
+
+test_tmdb_preconditions_SOURCES = \
+ test_tmdb_preconditions.c \
+ test_tmdb_utils.h test_tmdb_utils.c
+
+test_tmdb_preconditions_LDADD = \
+ @DEPS_LIBS@
+
+test_tmdb_preconditions_CFLAGS = \
+ -DPREFIX=$(prefix) \
+ $(test_tmdb_defines)
+
+
+test_tmdb_missing_configuration_SOURCES = \
+ test_tmdb_missing_configuration.c \
+ test_tmdb_utils.h test_tmdb_utils.c
+
+test_tmdb_missing_configuration_LDADD = \
+ @DEPS_LIBS@
+
+test_tmdb_missing_configuration_CFLAGS = \
+ -DPREFIX=$(prefix) \
+ $(test_tmdb_defines)
+
+test_tmdb_fast_resolution_SOURCES = \
+ test_tmdb_fast_resolution.c \
+ test_tmdb_utils.h test_tmdb_utils.c
+
+test_tmdb_fast_resolution_LDADD = \
+ @DEPS_LIBS@
+
+test_tmdb_fast_resolution_CFLAGS = \
+ -DPREFIX=$(prefix) \
+ $(test_tmdb_defines)
+
+test_tmdb_fast_resolution_by_id_SOURCES = \
+ test_tmdb_fast_resolution_by_id.c \
+ test_tmdb_utils.h test_tmdb_utils.c
+
+test_tmdb_fast_resolution_by_id_LDADD = \
+ @DEPS_LIBS@
+
+test_tmdb_fast_resolution_by_id_CFLAGS = \
+ -DPREFIX=$(prefix) \
+ $(test_tmdb_defines)
+
+test_tmdb_full_resolution_SOURCES = \
+ test_tmdb_full_resolution.c \
+ test_tmdb_utils.h test_tmdb_utils.c
+
+test_tmdb_full_resolution_LDADD = \
+ @DEPS_LIBS@
+
+test_tmdb_full_resolution_CFLAGS = \
+ -DPREFIX=$(prefix) \
+ $(test_tmdb_defines)
+
+# Distribute the tests data:
+dist_noinst_DATA = \
+ data/casts.txt \
+ data/configuration.txt \
+ data/details.txt \
+ data/empty-data.ini \
+ data/fast-by-id.ini \
+ data/images.txt \
+ data/keywords.txt \
+ data/no-details.ini \
+ data/releases.txt \
+ data/search.txt \
+ data/sherlock.ini
+
+MAINTAINERCLEANFILES = \
+ *.in \
+ *~
+
+DISTCLEANFILES = $(MAINTAINERCLEANFILES)
diff --git a/tests/test_data/tmdb/casts.txt b/tests/tmdb/data/casts.txt
similarity index 100%
rename from tests/test_data/tmdb/casts.txt
rename to tests/tmdb/data/casts.txt
diff --git a/tests/test_data/tmdb/configuration.txt b/tests/tmdb/data/configuration.txt
similarity index 100%
rename from tests/test_data/tmdb/configuration.txt
rename to tests/tmdb/data/configuration.txt
diff --git a/tests/test_data/tmdb/details.txt b/tests/tmdb/data/details.txt
similarity index 100%
rename from tests/test_data/tmdb/details.txt
rename to tests/tmdb/data/details.txt
diff --git a/tests/test_data/tmdb/empty-data.ini b/tests/tmdb/data/empty-data.ini
similarity index 100%
rename from tests/test_data/tmdb/empty-data.ini
rename to tests/tmdb/data/empty-data.ini
diff --git a/tests/test_data/tmdb/fast-by-id.ini b/tests/tmdb/data/fast-by-id.ini
similarity index 100%
rename from tests/test_data/tmdb/fast-by-id.ini
rename to tests/tmdb/data/fast-by-id.ini
diff --git a/tests/test_data/tmdb/images.txt b/tests/tmdb/data/images.txt
similarity index 100%
rename from tests/test_data/tmdb/images.txt
rename to tests/tmdb/data/images.txt
diff --git a/tests/test_data/tmdb/keywords.txt b/tests/tmdb/data/keywords.txt
similarity index 100%
rename from tests/test_data/tmdb/keywords.txt
rename to tests/tmdb/data/keywords.txt
diff --git a/tests/test_data/tmdb/no-details.ini b/tests/tmdb/data/no-details.ini
similarity index 100%
rename from tests/test_data/tmdb/no-details.ini
rename to tests/tmdb/data/no-details.ini
diff --git a/tests/test_data/tmdb/releases.txt b/tests/tmdb/data/releases.txt
similarity index 100%
rename from tests/test_data/tmdb/releases.txt
rename to tests/tmdb/data/releases.txt
diff --git a/tests/test_data/tmdb/search.txt b/tests/tmdb/data/search.txt
similarity index 100%
rename from tests/test_data/tmdb/search.txt
rename to tests/tmdb/data/search.txt
diff --git a/tests/test_data/tmdb/sherlock.ini b/tests/tmdb/data/sherlock.ini
similarity index 100%
rename from tests/test_data/tmdb/sherlock.ini
rename to tests/tmdb/data/sherlock.ini
diff --git a/tests/test_tmdb_fast_resolution.c b/tests/tmdb/test_tmdb_fast_resolution.c
similarity index 100%
rename from tests/test_tmdb_fast_resolution.c
rename to tests/tmdb/test_tmdb_fast_resolution.c
diff --git a/tests/test_tmdb_fast_resolution_by_id.c b/tests/tmdb/test_tmdb_fast_resolution_by_id.c
similarity index 100%
rename from tests/test_tmdb_fast_resolution_by_id.c
rename to tests/tmdb/test_tmdb_fast_resolution_by_id.c
diff --git a/tests/test_tmdb_full_resolution.c b/tests/tmdb/test_tmdb_full_resolution.c
similarity index 100%
rename from tests/test_tmdb_full_resolution.c
rename to tests/tmdb/test_tmdb_full_resolution.c
diff --git a/tests/test_tmdb_missing_configuration.c b/tests/tmdb/test_tmdb_missing_configuration.c
similarity index 100%
rename from tests/test_tmdb_missing_configuration.c
rename to tests/tmdb/test_tmdb_missing_configuration.c
diff --git a/tests/test_tmdb_preconditions.c b/tests/tmdb/test_tmdb_preconditions.c
similarity index 100%
rename from tests/test_tmdb_preconditions.c
rename to tests/tmdb/test_tmdb_preconditions.c
diff --git a/tests/test_tmdb_utils.c b/tests/tmdb/test_tmdb_utils.c
similarity index 98%
rename from tests/test_tmdb_utils.c
rename to tests/tmdb/test_tmdb_utils.c
index 20fbb88..e5ac405 100644
--- a/tests/test_tmdb_utils.c
+++ b/tests/tmdb/test_tmdb_utils.c
@@ -25,7 +25,7 @@
#include <float.h>
#define TMDB_PLUGIN_ID "grl-tmdb"
-#define TEST_PATH "test_data/tmdb/"
+#define TEST_PATH "data/"
GrlSource *source = NULL;
@@ -69,4 +69,3 @@ test_shutdown_tmdb (void)
grl_registry_unload_plugin (registry, TMDB_PLUGIN_ID, &error);
g_assert_no_error (error);
}
-
diff --git a/tests/test_tmdb_utils.h b/tests/tmdb/test_tmdb_utils.h
similarity index 100%
rename from tests/test_tmdb_utils.h
rename to tests/tmdb/test_tmdb_utils.h
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]