gnucash master: Build glib gtester based tests under check_PROGRAMS, run under TESTS
John Ralls
jralls at code.gnucash.org
Thu Nov 6 19:40:28 EST 2014
Updated via https://github.com/Gnucash/gnucash/commit/e8737992 (commit)
from https://github.com/Gnucash/gnucash/commit/de5a3eb9 (commit)
commit e87379922f9c5837452944adfe8080362033fa08
Author: John Ralls <jralls at ceridwen.us>
Date: Thu Nov 6 16:39:45 2014 -0800
Build glib gtester based tests under check_PROGRAMS, run under TESTS
Instead of TEST_PROGS. This has two advantages:
* By deferring the builds until make check any prerequisites, especially
in test-core, are already built regardless of overall build order.
* The output of these tests is logged and the success or failure
included in the make check summary instead of adding their rather verbose
output to the stderr.
diff --git a/src/app-utils/test/Makefile.am b/src/app-utils/test/Makefile.am
index 75d0ab8..c24411c 100644
--- a/src/app-utils/test/Makefile.am
+++ b/src/app-utils/test/Makefile.am
@@ -1,12 +1,16 @@
include $(top_srcdir)/test-templates/Makefile.decl
-TESTS = \
+check_PROGRAMS = \
test-link-module \
- test-load-module \
test-exp-parser \
test-scm-query-string \
test-print-parse-amount \
- test-sx
+ test-sx \
+ test-app-utils
+
+TESTS = \
+ test-load-module \
+ ${check_PROGRAMS}
test_exp_parser_SOURCES = \
test-exp-parser.c
@@ -46,14 +50,6 @@ LDADD = \
${top_builddir}/src/engine/test-core/libgncmod-test-engine.la \
${GUILE_LIBS}
-check_PROGRAMS = \
- test-link-module \
- test-exp-parser \
- test-print-parse-amount \
- test-scm-query-string \
- test-print-queries \
- test-sx
-
EXTRA_DIST += \
test-load-module
@@ -69,10 +65,6 @@ AM_CPPFLAGS = \
${GUILE_CFLAGS} \
${GLIB_CFLAGS}
-TEST_PROGS += test-app-utils
-
-noinst_PROGRAMS = ${TEST_PROGS} ${CHECK_PROGS}
-
test_app_utils_SOURCES = \
test-app-utils.c \
test-option-util.c
diff --git a/src/backend/dbi/test/Makefile.am b/src/backend/dbi/test/Makefile.am
index b10fa9f..589bce2 100644
--- a/src/backend/dbi/test/Makefile.am
+++ b/src/backend/dbi/test/Makefile.am
@@ -41,18 +41,16 @@ TESTS_ENVIRONMENT = \
GNC_ACCOUNT_PATH=${top_srcdir}/accounts/C \
SRCDIR=${srcdir} \
${gnc_dbd_dir_override} \
- $(shell ${top_builddir}/src/gnc-test-env ${GNC_TEST_DEPS})
+ $(shell ${top_builddir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})
EXTRA_DIST += \
test-dbi-stuff.h \
test-dbi-business-stuff.h \
test-dbi.xml
-TEST_PROGS += \
- test-backend-dbi
-
-noinst_PROGRAMS = ${TEST_PROGS} ${CHECK_PROGS}
+check_PROGRAMS = test-backend-dbi
+TESTS = ${check_PROGRAMS}
if CUSTOM_GNC_DBD_DIR
gnc_dbd_dir_override = GNC_DBD_DIR="@GNC_DBD_DIR@"
@@ -76,4 +74,4 @@ AM_CPPFLAGS += -DG_LOG_DOMAIN=\"gnc.backend.dbi\"
# If you let make run parallel builds it complains that there is no rule to make
# libgncmod-test-dbi.la. This is wrong, but I can't figure out how to fix it
# so I'll turn off parallel builds
-.NOTPARALLEL:
+#.NOTPARALLEL:
diff --git a/src/backend/sql/test/Makefile.am b/src/backend/sql/test/Makefile.am
index 4424649..e8f4682 100644
--- a/src/backend/sql/test/Makefile.am
+++ b/src/backend/sql/test/Makefile.am
@@ -6,8 +6,11 @@ MODULEPATH = src/backend/sql
test_column_types_SOURCES = \
test-column-types.c
-TESTS = \
- test-column-types
+check_PROGRAMS = \
+ test-column-types \
+ test-sqlbe
+
+TESTS = ${check_PROGRAMS}
GNC_TEST_DEPS = \
--gnc-module-dir ${top_builddir}/src/engine \
@@ -23,10 +26,6 @@ TESTS_ENVIRONMENT = \
SRCDIR=${srcdir} \
$(shell ${top_builddir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})
-check_PROGRAMS = $(TESTS)
-
-#noinst_HEADERS = test-file-stuff.h
-
LDADD = ${top_builddir}/src/test-core/libtest-core.la \
${top_builddir}/src/gnc-module/libgnc-module.la \
${top_builddir}/src/backend/sql/libgnc-backend-sql.la \
@@ -51,11 +50,8 @@ AM_CPPFLAGS = \
AM_CPPFLAGS += -DG_LOG_DOMAIN=\"gnc.backend.sql\"
-TEST_PROGS += test-sqlbe
#test_sqlbedir = ${top_srcdir}/${MODULEPATH}/test
-noinst_PROGRAMS = $(TESTS) $(TEST_PROGS)
-
test_sqlbe_SOURCES = \
test-sqlbe.c \
utest-gnc-backend-sql.c
diff --git a/src/engine/test/Makefile.am b/src/engine/test/Makefile.am
index 1dc6a51..eb8481c 100644
--- a/src/engine/test/Makefile.am
+++ b/src/engine/test/Makefile.am
@@ -26,7 +26,7 @@ LDADD = \
# these tests are ordered kind more or less in the order
# that they should be executed, with more basic tests coming first.
#
-TESTS = \
+TEST_GROUP_1 = \
test-link \
test-load-engine \
test-guid \
@@ -34,7 +34,10 @@ TESTS = \
test-date \
test-object \
test-commodities \
+ test-engine
+
test-create-account \
+TEST_GROUP_2 = \
test-account-object \
test-group-vs-book \
test-lots \
@@ -70,31 +73,9 @@ TESTS_ENVIRONMENT = \
GNC_BUILDDIR=`\cd ${top_builddir} && pwd` \
$(shell ${top_builddir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})
-check_PROGRAMS = \
- test-link \
- test-commodities \
- test-date \
- test-recurrence \
- test-guid \
- test-account-object \
- test-group-vs-book \
- test-load-engine \
- test-lots \
- test-numeric \
- test-object \
- test-query \
- test-querynew \
- test-scm-query \
- test-split-vs-account \
- test-transaction-reversal \
- test-transaction-voiding \
- test-business \
- test-address \
- test-customer \
- test-employee \
- test-job \
- test-vendor
+check_PROGRAMS = ${TEST_GROUP_1} ${TEST_GROUP_2}
+TESTS = ${TEST_GROUP_1} test-create-account ${TEST_GROUP_2}
test_link_SOURCES = test-link.c
test_link_LDADD = ../libgncmod-engine.la \
@@ -107,9 +88,6 @@ EXTRA_DIST += \
test-scm-query-import \
test-scm-query-import.scm
-TEST_PROGS += test-engine
-
-noinst_PROGRAMS = ${TEST_PROGS} ${CHECK_PROGS}
test_engine_SOURCES = \
test-engine.c \
diff --git a/src/import-export/aqb/test/Makefile.am b/src/import-export/aqb/test/Makefile.am
index 77e8d5a..66cb976 100644
--- a/src/import-export/aqb/test/Makefile.am
+++ b/src/import-export/aqb/test/Makefile.am
@@ -9,9 +9,10 @@ include $(top_srcdir)/test-templates/Makefile.decl
MODULEPATH = src/import-export/aqb
#The test program. You'll need to add to this if you have more than one module above.
-TEST_PROGS += test-aqb
-noinst_PROGRAMS = ${TEST_PROGS}
+check_PROGRAMS = test-aqb
+
+TESTS = ${check_PROGRAMS}
test_aqbdir = ${top_srcdir}/${MODULEPATH}/test
diff --git a/src/libqof/qof/test/Makefile.am b/src/libqof/qof/test/Makefile.am
index 10fb8ae..fc77ecd 100644
--- a/src/libqof/qof/test/Makefile.am
+++ b/src/libqof/qof/test/Makefile.am
@@ -28,9 +28,11 @@ test_qof_HEADERS = \
$(top_srcdir)/${MODULEPATH}/qofsession.h \
$(top_srcdir)/src/test-core/unittest-support.h
-TEST_PROGS += test-qof
+check_PROGRAMS = \
+ test-qof
+
+TESTS = ${check_PROGRAMS}
-noinst_PROGRAMS = ${TEST_PROGS}
test_qofdir = ${GNC_LIBEXECDIR}/${MODULEPATH}/test
#The tests might require more libraries, but try to keep them
diff --git a/src/optional/gtkmm/test/Makefile.am b/src/optional/gtkmm/test/Makefile.am
index 6d6cdcd..0268aec 100644
--- a/src/optional/gtkmm/test/Makefile.am
+++ b/src/optional/gtkmm/test/Makefile.am
@@ -15,9 +15,9 @@ test_gtkmm_SOURCES = \
test_gtkmm_HEADERSS = \
$(top_srcdir)/${MODULEPATH}/gncmm/Book.hpp
-TEST_PROGS += test-gtkmm
+check_PROGRAMS = test-gtkmm
-noinst_PROGRAMS = ${TEST_PROGS}
+TESTS = ${check_PROGRAMS}
#The tests might require more libraries, but try to keep them
#as independent as possible.
Summary of changes:
src/app-utils/test/Makefile.am | 22 +++++++---------------
src/backend/dbi/test/Makefile.am | 10 ++++------
src/backend/sql/test/Makefile.am | 14 +++++---------
src/engine/test/Makefile.am | 34 ++++++----------------------------
src/import-export/aqb/test/Makefile.am | 5 +++--
src/libqof/qof/test/Makefile.am | 6 ++++--
src/optional/gtkmm/test/Makefile.am | 4 ++--
7 files changed, 31 insertions(+), 64 deletions(-)
More information about the gnucash-changes
mailing list