[Xcb] [PATCH util-image 09/12] test: move test cases into their own directory

Gaetan Nadon memsize at videotron.ca
Thu Apr 3 16:33:21 PDT 2014


Seperate building the production code from the test programs, out of
principal and as it opens the possibilities of simplification in
follow-up patches. Avoid file names like test_xcb_image_shm-test_xcb_image_shm

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 Makefile.am                          |    2 +-
 configure.ac                         |    1 +
 image/Makefile.am                    |   31 -------------------------------
 {image => test}/.gitignore           |    0
 test/Makefile.am                     |   29 +++++++++++++++++++++++++++++
 {image => test}/test.xbm             |    0
 {image => test}/test_bitmap.c        |    0
 {image => test}/test_formats.c       |    0
 {image => test}/test_swap.c          |    0
 {image => test}/test_xcb_image.c     |    0
 {image => test}/test_xcb_image_shm.c |    0
 11 files changed, 31 insertions(+), 32 deletions(-)
 rename {image => test}/.gitignore (100%)
 create mode 100644 test/Makefile.am
 rename {image => test}/test.xbm (100%)
 rename {image => test}/test_bitmap.c (100%)
 rename {image => test}/test_formats.c (100%)
 rename {image => test}/test_swap.c (100%)
 rename {image => test}/test_xcb_image.c (100%)
 rename {image => test}/test_xcb_image_shm.c (100%)

diff --git a/Makefile.am b/Makefile.am
index 21d2066..c981823 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,5 +12,5 @@ ChangeLog:
 
 dist-hook: ChangeLog INSTALL
 
-SUBDIRS = image
+SUBDIRS = image test
 EXTRA_DIST = autogen.sh
diff --git a/configure.ac b/configure.ac
index f3a9364..5a9a26c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,6 +19,7 @@ PKG_CHECK_MODULES(XCB_UTIL, xcb-util)
 AC_CONFIG_FILES([
 	Makefile
 	image/Makefile
+	test/Makefile
 	image/xcb-image.pc
 ])
 AC_OUTPUT
diff --git a/image/Makefile.am b/image/Makefile.am
index d32f5a7..30e9c87 100644
--- a/image/Makefile.am
+++ b/image/Makefile.am
@@ -12,34 +12,3 @@ libxcb_image_la_LIBADD = $(XCB_LIBS) $(XCB_SHM_LIBS) $(XCB_UTIL_LIBS)
 libxcb_image_la_LDFLAGS = -no-undefined
 
 pkgconfig_DATA = xcb-image.pc
