chiark / gitweb /
Move tests into their own directory. Means you can 'make -C lib'
authorRichard Kettlewell <rjk@greenend.org.uk>
Sun, 25 May 2008 12:30:41 +0000 (13:30 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sun, 25 May 2008 12:30:41 +0000 (13:30 +0100)
without a huge wait for all the tests to relink.

40 files changed:
.bzrignore
configure.ac
lib/Makefile.am
libtests/Makefile.am [new file with mode: 0644]
libtests/t-addr.c [moved from lib/t-addr.c with 100% similarity]
libtests/t-arcfour.c [moved from lib/t-arcfour.c with 100% similarity]
libtests/t-basen.c [moved from lib/t-basen.c with 100% similarity]
libtests/t-bits.c [moved from lib/t-bits.c with 100% similarity]
libtests/t-cache.c [moved from lib/t-cache.c with 100% similarity]
libtests/t-casefold.c [moved from lib/t-casefold.c with 100% similarity]
libtests/t-cgi.c [moved from lib/t-cgi.c with 100% similarity]
libtests/t-charset.c [moved from lib/t-charset.c with 100% similarity]
libtests/t-cookies.c [moved from lib/t-cookies.c with 100% similarity]
libtests/t-dateparse.c [moved from lib/t-dateparse.c with 100% similarity]
libtests/t-event.c [moved from lib/t-event.c with 100% similarity]
libtests/t-filepart.c [moved from lib/t-filepart.c with 100% similarity]
libtests/t-hash.c [moved from lib/t-hash.c with 100% similarity]
libtests/t-heap.c [moved from lib/t-heap.c with 100% similarity]
libtests/t-hex.c [moved from lib/t-hex.c with 100% similarity]
libtests/t-kvp.c [moved from lib/t-kvp.c with 100% similarity]
libtests/t-macros-1.tmpl [moved from lib/t-macros-1.tmpl with 100% similarity]
libtests/t-macros-2 [moved from lib/t-macros-2 with 100% similarity]
libtests/t-macros.c [moved from lib/t-macros.c with 100% similarity]
libtests/t-mime.c [moved from lib/t-mime.c with 100% similarity]
libtests/t-printf.c [moved from lib/t-printf.c with 100% similarity]
libtests/t-regsub.c [moved from lib/t-regsub.c with 100% similarity]
libtests/t-selection.c [moved from lib/t-selection.c with 100% similarity]
libtests/t-signame.c [moved from lib/t-signame.c with 100% similarity]
libtests/t-sink.c [moved from lib/t-sink.c with 100% similarity]
libtests/t-split.c [moved from lib/t-split.c with 100% similarity]
libtests/t-syscalls.c [moved from lib/t-syscalls.c with 100% similarity]
libtests/t-trackname.c [moved from lib/t-trackname.c with 100% similarity]
libtests/t-unicode.c [moved from lib/t-unicode.c with 100% similarity]
libtests/t-url.c [moved from lib/t-url.c with 100% similarity]
libtests/t-utf8.c [moved from lib/t-utf8.c with 100% similarity]
libtests/t-vector.c [moved from lib/t-vector.c with 100% similarity]
libtests/t-words.c [moved from lib/t-words.c with 100% similarity]
libtests/t-wstat.c [moved from lib/t-wstat.c with 100% similarity]
libtests/test.c [moved from lib/test.c with 100% similarity]
libtests/test.h [moved from lib/test.h with 100% similarity]

index 6e03203..9a5ff0e 100644 (file)
@@ -115,14 +115,14 @@ server/disorder-stats
 *.deb
 *.dsc
 disobedience/disobedience.html
-lib/NormalizationTest.txt
+libtests/NormalizationTest.txt
 lib/CaseFolding.txt
 lib/UnicodeData.txt
 lib/GraphemeBreakProperty.txt
-lib/GraphemeBreakTest.txt
+libtests/GraphemeBreakTest.txt
 lib/WordBreakProperty.txt
 lib/SentenceBreakProperty.txt
-lib/WordBreakTest.txt
+libtests/WordBreakTest.txt
 lib/DerivedNormalizationProps.txt
 tests/*.log
 server/disorder-dbupgrade
@@ -146,34 +146,34 @@ scripts/teardown
 sounds/long.ogg
 sounds/slap.raw
 server/disorder-choose
-lib/t-addr
-lib/t-basen
-lib/t-bits
-lib/t-cache
-lib/t-casefold
-lib/t-cookies
-lib/t-filepart
-lib/t-hash
-lib/t-heap
-lib/t-hex
-lib/t-kvp
-lib/t-mime
-lib/t-printf
-lib/t-regsub
-lib/t-selection
-lib/t-signame
-lib/t-sink
-lib/t-split
-lib/t-syscalls
-lib/t-trackname
-lib/t-unicode
-lib/t-url
-lib/t-utf8
-lib/t-vector
-lib/t-words
-lib/t-wstat
-lib/t-macros
-lib/t-cgi
+libtests/t-addr
+libtests/t-basen
+libtests/t-bits
+libtests/t-cache
+libtests/t-casefold
+libtests/t-cookies
+libtests/t-filepart
+libtests/t-hash
+libtests/t-heap
+libtests/t-hex
+libtests/t-kvp
+libtests/t-mime
+libtests/t-printf
+libtests/t-regsub
+libtests/t-selection
+libtests/t-signame
+libtests/t-sink
+libtests/t-split
+libtests/t-syscalls
+libtests/t-trackname
+libtests/t-unicode
+libtests/t-url
+libtests/t-utf8
+libtests/t-vector
+libtests/t-words
+libtests/t-wstat
+libtests/t-macros
+libtests/t-cgi
 doc/*.tmpl
 doc/disorder_templates.5
 oc/disorder_templates.5.html
@@ -187,7 +187,8 @@ doc/disorder_options.5
 doc/disorder_options.5.html
 doc/disorder_actions.5.in
 doc/disorder_templates.5.in
-lib/t-arcfour
-lib/t-charset
-lib/t-event
-lib/t-dateparse
+libtests/t-arcfour
+libtests/t-charset
+libtests/t-event
+libtests/t-dateparse
+libtests/Makefile
index bfed8b5..beb2803 100644 (file)
@@ -32,6 +32,7 @@ AC_CANONICAL_HOST
 # What we want to build
 want_gtk=yes
 want_python=yes
+want_tests=yes
 
 # APIs we want
 want_alsa=yes
@@ -60,6 +61,10 @@ AC_ARG_WITH([coreaudio],
            [AS_HELP_STRING([--without-coreaudio],
                            [do not build with Core Audio support])],
            [want_coreaudio=$withval])
+AC_ARG_WITH([tests],
+           [AS_HELP_STRING([--without-tests],
+                           [do not build test suit])],
+           [want_tests=$withval])
 
 AC_MSG_CHECKING([for a known target platform])
 case "$host" in
@@ -166,7 +171,11 @@ AC_ARG_WITH([python],
                            [do not build Python support])],
            [want_python=$withval])
 
-subdirs="scripts lib clients doc examples debian"
+subdirs="scripts lib"
+if test $want_tests = yes; then
+  subdirs="${subdirs} libtests"
+fi
+subdirs="${subdirs} clients doc examples debian"
 
 if test $want_server = yes; then
   subdirs="${subdirs} server plugins driver templates sounds images"
@@ -177,7 +186,7 @@ if test $want_gtk = yes; then
     subdirs="${subdirs} images"
   fi
 fi
-if test $want_python = yes; then
+if test $want_tests = yes && test $want_python = yes; then
   AM_PATH_PYTHON([2.4])
   subdirs="${subdirs} python tests"
 fi
@@ -590,6 +599,7 @@ AC_CONFIG_FILES([Makefile
                 sounds/Makefile
                 python/Makefile
                 examples/Makefile
+                libtests/Makefile
                 tests/Makefile])
 AC_OUTPUT
 
index 16cdcea..27ecb2c 100644 (file)
 # USA
 #
 
-TESTS=t-addr t-arcfour t-basen t-bits t-cache t-casefold t-charset     \
-       t-cookies t-dateparse t-event t-filepart t-hash t-heap t-hex    \
-       t-kvp t-mime t-printf t-regsub t-selection t-signame t-sink     \
-       t-split t-syscalls t-trackname t-unicode t-url t-utf8 t-vector  \
-       t-words t-wstat t-macros t-cgi
-
 noinst_LIBRARIES=libdisorder.a
 include_HEADERS=disorder.h
-noinst_PROGRAMS=$(TESTS)
 
 if SERVER
 TRACKDB=trackdb.c
@@ -126,140 +119,6 @@ definitions.h: Makefile
 defs.o: definitions.h versionstring.h
 defs.lo: definitions.h versionstring.h
 
-t_addr_SOURCES=t-addr.c test.c test.h
-t_addr_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_addr_DEPENDENCIES=libdisorder.a
-
-t_arcfour_SOURCES=t-arcfour.c test.c test.h
-t_arcfour_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_arcfour_DEPENDENCIES=libdisorder.a
-
-t_basen_SOURCES=t-basen.c test.c test.h
-t_basen_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_basen_DEPENDENCIES=libdisorder.a
-
-t_bits_SOURCES=t-bits.c test.c test.h
-t_bits_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_bits_DEPENDENCIES=libdisorder.a
-
-t_cache_SOURCES=t-cache.c test.c test.h
-t_cache_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_cache_DEPENDENCIES=libdisorder.a
-
-t_casefold_SOURCES=t-casefold.c test.c test.h
-t_casefold_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_casefold_DEPENDENCIES=libdisorder.a
-
-t_charset_SOURCES=t-charset.c test.c test.h
-t_charset_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_charset_DEPENDENCIES=libdisorder.a
-
-t_cgi_SOURCES=t-cgi.c test.c test.h
-t_cgi_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_cgi_DEPENDENCIES=libdisorder.a
-
-t_cookies_SOURCES=t-cookies.c test.c test.h
-t_cookies_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_cookies_DEPENDENCIES=libdisorder.a
-
-t_dateparse_SOURCES=t-dateparse.c test.c test.h
-t_dateparse_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_dateparse_DEPENDENCIES=libdisorder.a
-
-t_event_SOURCES=t-event.c test.c test.h
-t_event_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_event_DEPENDENCIES=libdisorder.a
-
-t_filepart_SOURCES=t-filepart.c test.c test.h
-t_filepart_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_filepart_DEPENDENCIES=libdisorder.a
-
-t_hash_SOURCES=t-hash.c test.c test.h
-t_hash_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_hash_DEPENDENCIES=libdisorder.a
-
-t_heap_SOURCES=t-heap.c test.c test.h
-t_heap_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_heap_DEPENDENCIES=libdisorder.a
-
-t_hex_SOURCES=t-hex.c test.c test.h
-t_hex_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_hex_DEPENDENCIES=libdisorder.a
-
-t_kvp_SOURCES=t-kvp.c test.c test.h
-t_kvp_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_kvp_DEPENDENCIES=libdisorder.a
-
-t_macros_SOURCES=t-macros.c test.c test.h
-t_macros_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_macros_DEPENDENCIES=libdisorder.a
-
-t_mime_SOURCES=t-mime.c test.c test.h
-t_mime_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_mime_DEPENDENCIES=libdisorder.a
-
-t_printf_SOURCES=t-printf.c test.c test.h
-t_printf_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_printf_DEPENDENCIES=libdisorder.a
-
-t_regsub_SOURCES=t-regsub.c test.c test.h
-t_regsub_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_regsub_DEPENDENCIES=libdisorder.a
-
-t_selection_SOURCES=t-selection.c test.c test.h
-t_selection_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_selection_DEPENDENCIES=libdisorder.a
-
-t_signame_SOURCES=t-signame.c test.c test.h
-t_signame_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_signame_DEPENDENCIES=libdisorder.a
-
-t_sink_SOURCES=t-sink.c test.c test.h
-t_sink_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_sink_DEPENDENCIES=libdisorder.a
-
-t_split_SOURCES=t-split.c test.c test.h
-t_split_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_split_DEPENDENCIES=libdisorder.a
-
-t_syscalls_SOURCES=t-syscalls.c test.c test.h
-t_syscalls_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_syscalls_DEPENDENCIES=libdisorder.a
-
-t_trackname_SOURCES=t-trackname.c test.c test.h
-t_trackname_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_trackname_DEPENDENCIES=libdisorder.a
-
-t_unicode_SOURCES=t-unicode.c test.c test.h
-t_unicode_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_unicode_DEPENDENCIES=libdisorder.a
-
-t_url_SOURCES=t-url.c test.c test.h
-t_url_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_url_DEPENDENCIES=libdisorder.a
-
-t_utf8_SOURCES=t-utf8.c test.c test.h
-t_utf8_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_utf8_DEPENDENCIES=libdisorder.a
-
-t_vector_SOURCES=t-vector.c test.c test.h
-t_vector_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_vector_DEPENDENCIES=libdisorder.a
-
-t_words_SOURCES=t-words.c test.c test.h
-t_words_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_words_DEPENDENCIES=libdisorder.a
-
-t_wstat_SOURCES=t-wstat.c test.c test.h
-t_wstat_LDADD=libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
-t_wstat_DEPENDENCIES=libdisorder.a
-
-check-report: before-check check make-coverage-reports
-before-check:
-       rm -f *.gcda *.gcov
-make-coverage-reports:
-       ${GCOV} *.c | ${PYTHON} ../scripts/format-gcov-report --html . *.c
-
 rebuild-unicode:
        cd ${srcdir} && ${top_srcdir}/scripts/make-unidata
 
@@ -269,4 +128,4 @@ rebuild-unicode:
 
 CLEANFILES=definitions.h definitions.h.new
 
-EXTRA_DIST=trackdb.c trackdb-stub.c t-macros-1.tmpl t-macros-2
+EXTRA_DIST=trackdb.c trackdb-stub.c
diff --git a/libtests/Makefile.am b/libtests/Makefile.am
new file mode 100644 (file)
index 0000000..8a70152
--- /dev/null
@@ -0,0 +1,71 @@
+#
+# This file is part of DisOrder.
+# Copyright (C) 2008 Richard Kettlewell
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA
+#
+
+TESTS=t-addr t-arcfour t-basen t-bits t-cache t-casefold t-charset     \
+       t-cookies t-dateparse t-event t-filepart t-hash t-heap t-hex    \
+       t-kvp t-mime t-printf t-regsub t-selection t-signame t-sink     \
+       t-split t-syscalls t-trackname t-unicode t-url t-utf8 t-vector  \
+       t-words t-wstat t-macros t-cgi
+
+noinst_PROGRAMS=$(TESTS)
+
+AM_CPPFLAGS=-I${top_srcdir}/lib -I../lib
+LDADD=../lib/libdisorder.a $(LIBPCRE) $(LIBICONV) $(LIBGC)
+
+t_addr_SOURCES=t-addr.c test.c test.h
+t_arcfour_SOURCES=t-arcfour.c test.c test.h
+t_basen_SOURCES=t-basen.c test.c test.h
+t_bits_SOURCES=t-bits.c test.c test.h
+t_cache_SOURCES=t-cache.c test.c test.h
+t_casefold_SOURCES=t-casefold.c test.c test.h
+t_charset_SOURCES=t-charset.c test.c test.h
+t_cgi_SOURCES=t-cgi.c test.c test.h
+t_cookies_SOURCES=t-cookies.c test.c test.h
+t_dateparse_SOURCES=t-dateparse.c test.c test.h
+t_event_SOURCES=t-event.c test.c test.h
+t_filepart_SOURCES=t-filepart.c test.c test.h
+t_hash_SOURCES=t-hash.c test.c test.h
+t_heap_SOURCES=t-heap.c test.c test.h
+t_hex_SOURCES=t-hex.c test.c test.h
+t_kvp_SOURCES=t-kvp.c test.c test.h
+t_macros_SOURCES=t-macros.c test.c test.h
+t_mime_SOURCES=t-mime.c test.c test.h
+t_printf_SOURCES=t-printf.c test.c test.h
+t_regsub_SOURCES=t-regsub.c test.c test.h
+t_selection_SOURCES=t-selection.c test.c test.h
+t_signame_SOURCES=t-signame.c test.c test.h
+t_sink_SOURCES=t-sink.c test.c test.h
+t_split_SOURCES=t-split.c test.c test.h
+t_syscalls_SOURCES=t-syscalls.c test.c test.h
+t_trackname_SOURCES=t-trackname.c test.c test.h
+t_unicode_SOURCES=t-unicode.c test.c test.h
+t_url_SOURCES=t-url.c test.c test.h
+t_utf8_SOURCES=t-utf8.c test.c test.h
+t_vector_SOURCES=t-vector.c test.c test.h
+t_words_SOURCES=t-words.c test.c test.h
+t_wstat_SOURCES=t-wstat.c test.c test.h
+
+check-report: before-check check make-coverage-reports
+before-check:
+       rm -f *.gcda *.gcov
+make-coverage-reports:
+       ${GCOV} *.c | ${PYTHON} ../scripts/format-gcov-report --html . *.c
+
+EXTRA_DIST=t-macros-1.tmpl t-macros-2
similarity index 100%
rename from lib/t-addr.c
rename to libtests/t-addr.c
similarity index 100%
rename from lib/t-arcfour.c
rename to libtests/t-arcfour.c
similarity index 100%
rename from lib/t-basen.c
rename to libtests/t-basen.c
similarity index 100%
rename from lib/t-bits.c
rename to libtests/t-bits.c
similarity index 100%
rename from lib/t-cache.c
rename to libtests/t-cache.c
similarity index 100%
rename from lib/t-casefold.c
rename to libtests/t-casefold.c
similarity index 100%
rename from lib/t-cgi.c
rename to libtests/t-cgi.c
similarity index 100%
rename from lib/t-charset.c
rename to libtests/t-charset.c
similarity index 100%
rename from lib/t-cookies.c
rename to libtests/t-cookies.c
similarity index 100%
rename from lib/t-dateparse.c
rename to libtests/t-dateparse.c
similarity index 100%
rename from lib/t-event.c
rename to libtests/t-event.c
similarity index 100%
rename from lib/t-filepart.c
rename to libtests/t-filepart.c
similarity index 100%
rename from lib/t-hash.c
rename to libtests/t-hash.c
similarity index 100%
rename from lib/t-heap.c
rename to libtests/t-heap.c
similarity index 100%
rename from lib/t-hex.c
rename to libtests/t-hex.c
similarity index 100%
rename from lib/t-kvp.c
rename to libtests/t-kvp.c
similarity index 100%
rename from lib/t-macros-1.tmpl
rename to libtests/t-macros-1.tmpl
similarity index 100%
rename from lib/t-macros-2
rename to libtests/t-macros-2
similarity index 100%
rename from lib/t-macros.c
rename to libtests/t-macros.c
similarity index 100%
rename from lib/t-mime.c
rename to libtests/t-mime.c
similarity index 100%
rename from lib/t-printf.c
rename to libtests/t-printf.c
similarity index 100%
rename from lib/t-regsub.c
rename to libtests/t-regsub.c
similarity index 100%
rename from lib/t-selection.c
rename to libtests/t-selection.c
similarity index 100%
rename from lib/t-signame.c
rename to libtests/t-signame.c
similarity index 100%
rename from lib/t-sink.c
rename to libtests/t-sink.c
similarity index 100%
rename from lib/t-split.c
rename to libtests/t-split.c
similarity index 100%
rename from lib/t-syscalls.c
rename to libtests/t-syscalls.c
similarity index 100%
rename from lib/t-trackname.c
rename to libtests/t-trackname.c
similarity index 100%
rename from lib/t-unicode.c
rename to libtests/t-unicode.c
similarity index 100%
rename from lib/t-url.c
rename to libtests/t-url.c
similarity index 100%
rename from lib/t-utf8.c
rename to libtests/t-utf8.c
similarity index 100%
rename from lib/t-vector.c
rename to libtests/t-vector.c
similarity index 100%
rename from lib/t-words.c
rename to libtests/t-words.c
similarity index 100%
rename from lib/t-wstat.c
rename to libtests/t-wstat.c
similarity index 100%
rename from lib/test.c
rename to libtests/test.c
similarity index 100%
rename from lib/test.h
rename to libtests/test.h