r23036 - gnucash/trunk/src/report - Use SCM_FILE_LINKS properly and some cleanups of report test makefiles

Geert Janssens gjanssens at code.gnucash.org
Tue Jun 4 14:35:24 EDT 2013


Author: gjanssens
Date: 2013-06-04 14:35:24 -0400 (Tue, 04 Jun 2013)
New Revision: 23036
Trac: http://svn.gnucash.org/trac/changeset/23036

Modified:
   gnucash/trunk/src/report/report-system/test/Makefile.am
   gnucash/trunk/src/report/standard-reports/test/Makefile.am
Log:
Use SCM_FILE_LINKS properly and some cleanups of report test makefiles

- Only some files need to be linked into a virtual guile module dir
  The others should be linked into the build dir if building out of tree
- Drop the .sh extension from test wrappers
- Move makefile variables and targets around a bit to be more consistent in the two makefiles

Modified: gnucash/trunk/src/report/report-system/test/Makefile.am
===================================================================
--- gnucash/trunk/src/report/report-system/test/Makefile.am	2013-06-04 00:20:09 UTC (rev 23035)
+++ gnucash/trunk/src/report/report-system/test/Makefile.am	2013-06-04 18:35:24 UTC (rev 23036)
@@ -19,11 +19,11 @@
   $(SCM_TESTS)
 
 SCM_TESTS = \
-	test-collectors.sh \
-	test-list-extras.sh \
-	test-test-extras.sh
+	test-collectors \
+	test-list-extras \
+	test-test-extras
 
-SCM_TEST_SRCS = $(SCM_TESTS:%.sh=%.scm)
+SCM_TEST_SRCS = $(SCM_TESTS:%=%.scm)
 
 GNC_TEST_DEPS = --gnc-module-dir ${top_builddir}/src/engine \
   --gnc-module-dir ${top_builddir}/src/app-utils \
@@ -50,7 +50,7 @@
   --library-dir    ${top_builddir}/src/backend/sql  \
   --library-dir    ${top_builddir}/src/gnc-module
 
-$(SCM_TESTS): %.sh: Makefile .scm-links
+$(SCM_TESTS): %: $(srcdir)/%.scm Makefile .scm-links
 	echo 'guile --debug -l $(srcdir)/$*.scm -c "(exit (run-test))"' > $@
 	chmod a+x $@
 
@@ -62,16 +62,22 @@
 
 check_PROGRAMS = test-link-module
 
+SCM_TEST_HELPERS = test-extras.scm
+
 EXTRA_DIST = \
 	test-load-module \
-	test-extras.scm \
+	$(SCM_TEST_HELPERS) \
 	$(SCM_TEST_SRCS)
 
 testit:
 	$(TESTS_ENVIRONMENT) libtool --mode execute gdb test-link-module
 
 
-SCM_FILE_LINKS = test-extras.scm $(SCM_TEST_SRCS)
+if GNUCASH_SEPARATE_BUILDDIR
+SCM_FILE_LINKS = \
+	$(SCM_TEST_HELPERS) \
+	$(SCM_TEST_SRCS)
+endif
 
 .scm-links:
 	$(RM) -rf gnucash
@@ -81,7 +87,7 @@
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
-	( cd gnucash/report/report-system/test; for A in $(SCM_FILE_LINKS) ; do $(LN_S) -f ../../../../$$A . ; done )
+	( cd gnucash/report/report-system/test; for A in $(SCM_TEST_HELPERS) ; do $(LN_S) -f ../../../../$$A . ; done )
 if ! OS_WIN32
 # Windows knows no "ln -s" but uses "cp": must copy every time (see bug #566567).
 	touch .scm-links

Modified: gnucash/trunk/src/report/standard-reports/test/Makefile.am
===================================================================
--- gnucash/trunk/src/report/standard-reports/test/Makefile.am	2013-06-04 00:20:09 UTC (rev 23035)
+++ gnucash/trunk/src/report/standard-reports/test/Makefile.am	2013-06-04 18:35:24 UTC (rev 23036)
@@ -1,5 +1,14 @@
 MODULE_TESTS=test-load-module
 
+TESTS = $(SCM_TESTS) $(MODULE_TESTS)
+
+SCM_TESTS = \
+	test-standard-category-report \
+	test-standard-net-barchart \
+	test-standard-net-linechart
+
+SCM_TEST_SRCS = $(SCM_TESTS:%=%.scm)
+
 GNC_TEST_DEPS = \
   --gnc-module-dir ${top_builddir}/src/engine \
   --gnc-module-dir ${top_builddir}/src/app-utils \
@@ -31,30 +40,32 @@
   --library-dir    ${top_builddir}/src/backend/sql \
   --library-dir    ${top_builddir}/src/gnc-module
 
+$(SCM_TESTS): %: $(srcdir)/%.scm Makefile .scm-links
+	echo 'guile --debug -l $(srcdir)/$*.scm -c "(exit (run-test))"' > $@
+	chmod a+x $@
 
 TESTS_ENVIRONMENT = \
   GUILE_WARN_DEPRECATED=no \
   GNC_BUILDDIR=`\cd ${top_builddir} && pwd` \
   $(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})
 
+
 SCM_TEST_HELPERS = \
 	test-generic-category-report.scm \
 	test-generic-net-barchart.scm \
 	test-generic-net-linechart.scm
 
-SCM_TESTS = \
-	test-standard-category-report.sh \
-	test-standard-net-barchart.sh \
-	test-standard-net-linechart.sh
+EXTRA_DIST = \
+	test-load-module \
+	$(SCM_TEST_HELPERS) \
+	$(SCM_TEST_SRCS)
 
-SCM_TEST_SRCS = $(SCM_TESTS:%.sh=%.scm)
-
-EXTRA_DIST = test-load-module $(SCM_TEST_HELPERS) $(SCM_TEST_SRCS)
-
+if GNUCASH_SEPARATE_BUILDDIR
 #For executing test cases
 SCM_FILE_LINKS = \
 	$(SCM_TEST_HELPERS) \
 	$(SCM_TEST_SRCS)
+endif
 
 .scm-links:
 	$(RM) -rf gnucash
@@ -64,24 +75,18 @@
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
-	( cd gnucash/report/standard-reports/test; for A in $(SCM_FILE_LINKS) ; do $(LN_S) -f ../../../../$$A . ; done )
+	( cd gnucash/report/standard-reports/test; for A in $(SCM_TEST_HELPERS) ; do $(LN_S) -f ../../../../$$A . ; done )
 if ! OS_WIN32
 # Windows knows no "ln -s" but uses "cp": must copy every time (see bug #566567).
 	touch .scm-links
 endif
 
-$(SCM_TESTS): %.sh: Makefile .scm-links
-	echo 'guile --debug -l $(srcdir)/$*.scm -c "(exit (run-test))"' > $@
-	chmod a+x $@
-
 interp:
 	$(TESTS_ENVIRONMENT) guile --debug
 
 debug:
 	$(TESTS_ENVIRONMENT) gdb --args $(shell cat $(TEST))
 
-TESTS = $(SCM_TESTS) $(MODULE_TESTS)
-
 clean-local:
 	$(RM) -rf gnucash
 



More information about the gnucash-changes mailing list