From 396c4928c38a043febf7e72a21275c4f829740aa Mon Sep 17 00:00:00 2001 From: jaspervdg Date: Thu, 17 Jul 2008 11:33:38 +0000 Subject: [PATCH] The new CxxTest unit tests now also work on Linux! (Note that test-all has become test-src and no longer includes ALL tests, just the tests in src/.) --- src/Makefile.am | 47 +++++++++++++++++-------------------- src/Makefile_insert | 6 ++--- src/display/Makefile_insert | 24 +++++++++++++++++++ src/helper/Makefile_insert | 24 +++++++++++++++++++ src/libnr/Makefile_insert | 3 +++ src/libnr/nr-compose-test.h | 1 + src/svg/Makefile_insert | 3 +++ src/util/Makefile_insert | 22 +++++++++++++++++ 8 files changed, 102 insertions(+), 28 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 36cf51696..09e52576b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -117,9 +117,12 @@ noinst_LIBRARIES = \ libinkpost.a check_LIBRARIES = \ + display/libtest-display.a \ + helper/libtest-helper.a \ libnr/libtest-nr.a \ svg/libtest-svg.a \ svg/libtest-stubs.a \ + util/libtest-util.a \ xml/libtest-xml.a DISTCLEANFILES = \ @@ -191,10 +194,12 @@ EXTRA_PROGRAMS = \ libnr/testnr TESTS = \ - test-all$(EXEEXT) \ + test-src$(EXEEXT) \ style-test$(EXEEXT) \ display/bezier-utils-test$(EXEEXT) \ + display/test-display$(EXEEXT) \ helper/units-test$(EXEEXT) \ + helper/test-helper$(EXEEXT) \ libnr/in-svg-plane-test$(EXEEXT) \ libnr/nr-matrix-test$(EXEEXT) \ libnr/nr-point-fns-test$(EXEEXT) \ @@ -206,14 +211,15 @@ TESTS = \ libnr/test-nr$(EXEEXT) \ svg/test-svg$(EXEEXT) \ util/list-container-test$(EXEEXT) \ + util/test-util$(EXEEXT) \ xml/test-xml$(EXEEXT) \ xml/quote-test$(EXEEXT) \ xml/repr-action-test$(EXEEXT) # As of 2007-01-13, these are failing... -XFAIL_TESTS = \ - test-all$(EXEEXT) \ - style-test$(EXEEXT) +#XFAIL_TESTS = \ +# test-src$(EXEEXT) \ +# style-test$(EXEEXT) # streamtest is unfinished and can't handle the relocations done during # "make distcheck". Not needed for the 0.41 release. @@ -223,10 +229,12 @@ XFAIL_TESTS = \ # TESTS items can be scripts etc. check_PROGRAMS = \ - test-all \ + test-src \ style-test \ display/bezier-utils-test \ + display/test-display \ helper/units-test \ + helper/test-helper \ libnr/in-svg-plane-test \ libnr/nr-matrix-test \ libnr/nr-point-fns-test \ @@ -238,6 +246,7 @@ check_PROGRAMS = \ libnr/test-nr \ svg/test-svg \ util/list-container-test \ + util/test-util \ xml/test-xml \ xml/quote-test \ xml/repr-action-test @@ -245,29 +254,17 @@ check_PROGRAMS = \ # io/streamtest -test-all.cpp: \ - $(libnr_test_nr_a_SOURCES) \ - $(svg_test_svg_a_SOURCES) \ - $(xml_test_xml_a_SOURCES) \ - $(libnr_test_nr_includes) \ - $(svg_test_svg_includes) \ - $(xml_test_xml_includes) \ - $(test_all_includes) - $(top_srcdir)/cxxtest/cxxtestgen.pl --template=$(srcdir)/selfname.tpl -root -o test-all.cpp \ - $(libnr_test_nr_includes) \ - $(svg_test_svg_includes) \ - $(xml_test_xml_includes) \ - $(test_all_includes) +test-src.cpp: \ + $(test_src_includes) + $(top_srcdir)/cxxtest/cxxtestgen.pl --template=$(srcdir)/selfname.tpl -root -o test-src.cpp \ + $(test_src_includes) -test_all_SOURCES = \ - test-all.cpp $(test_all_includes) +test_src_SOURCES = \ + test-src.cpp $(test_src_includes) -test_all_LDADD = \ +test_src_LDADD = \ $(all_libs) \ - $(svg_test_svg_LDADD) \ - $(libnr_test_nr_LDADD) \ - $(xml_test_xml_LDADD) \ io/libio.a @@ -282,4 +279,4 @@ dist-hook: cp $(srcdir)/pixmaps/*xpm $(distdir)/pixmaps distclean-local: - rm -f libnr/test-nr.xml libnr/test-nr.log svg/test-svg.xml svg/test-svg.log xml/test-xml.xml xml/test-xml.log test-all.xml test-all.log + rm -f display/test-display.xml display/test-display.log helper/test-helper.xml helper/test-helper.log libnr/test-nr.xml libnr/test-nr.log svg/test-svg.xml svg/test-svg.log util/test-util.xml util/test-util.log xml/test-xml.xml xml/test-xml.log test-src.xml test-src.log diff --git a/src/Makefile_insert b/src/Makefile_insert index f60e482e6..935abf456 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -433,12 +433,12 @@ style_test_LDADD = $(all_libs) inkscape_version.h: ../configure.ac echo '#define INKSCAPE_VERSION "$(VERSION)"' > inkscape_version.h -test_all_includes = \ - $(srcdir)/attributes-test.h \ - $(srcdir)/color-profile-test.h \ +test_src_includes = \ $(srcdir)/MultiPrinter.h \ $(srcdir)/TRPIFormatter.h \ $(srcdir)/PylogFormatter.h \ + $(srcdir)/attributes-test.h \ + $(srcdir)/color-profile-test.h \ $(srcdir)/dir-util-test.h \ $(srcdir)/extract-uri-test.h \ $(srcdir)/mod360-test.h \ diff --git a/src/display/Makefile_insert b/src/display/Makefile_insert index 5c7fd892e..bc74c6f22 100644 --- a/src/display/Makefile_insert +++ b/src/display/Makefile_insert @@ -130,3 +130,27 @@ display_libspdisplay_a_SOURCES = \ display_bezier_utils_test_SOURCES = display/bezier-utils-test.cpp display_bezier_utils_test_LDADD = libnr/libnr.a -lglib-2.0 + +# Copy/paste from libnr +display/test-display-main.cpp: display/test-display.cpp + $(top_srcdir)/cxxtest/cxxtestgen.pl --template=$(srcdir)/selfname.tpl -root -o display/test-display-main.cpp $(display_test_display_includes) + +display/test-display.cpp: $(display_test_display_includes) + $(top_srcdir)/cxxtest/cxxtestgen.pl -part -o display/test-display.cpp $(display_test_display_includes) + +display_test_display_includes = \ + $(srcdir)/display/bezier-utils-test.h + +display_libtest_display_a_SOURCES = \ + display/test-display.cpp \ + $(display_test_display_includes) + +display_test_display_SOURCES = \ + display/test-display-main.cpp \ + $(display_test_display_includes) + +display_test_display_LDADD = \ + libnr/libnr.a \ + display/libtest-display.a \ + -lglib-2.0 + diff --git a/src/helper/Makefile_insert b/src/helper/Makefile_insert index 20c7e6c53..26b2f46b2 100644 --- a/src/helper/Makefile_insert +++ b/src/helper/Makefile_insert @@ -55,3 +55,27 @@ helper/sp-marshal.cpp helper/sp-marshal.h: Makefile helper_units_test_SOURCES = helper/units-test.cpp helper_units_test_LDADD = helper/libspchelp.a -lglib-2.0 + +# Copy/paste from libnr +helper/test-helper-main.cpp: helper/test-helper.cpp + $(top_srcdir)/cxxtest/cxxtestgen.pl --template=$(srcdir)/selfname.tpl -root -o helper/test-helper-main.cpp $(helper_test_helper_includes) + +helper/test-helper.cpp: $(helper_test_helper_includes) + $(top_srcdir)/cxxtest/cxxtestgen.pl -part -o helper/test-helper.cpp $(helper_test_helper_includes) + +helper_test_helper_includes = \ + $(srcdir)/helper/units-test.h + +helper_libtest_helper_a_SOURCES = \ + helper/test-helper.cpp \ + $(helper_test_helper_includes) + +helper_test_helper_SOURCES = \ + helper/test-helper-main.cpp \ + $(helper_test_helper_includes) + +helper_test_helper_LDADD = \ + helper/libspchelp.a \ + helper/libtest-helper.a \ + -lglib-2.0 + diff --git a/src/libnr/Makefile_insert b/src/libnr/Makefile_insert index f2fd269bc..1ddc7d880 100644 --- a/src/libnr/Makefile_insert +++ b/src/libnr/Makefile_insert @@ -113,6 +113,7 @@ libnr/test-nr.cpp: $(libnr_test_nr_includes) $(top_srcdir)/cxxtest/cxxtestgen.pl -part -o libnr/test-nr.cpp $(libnr_test_nr_includes) libnr_test_nr_includes = \ + $(srcdir)/libnr/nr-compose-test.h \ $(srcdir)/libnr/nr-types-test.h \ $(srcdir)/libnr/nr-translate-test.h \ $(srcdir)/libnr/nr-rotate-test.h \ @@ -124,6 +125,8 @@ libnr_test_nr_includes = \ libnr_libtest_nr_a_SOURCES = \ libnr/test-nr.cpp \ + libnr/nr-compose-reference.cpp \ + libnr/nr-compose-reference.h \ $(libnr_test_nr_includes) libnr_test_nr_SOURCES = \ diff --git a/src/libnr/nr-compose-test.h b/src/libnr/nr-compose-test.h index 5b0d129c7..fbac745ef 100644 --- a/src/libnr/nr-compose-test.h +++ b/src/libnr/nr-compose-test.h @@ -5,6 +5,7 @@ #include "nr-compose-reference.h" #include #include +#include #include static inline unsigned int DIV_ROUND(unsigned int v, unsigned int divisor) { return (v+divisor/2)/divisor; } diff --git a/src/svg/Makefile_insert b/src/svg/Makefile_insert index f8158f31b..48d945301 100644 --- a/src/svg/Makefile_insert +++ b/src/svg/Makefile_insert @@ -47,7 +47,9 @@ svg/test-svg.cpp: $(svg_test_svg_includes) svg/Makefile_insert svg_test_svg_includes = \ $(srcdir)/svg/css-ostringstream-test.h \ $(srcdir)/svg/stringstream-test.h \ + $(srcdir)/svg/svg-affine-test.h \ $(srcdir)/svg/svg-color-test.h \ + $(srcdir)/svg/svg-length-test.h \ $(srcdir)/svg/svg-path-test.h svg_libtest_svg_a_SOURCES = \ @@ -66,4 +68,5 @@ svg_test_svg_LDADD = \ svg/libtest-svg.a \ svg/libtest-stubs.a \ 2geom/lib2geom.a \ + libnr/libnr.a \ $(INKSCAPE_LIBS) diff --git a/src/util/Makefile_insert b/src/util/Makefile_insert index 913dda26b..23ed42ac8 100644 --- a/src/util/Makefile_insert +++ b/src/util/Makefile_insert @@ -27,3 +27,25 @@ util_libinkutil_a_SOURCES = \ util_list_container_test_SOURCES = util/list-container-test.cpp util_list_container_test_LDADD = gc.o $(INKSCAPE_LIBS) +# Copy/paste from libnr +util/test-util-main.cpp: util/test-util.cpp + $(top_srcdir)/cxxtest/cxxtestgen.pl --template=$(srcdir)/selfname.tpl -root -o util/test-util-main.cpp $(util_test_util_includes) + +util/test-util.cpp: $(util_test_util_includes) + $(top_srcdir)/cxxtest/cxxtestgen.pl -part -o util/test-util.cpp $(util_test_util_includes) + +util_test_util_includes = \ + $(srcdir)/util/list-container-test.h + +util_libtest_util_a_SOURCES = \ + util/test-util.cpp \ + $(util_test_util_includes) + +util_test_util_SOURCES = \ + util/test-util-main.cpp \ + $(util_test_util_includes) + +util_test_util_LDADD = \ + util/libtest-util.a \ + gc.o $(INKSCAPE_LIBS) + -- 2.30.2