Permalink
Browse files

add isstall-tests

clean up make dist
update demos output (for grepl)


git-svn-id: https://svn.r-project.org/R/trunk@47715 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information...
1 parent 4969387 commit 0b31d29a4ab031b766d612d60b8fcf64599dc041 ripley committed Jan 24, 2009
View
@@ -208,6 +208,14 @@ install-dvi install-info install-pdf:
uninstall-dvi uninstall-info uninstall-pdf:
-@(cd doc/manual && $(MAKE) $@)
+install-tests:
+ -@(cd tests && $(MAKE) $@)
+ -@(cd src/library && $(MAKE) $@)
+
+uninstall-tests:
+ -@(cd src/library && $(MAKE) $@)
+ -@(cd tests && $(MAKE) $@)
+
check check-devel check-all:
@(cd tests && $(MAKE) $@)
View
@@ -243,6 +243,12 @@ INSTALLATION
o --with-ICU is now the default: this means that ICU will be
used for collation on Mac OS >= 10.4.
+ o make install-tests can be used to install the test files,
+ to allowed an installed version of R to be tested.
+ [This is work in progress. Run the tests by
+ cd .../tests; R CMD make for targest check, check-all and more
+ specific ones.]
+
PACKAGE INSTALLATION
@@ -11,7 +11,7 @@ subdir = src/library
include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-DISTFILES = Makefile.in eof_file
+DISTFILES = Makefile.in Makefile.win eof_file
SUBDIRS = profile $(R_PKGS_BASE) Recommended
@@ -143,6 +143,19 @@ uninstall:
@rmdir "$(DESTDIR)$(rhome)/library" 2>/dev/null \
|| $(ECHO) " subdir $(DESTDIR)$(rhome)/library not removed"
+install-tests:
+ @$(ECHO) "installing package tests ..."
+ @for pkg in $(R_PKGS_BASE); do \
+ if test -d "$(srcdir)/$${pkg}/tests"; then \
+ $(MKINSTALLDIRS) "$(DESTDIR)$(rhome)/tests/$${pkg}/tests" ; \
+ for f in $(srcdir)/$${pkg}/tests/*; do \
+ $(INSTALL_DATA) $${f} "$(DESTDIR)$(rhome)/tests/$${pkg}/tests"; \
+ done; \
+ fi; \
+ done
+
+## all the uninstall is done in tests/Makefile for now.
+uninstall-tests:
mostlyclean: clean
clean:
@@ -11,7 +11,7 @@ subdir = src/library/Recommended
include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-DISTFILES = Makefile.in .cvsignore
+DISTFILES = Makefile.in Makefile.win .cvsignore
R = R_LIBS= $(top_builddir)/bin/R
## foo.ts is the timestamp for package foo;
@@ -11,7 +11,7 @@ subdir = src/library/base
include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-DISTFILES = DESCRIPTION.in Makefile.in baseloader.R \
+DISTFILES = DESCRIPTION.in Makefile.in Makefile.win baseloader.R \
makebasedb.R cross-makebasedb.R
pkg = base
@@ -11,7 +11,7 @@ subdir = src/library/datasets
include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-DISTFILES = DESCRIPTION.in Makefile.in
+DISTFILES = DESCRIPTION.in Makefile.in Makefile.win
pkg = datasets
@@ -11,7 +11,7 @@ subdir = src/library/grDevices
include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-DISTFILES = DESCRIPTION.in Makefile.in NAMESPACE
+DISTFILES = DESCRIPTION.in Makefile.in Makefile.win NAMESPACE
pkg = grDevices
@@ -11,7 +11,7 @@ subdir = src/library/graphics
include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-DISTFILES = DESCRIPTION.in Makefile.in NAMESPACE
+DISTFILES = DESCRIPTION.in Makefile.in Makefile.win NAMESPACE
pkg = graphics
@@ -11,7 +11,7 @@ subdir = src/library/grid
include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-DISTFILES = DESCRIPTION.in Makefile.in NAMESPACE
+DISTFILES = DESCRIPTION.in Makefile.in Makefile.win NAMESPACE
pkg = grid
@@ -10,7 +10,7 @@ subdir = src/library/methods
include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-DISTFILES = DESCRIPTION.in Makefile.in NAMESPACE
+DISTFILES = DESCRIPTION.in Makefile.in Makefile.win NAMESPACE
pkg = methods
@@ -11,7 +11,7 @@ subdir = src/library/splines
include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-DISTFILES = DESCRIPTION.in Makefile.in NAMESPACE
+DISTFILES = DESCRIPTION.in Makefile.in Makefile.win NAMESPACE
pkg = splines
@@ -12,7 +12,7 @@ include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
DISTFILES = COPYRIGHTS.modreg COPYRIGHTS.portsrc DESCRIPTION.in Makefile.in \
- NAMESPACE SOURCES.ts loess-README splines-README
+ Makefile.win NAMESPACE SOURCES.ts loess-README splines-README
pkg = stats
@@ -11,7 +11,7 @@ subdir = src/library/stats4
include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-DISTFILES = DESCRIPTION.in Makefile.in NAMESPACE
+DISTFILES = DESCRIPTION.in Makefile.in Makefile.win NAMESPACE
pkg = stats4
@@ -11,7 +11,7 @@ subdir = src/library/tcltk
include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-DISTFILES = DESCRIPTION.in Makefile.in NAMESPACE
+DISTFILES = DESCRIPTION.in Makefile.in Makefile.win NAMESPACE
pkg = tcltk
@@ -11,7 +11,7 @@ subdir = src/library/tools
include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-DISTFILES = DESCRIPTION.in Makefile.in NAMESPACE
+DISTFILES = DESCRIPTION.in Makefile.in Makefile.win NAMESPACE
pkg = tools
@@ -11,7 +11,7 @@ subdir = src/library/utils
include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-DISTFILES = DESCRIPTION.in Makefile.in \
+DISTFILES = DESCRIPTION.in Makefile.in Makefile.win \
NAMESPACE NAMESPACE.aqua
pkg = utils
@@ -11,7 +11,7 @@ subdir = tests/Examples
include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-DISTFILES = Makefile.in
+DISTFILES = Makefile.in Makefile.win Makefile.install
R_EXE = $(top_builddir)/bin/R --slave --vanilla
@@ -0,0 +1,80 @@
+#
+# ${R_HOME}/tests/Examples/Makefile.install
+
+## need MAKE, ECHO*
+
+top_builddir = ../..
+
+include $(top_builddir)/etc$(R_ARCH)/Makeconf
+
+R_EXE = $(top_builddir)/bin/R --slave --vanilla
+
+## principle is that we can run all the examples in a package
+## starting with just that package and 'datasets'
+## R = R_DEFAULT_PACKAGES=datasets $(top_builddir)/bin/R --vanilla
+R = $(top_builddir)/bin/R --vanilla
+
+EX_IN_BASE = $(R_PKGS_BASE:=-Ex.R)
+EX_OUT_BASE = $(EX_IN_BASE:.R=.Rout)
+
+EX_IN_RECOMMENDED = $(R_PKGS_RECOMMENDED:=-Ex.R)
+EX_OUT_RECOMMENDED = $(EX_IN_RECOMMENDED:.R=.Rout)
+
+RDIFF = $(top_builddir)/bin/R CMD Rdiff
+RVAL_IF_DIFF = 0
+
+.SUFFIXES:
+.SUFFIXES: .R .Rout
+
+all: test-Examples
+
+test-Examples: test-Examples-Base
+test-Examples-Base:
+ @$(MAKE) $(EX_OUT_BASE)
+
+## <NOTE>
+## We do *not* want this to be added to test-Examples conditional on
+## .
+## 'make check-all' is used for running test-Examples-Recommended in
+## addition to 'make check'.
+test-Examples-Recommended: test-Examples-Base
+ @$(MAKE) $(EX_OUT_RECOMMENDED)
+## </NOTE>
+
+R:
+ @cd $(top_builddir) && $(MAKE) R
+
+.R.Rout:
+ @if test -f $@; then mv $@ $@.prev; fi
+ @$(ECHO) $(ECHO_N) "running code in '$<' ...$(ECHO_C)"
+ @$(R) < $< > $@ 2>&1 || (mv $@ $@.fail && exit 1)
+ @$(ECHO) "$(ECHO_T) OK"
+ @if test -f $@.prev; then \
+ mv $@ $@.fail; \
+ $(ECHO) $(ECHO_N) "comparing '$@' to '$@.prev' ...$(ECHO_C)"; \
+ $(RDIFF) $@.fail $@.prev $(RVAL_IF_DIFF) || exit 1; \
+ mv $@.fail $@; \
+ $(ECHO) "$(ECHO_T) OK"; \
+ fi
+
+$(EX_IN_BASE): # FORCE
+ @(pkg=`basename $@ -Ex.R`; \
+ $(ECHO) "collecting examples for package '$${pkg}' ..."; \
+ LC_ALL=C $(R_EXE) < $(top_builddir)/share/R/massage-examples.R \
+ --args $${pkg} $(top_builddir)/library/$${pkg}/R-ex > $@; \
+ )
+
+$(EX_IN_RECOMMENDED): # FORCE
+ @(pkg=`basename $@ -Ex.R`; \
+ $(ECHO) "collecting examples for package '$${pkg}' ..."; \
+ LC_ALL=C $(R_EXE) < $(top_builddir)/share/R/massage-examples.R \
+ --args $${pkg} $(top_builddir)/library/$${pkg}/R-ex > $@; \
+ fi)
+FORCE:
+
+mostlyclean: clean
+clean:
+ -@rm -f *.R *.Rout *.Rd* *.ps *.tex *.dat* data foo*
+distclean: clean
+ -@rm -f *.R*prev .RData sink-examp.txt
+maintainer-clean: distclean
View
@@ -53,7 +53,7 @@ test-src-reg-auto =
test-src-reg = $(test-src-reg-1) $(test-src-reg-auto)
test-src-reg3 = reg-tests-3.R reg-plot-latin1.R
-DISTFILES = Makefile.in Makefile.win README \
+INSTFILES = README \
$(test-src-strict-1) $(test-src-strict-1:.R=.Rout.save) \
$(test-src-sloppy-1) $(test-src-sloppy-1:.R=.Rout.save) \
$(test-src-auto:.R=.Rin) isas-tests.Rout.save \
@@ -76,6 +76,7 @@ DISTFILES = Makefile.in Makefile.win README \
ver10.Rd ver10.txt.save ver10.html.save ver10.tex.save ver10-Ex.R.save \
ver11.Rd ver11.txt.save ver11.html.save ver11.tex.save ver11-Ex.R.save \
R-intro.Rout.save
+DISTFILES = Makefile.in Makefile.win Makefile.install $(INSTFILES)
SUBDIRS = Embedding Examples Native
## GNU gettext disables LANGUAGE if LC_ALL=C, but other systems might not.
@@ -473,6 +474,22 @@ maintainer-clean: distclean
R install install-strip uninstall TAGS info dvi:
+install-tests:
+ @$(ECHO) "installing tests ..."
+ @$(MKINSTALLDIRS) "$(DESTDIR)$(rhome)/tests"
+ @$(MKINSTALLDIRS) "$(DESTDIR)$(rhome)/tests/Examples"
+ @for f in $(INSTFILES); do \
+ $(INSTALL_DATA) $(srcdir)/$${f} "$(DESTDIR)$(rhome)/tests"; \
+ done
+ @$(INSTALL_DATA) $(srcdir)/Makefile.install \
+ "$(DESTDIR)/$(rhome)/tests/Makefile"
+ @$(INSTALL_DATA) $(srcdir)/Examples/Makefile.install \
+ "$(DESTDIR)$(rhome)/tests/Examples/Makefile"
+
+uninstall-tests:
+ @$(ECHO) "uninstalling tests ..."
+ @rm -rf "$(DESTDIR)$(rhome)/tests"
+
distdir: $(DISTFILES)
@for f in $(DISTFILES); do \
test -f $(distdir)/$${f} \
Oops, something went wrong.

0 comments on commit 0b31d29

Please sign in to comment.