]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Make unit tests a configurable build option.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 27 Aug 2008 21:12:43 +0000 (21:12 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 27 Aug 2008 21:12:43 +0000 (21:12 +0000)
Make debug printfs a separate configurable build option.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@7871 7a7537e8-13f0-0310-91df-b6672ffda945

24 files changed:
Makedefs.in
Makefile
backend/Makefile
berkeley/Makefile
cgi-bin/Makefile
conf/Makefile
config-scripts/cups-compiler.m4
cups/Makefile
data/Makefile
doc/Makefile
driver/Makefile
filter/Makefile
fonts/Makefile
locale/Makefile
man/Makefile
monitor/Makefile
notifier/Makefile
ppdc/Makefile
scheduler/Makefile
scripting/php/Makefile
standards/Makefile
systemv/Makefile
templates/Makefile
test/Makefile

index 9c39a78513977bee20723012ea21d31231d8eb0c..a4822072d2565fbf29d68da943afc70751dac446 100644 (file)
@@ -152,6 +152,8 @@ PHPDIR              =       @PHPDIR@
 PHPOPTIONS     =       @PHPOPTIONS@ -I../.. `$(PHPCONFIG) --includes`
 SSLFLAGS       =       @SSLFLAGS@
 SSLLIBS                =       @SSLLIBS@
+UNITTESTS      =       @UNITTESTS@
+
 
 #
 # Separate 32/64-bit library support...
index 8ee1e3c4284810093cd3ea9cdbeb653b385a9c7c..86e616026f171994bb47126cbd02080789aeba2f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,8 @@ all:
        echo Using ARCHFLAGS="$(ARCHFLAGS)"
        echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
        echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
+       echo Using CC="$(CC)"
+       echo Using CXX="$(CC)"
        echo Using DSOFLAGS="$(DSOFLAGS)"
        echo Using LDFLAGS="$(LDFLAGS)"
        echo Using LIBS="$(LIBS)"
@@ -51,6 +53,8 @@ libs:
        echo Using ARCHFLAGS="$(ARCHFLAGS)"
        echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
        echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
+       echo Using CC="$(CC)"
+       echo Using CXX="$(CC)"
        echo Using DSOFLAGS="$(DSOFLAGS)"
        echo Using LDFLAGS="$(LDFLAGS)"
        echo Using LIBS="$(LIBS)"
@@ -60,6 +64,25 @@ libs:
        done
 
 
+#
+# Make unit test targets...
+#
+
+unittests:
+       echo Using ARCHFLAGS="$(ARCHFLAGS)"
+       echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
+       echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
+       echo Using CC="$(CC)"
+       echo Using CXX="$(CC)"
+       echo Using DSOFLAGS="$(DSOFLAGS)"
+       echo Using LDFLAGS="$(LDFLAGS)"
+       echo Using LIBS="$(LIBS)"
+       for dir in $(DIRS); do\
+               echo Making all in $$dir... ;\
+               (cd $$dir ; $(MAKE) $(MFLAGS) unittests) || exit 1;\
+       done
+
+
 #
 # Remove object and target files...
 #
index 84e83ec7d566ff36ae2ebb7707d33cde4bba03ae..4c06581bb0d2cd08a339c9169bee44487a48eed3 100644 (file)
@@ -40,6 +40,13 @@ all: $(TARGETS)
 libs:
 
 
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Clean all object files...
 #
index 479053b330114218533693f3601aa9a30c3ac203..d600a320df3774573c7e8b69b3e671ab64e58359 100644 (file)
@@ -15,6 +15,7 @@
 
 include ../Makedefs
 
+
 TARGETS        =       lpc lpq lpr lprm
 OBJS   =       lpc.o lpq.o lpr.o lprm.o
 
@@ -33,6 +34,13 @@ all: $(TARGETS)
 libs:
 
 
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Clean all object files...
 #
index f801ee38d833f9bdb0bf73f7f24581dfd5817fb3..be70615632bb9cc7a2d6457a1628fbc58c68f62a 100644 (file)
@@ -48,14 +48,16 @@ LIBTARGETS =        \
                $(LIBCUPSCGI) \
                $(LIB32CUPSCGI) \
                $(LIB32CUPSCGI) \
+               websearch
+
+UNITTARGETS =  \
                testcgi \
                testhi \
-               websearch
+               testtemplate
 
 TARGETS        =       \
                $(LIBTARGETS) \
-               $(CGIS) \
-               testtemplate
+               $(CGIS)
 
 
 #
@@ -69,7 +71,14 @@ all: $(TARGETS)
 # Make library targets...
 #
 
-libs:          $(LIBTARGETS)
+libs:          $(LIBTARGETS) $(UNITTESTS)
+
+
+#
+# Make unit tests...
+#
+
+unittests:     $(UNITTARGETS)
 
 
 #
@@ -77,7 +86,7 @@ libs:         $(LIBTARGETS)
 #
 
 clean:
-       $(RM) $(OBJS) $(TARGETS)
+       $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
        $(RM) libcupscgi.so libcupscgi.sl libcupscgi.dylib
        $(RM) -r 32bit 64bit
 
index 548df904b90e5075e9c881b7559eac3d92bbb344..a533beac4d26fcde88ab269d5bdd1064cdd6a28b 100644 (file)
@@ -37,6 +37,13 @@ all:
 libs:
 
 
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Clean all config and object files...
 #
index b3d6d591da41eb94ec2678cec00c546244c58bca..3277e129b32d5eb2501f765c944d33695588efb4 100644 (file)
@@ -22,15 +22,29 @@ AC_SUBST(OPTIM)
 
 AC_ARG_WITH(optim, [  --with-optim="flags"    set optimization flags ])
 AC_ARG_ENABLE(debug, [  --enable-debug          turn on debugging, default=no])
+AC_ARG_ENABLE(debug_printfs, [  --enable-debug-printfs  turn on debug printfs, default=no])
+AC_ARG_ENABLE(unit_tests, [  --enable-unit-tests     turn on unit tests, default=no])
 
 dnl For debugging, keep symbols, otherwise strip them...
 if test x$enable_debug = xyes; then
        OPTIM="-g"
-       CFLAGS="$CFLAGS -DDEBUG"
 else
        INSTALL_STRIP="-s"
 fi
 
+dnl Debug printfs can slow things down, so provide a separate option for that
+if test x$enable_debug_printf = xyes; then
+       CFLAGS="$CFLAGS -DDEBUG"
+fi
+
+dnl Unit tests take up time during a compile...
+if test x$enable_unit_tests = xyes; then
+       UNITTESTS="unittests"
+else
+       UNITTESTS=""
+fi
+AC_SUBST(UNITTESTS)
+
 dnl Setup general architecture flags...
 AC_ARG_WITH(archflags, [  --with-archflags="flags"
                           set default architecture flags ])
index 96dbdff83832760a66f2ab16f2846d1f6efe70b1..2c9536c7e8c6f71113d4defdd00dfca237708b04 100644 (file)
@@ -115,22 +115,24 @@ LIBTARGETS =      \
                $(LIBCUPS) \
                $(LIB32CUPS) \
                $(LIB64CUPS) \
-               libcups.a \
+               libcups.a
+
+UNITTARGETS =  \
+               testadmin \
                testarray \
+               testconflicts \
+               testcups \
                testfile \
                testhttp \
                testi18n \
                testipp \
                testlang \
                testoptions \
-               testppd
+               testppd \
+               testsnmp
 
 TARGETS        =       \
-               $(LIBTARGETS) \
-               testadmin \
-               testconflicts \
-               testcups \
-               testsnmp
+               $(LIBTARGETS)
 
 
 #
@@ -147,12 +149,19 @@ all:      $(TARGETS)
 libs:          $(LIBTARGETS)
 
 
+#
+# Make unit tests...
+#
+
+unittests:     $(UNITTARGETS)
+
+
 #
 # Remove object and target files...
 #
 
 clean:
-       $(RM) $(OBJS) $(TARGETS)
+       $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
        $(RM) libcups.so libcups.sl libcups.dylib
        $(RM) -r 32bit 64bit
 
index 8cd2e3201af189a131ef67ff2772bda3c42c3d86..59512d5e0b4096430202d113a6f06aaff05e8d0d 100644 (file)
@@ -99,6 +99,13 @@ all:
 libs:
 
 
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Clean all config and object files...
 #
index 4b4d8377e8530d64133d80a485708bd19c79da1d..24f0f82ec6c4847cdcbfdb610b3118994ca03714 100644 (file)
@@ -132,6 +132,13 @@ all:
 libs:
 
 
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Remove all generated files...
 #
index 81d58ff251efe3391284ffa753173abb930c70e6..998501e881fd1f87cd9dba748eff63fbf616965e 100644 (file)
@@ -79,6 +79,13 @@ all:         $(TARGETS)
 libs:          $(LIBTARGETS)
 
 
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Clean everything...
 #
index e3af510ec11ec0ef861c3061a4351e8357fa6717..b7314d47c93ddd0aa5b05d7be1906d72d1056bea 100644 (file)
@@ -33,13 +33,14 @@ LIBTARGETS =        \
                $(LIBCUPSIMAGE) \
                libcupsimage.a \
                $(LIB32CUPSIMAGE) \
-               $(LIB64CUPSIMAGE) \
+               $(LIB64CUPSIMAGE)
+UNITTARGETS =  \
+               rasterbench \
+               testimage \
                testraster
 TARGETS        =       \
                $(LIBTARGETS) \
-               $(FILTERS) \
-               rasterbench \
-               testimage
+               $(FILTERS)
 
 HPGLOBJS =     hpgl-attr.o hpgl-config.o hpgl-main.o hpgl-prolog.o \
                hpgl-char.o hpgl-input.o hpgl-polygon.o hpgl-vector.o
@@ -71,12 +72,19 @@ all:        $(TARGETS)
 libs:          $(LIBTARGETS)
 
 
+#
+# Make unit tests...
+#
+
+unittests:     $(UNITTARGETS)
+
+
 #
 # Clean all object files...
 #
 
 clean:
-       $(RM) $(OBJS) $(TARGETS)
+       $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
        $(RM) libcupsimage.so libcupsimage.sl libcupsimage.dylib
        $(RM) -r 32bit 64bit
 
index 760c3af3cbbbdd1f76ee0a409b5e2c57dbcd5775..a7eb5928d856d0bf5595d922ed3a13f5283fdf4c 100644 (file)
@@ -37,6 +37,13 @@ all:
 libs:
 
 
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Clean all config and object files...
 #
index 2567475b245afb7ce6f092186b357fa321a0cbca..adc1603291499dd3e3dcc5f287080bb84d049ac8 100644 (file)
@@ -34,6 +34,13 @@ all: $(TARGETS)
 libs:
 
 
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Clean all config and object files...
 #
index 90af2a0bc20513c0a8b8a5778e9132025ff86d52..9b34bd79002db73ebfa843757dc106f17a74ea4d 100644 (file)
@@ -83,6 +83,13 @@ all: $(MAN1) $(MAN5) $(MAN7) $(MAN8) html
 libs:
 
 
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Clean all config and object files...
 #
index 3a265c932cff96a15460aa510dbf765d26ccf67e..7fb7f267e96b4e04e50b31cf804e8980b014159d 100644 (file)
@@ -36,6 +36,13 @@ all: $(TARGETS)
 libs:
 
 
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Clean all object files...
 #
index 0c9b693e98ecc039ac1b3e24ea9ed0980b7a3875..c10f72f96bf0adc7e305b41677d8c7c248d5ffb6 100644 (file)
@@ -34,6 +34,13 @@ all: $(TARGETS)
 libs:
 
 
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Clean all object files...
 #
index 34f8a61e084f794e75e10eb8f1543efdaa5ac71d..16c32dd8e666c631f5e1dee4f9cf9152266bd06d 100644 (file)
@@ -54,16 +54,17 @@ OBJS =              \
                testcatalog.o
 LIBTARGETS =   \
                $(LIBCUPSPPDC) \
-               libcupsppdc.a \
-               ppdc-static
+               libcupsppdc.a
+UNITTARGETS =  \
+               ppdc-static \
+               testcatalog
 TARGETS        =       \
                $(LIBTARGETS) \
                ppdc \
                ppdhtml \
                ppdi \
                ppdmerge \
-               ppdpo \
-               testcatalog
+               ppdpo
 
 
 #
@@ -80,6 +81,13 @@ all:         $(TARGETS)
 libs:          $(LIBTARGETS)
 
 
+#
+# Make unit tests...
+#
+
+unittests:     $(UNITTARGETS)
+
+
 #
 # Clean everything...
 #
@@ -87,7 +95,7 @@ libs:         $(LIBTARGETS)
 clean:
        $(RM) $(OBJS) core
        $(RM) *.bak *.bck core.*
-       $(RM) $(TARGETS)
+       $(RM) $(TARGETS) $(UNITTARGETS)
        $(RM) -r ppd
        $(RM) test.drv
        $(RM) libcupsppdc.so libcupsppdc.sl libcupsppdc.dylib
index 268cbaf6192b2883b6d2ffed7ec456fb0fa5f3b0..f23a3820f1f63e74c30a31524a910eedf2a37e5c 100644 (file)
@@ -101,6 +101,13 @@ all:               $(TARGETS)
 libs:          $(LIBTARGETS)
 
 
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Clean all object files...
 #
index 36b5766af450895e14b2274099132d35c7b525d8..19147869823f0f45433e01d5ae0f96a61472d41c 100644 (file)
@@ -52,6 +52,13 @@ all: $(PHPCUPS)
 libs:
 
 
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Remove object and target files...
 #
index e69b84ca4bda35e6b57113c0ace72b0ed9d58ea9..bcb9147d5593e2d10a62ef3ed25cb15f296e3d08 100644 (file)
@@ -75,6 +75,13 @@ all: rfctohtml $(RFCS:.txt=.html)
 libs:
 
 
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Clean all config and object files...
 #
index d794d2a7ca3f6a66bbdc465064c413558b5c45e8..9b6ed6e37b353050c73428976ba1fe657c7dd420 100644 (file)
@@ -36,6 +36,13 @@ all: $(TARGETS)
 libs:
 
 
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Clean all object files...
 #
index 62af3ab21aecbbededb3247935bb62b2e3fb8cd2..4401074fffe67ff96883c68f2cf1ccad04959b50 100644 (file)
@@ -103,6 +103,13 @@ all:
 libs:
 
 
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Clean all config and object files...
 #
index 9090ba6abe91817f00d266b89fd38f0e66d2b653..58c73a020df0a28b07424e64c8f23657959db2a7 100644 (file)
@@ -30,6 +30,13 @@ all: ipptest
 libs:
 
 
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Clean all object files...
 #