-
-noinst_PROGRAMS = test_xcb_image test_formats test_bitmap
-
-if HAVE_SHM
-noinst_PROGRAMS += test_xcb_image_shm
-endif
-
-check_PROGRAMS = test_swap
-
-TESTS=test_swap
-
-test_swap_SOURCES = test_swap.c
-test_swap_CPPFLAGS = $(XCB_CFLAGS) $(XCB_SHM_CFLAGS) $(XCB_UTIL_CFLAGS)
-test_swap_LDADD = $(XCB_LIBS) $(XCB_UTIL_LIBS) $(XCB_IMAGE_LIBS)
-
-test_xcb_image_SOURCES = test_xcb_image.c
-test_xcb_image_CPPFLAGS = $(XCB_CFLAGS) $(XCB_SHM_CFLAGS) $(XCB_UTIL_CFLAGS)
-test_xcb_image_LDADD = $(XCB_LIBS) $(XCB_UTIL_LIBS) $(XCB_IMAGE_LIBS)
-
-test_xcb_image_shm_SOURCES = test_xcb_image_shm.c
-test_xcb_image_shm_CPPFLAGS = $(XCB_CFLAGS) $(XCB_SHM_CFLAGS) $(XCB_UTIL_CFLAGS)
-test_xcb_image_shm_LDADD = $(XCB_LIBS) $(XCB_SHM_LIBS) \
-	$(XCB_UTIL_LIBS) $(XCB_IMAGE_LIBS)
-
-test_formats_SOURCES = test_formats.c
-test_formats_CPPFLAGS = $(XCB_CFLAGS) $(XCB_SHM_CFLAGS) $(XCB_UTIL_CFLAGS) $(XPROTO_CFLAGS)
-test_formats_LDADD = $(XCB_LIBS) $(XCB_UTIL_LIBS) $(XCB_IMAGE_LIBS)
-
-test_bitmap_SOURCES = test_bitmap.c test.xbm
-test_bitmap_CPPFLAGS = $(XCB_CFLAGS) $(XCB_SHM_CFLAGS) $(XCB_UTIL_CFLAGS)
-test_bitmap_LDADD = $(XCB_LIBS) $(XCB_UTIL_LIBS) $(XCB_IMAGE_LIBS)
diff --git a/image/.gitignore b/test/.gitignore
similarity index 100%
rename from image/.gitignore
rename to test/.gitignore
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644
index 0000000..1116473
--- /dev/null
+++ b/test/Makefile.am
@@ -0,0 +1,29 @@
+noinst_PROGRAMS = test_xcb_image test_formats test_bitmap
+
+if HAVE_SHM
+noinst_PROGRAMS += test_xcb_image_shm
+endif
+
+check_PROGRAMS = test_swap
+
+TESTS=test_swap
+
+test_swap_SOURCES = test_swap.c
+test_swap_CPPFLAGS = $(XCB_CFLAGS) $(XCB_SHM_CFLAGS) $(XCB_UTIL_CFLAGS) -I$(top_srcdir)/image
+test_swap_LDADD = $(XCB_LIBS) $(XCB_UTIL_LIBS) $(top_builddir)/image/libxcb-image.la
+
+test_xcb_image_SOURCES = test_xcb_image.c
+test_xcb_image_CPPFLAGS = $(XCB_CFLAGS) $(XCB_SHM_CFLAGS) $(XCB_UTIL_CFLAGS) -I$(top_srcdir)/image
+test_xcb_image_LDADD = $(XCB_LIBS) $(XCB_UTIL_LIBS) $(top_builddir)/image/libxcb-image.la
+
+test_xcb_image_shm_SOURCES = test_xcb_image_shm.c
+test_xcb_image_shm_CPPFLAGS = $(XCB_CFLAGS) $(XCB_SHM_CFLAGS) $(XCB_UTIL_CFLAGS) -I$(top_srcdir)/image
+test_xcb_image_shm_LDADD = $(XCB_LIBS) $(XCB_UTIL_LIBS) $(XCB_SHM_LIBS) $(top_builddir)/image/libxcb-image.la
+
+test_formats_SOURCES = test_formats.c
+test_formats_CPPFLAGS = $(XCB_CFLAGS) $(XCB_SHM_CFLAGS) $(XCB_UTIL_CFLAGS) $(XPROTO_CFLAGS) -I$(top_srcdir)/image
+test_formats_LDADD = $(XCB_LIBS) $(XCB_UTIL_LIBS) $(top_builddir)/image/libxcb-image.la
+
+test_bitmap_SOURCES = test_bitmap.c test.xbm
+test_bitmap_CPPFLAGS = $(XCB_CFLAGS) $(XCB_SHM_CFLAGS) $(XCB_UTIL_CFLAGS)  -I$(top_srcdir)/image
+test_bitmap_LDADD = $(XCB_LIBS) $(XCB_UTIL_LIBS) $(top_builddir)/image/libxcb-image.la
diff --git a/image/test.xbm b/test/test.xbm
similarity index 100%
rename from image/test.xbm
rename to test/test.xbm
diff --git a/image/test_bitmap.c b/test/test_bitmap.c
similarity index 100%
rename from image/test_bitmap.c
rename to test/test_bitmap.c
diff --git a/image/test_formats.c b/test/test_formats.c
similarity index 100%
rename from image/test_formats.c
rename to test/test_formats.c
diff --git a/image/test_swap.c b/test/test_swap.c
similarity index 100%
rename from image/test_swap.c
rename to test/test_swap.c
diff --git a/image/test_xcb_image.c b/test/test_xcb_image.c
similarity index 100%
rename from image/test_xcb_image.c
rename to test/test_xcb_image.c
diff --git a/image/test_xcb_image_shm.c b/test/test_xcb_image_shm.c
similarity index 100%
rename from image/test_xcb_image_shm.c
rename to test/test_xcb_image_shm.c
-- 
1.7.9.5



More information about the Xcb mailing list