Support "make check" in contrib

Added a new option --extra-install to pg_regress to arrange installing
the respective contrib directory into the temporary installation.
This is currently not yet supported for Windows MSVC builds.

Updated the .gitignore files for contrib modules to ignore the
leftovers of a temp-install check run.

Changed the exit status of "make check" in a pgxs build (which still
does nothing) to 0 from 1.

Added "make check" in contrib to top-level "make check-world".
pull/1/head
Peter Eisentraut 14 years ago
parent 625744ac43
commit f8ebe3bcc5
  1. 3
      GNUmakefile.in
  2. 2
      contrib/btree_gin/.gitignore
  3. 2
      contrib/btree_gist/.gitignore
  4. 2
      contrib/citext/.gitignore
  5. 2
      contrib/cube/.gitignore
  6. 2
      contrib/dblink/.gitignore
  7. 2
      contrib/dict_int/.gitignore
  8. 2
      contrib/dict_xsyn/.gitignore
  9. 2
      contrib/earthdistance/.gitignore
  10. 1
      contrib/earthdistance/Makefile
  11. 2
      contrib/file_fdw/.gitignore
  12. 2
      contrib/hstore/.gitignore
  13. 2
      contrib/intarray/.gitignore
  14. 2
      contrib/ltree/.gitignore
  15. 2
      contrib/pg_trgm/.gitignore
  16. 2
      contrib/pgcrypto/.gitignore
  17. 2
      contrib/seg/.gitignore
  18. 2
      contrib/tablefunc/.gitignore
  19. 2
      contrib/test_parser/.gitignore
  20. 2
      contrib/tsearch2/.gitignore
  21. 2
      contrib/unaccent/.gitignore
  22. 2
      contrib/xml2/.gitignore
  23. 13
      src/makefiles/pgxs.mk
  24. 25
      src/test/regress/pg_regress.c

@ -60,8 +60,7 @@ check: all
check installcheck installcheck-parallel:
$(MAKE) -C src/test $@
# TODO: add contrib
$(call recurse,check-world,src/test src/pl src/interfaces/ecpg,check)
$(call recurse,check-world,src/test src/pl src/interfaces/ecpg contrib,check)
$(call recurse,installcheck-world,src/test src/pl src/interfaces/ecpg contrib,installcheck)

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,4 +1,6 @@
/cubeparse.c
/cubescan.c
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -6,6 +6,7 @@ EXTENSION = earthdistance
DATA = earthdistance--1.0.sql earthdistance--unpackaged--1.0.sql
REGRESS = earthdistance
REGRESS_OPTS = --extra-install=contrib/cube
LDFLAGS_SL += $(filter -lm, $(LIBS))

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,4 +1,6 @@
/segparse.c
/segscan.c
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -1,2 +1,4 @@
# Generated subdirectories
/log/
/results/
/tmp_check/

@ -281,13 +281,14 @@ endif
installcheck: submake
$(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
# in-tree test doesn't work yet (no way to install my shared library)
#check: all submake
# $(pg_regress_check) $(REGRESS_OPTS) $(REGRESS)
ifdef PGXS
check:
@echo "'make check' is not supported."
@echo "Do 'make install', then 'make installcheck' instead."
@exit 1
@echo '"$(MAKE) check" is not supported.'
@echo 'Do "$(MAKE) install", then "$(MAKE) installcheck" instead.'
else
check: all submake
$(pg_regress_check) --extra-install=$(subdir) $(REGRESS_OPTS) $(REGRESS)
endif
endif # REGRESS

@ -102,6 +102,7 @@ static bool port_specified_by_user = false;
static char *dlpath = PKGLIBDIR;
static char *user = NULL;
static _stringlist *extraroles = NULL;
static _stringlist *extra_install = NULL;
/* internal variables */
static const char *progname;
@ -1896,6 +1897,7 @@ help(void)
printf(_(" --top-builddir=DIR (relative) path to top level build directory\n"));
printf(_(" --port=PORT start postmaster on PORT\n"));
printf(_(" --temp-config=PATH append contents of PATH to temporary config\n"));
printf(_(" --extra-install=DIR additional directory to install (e.g., contrib\n"));
printf(_("\n"));
printf(_("Options for using an existing installation:\n"));
printf(_(" --host=HOST use postmaster running on HOST\n"));
@ -1943,6 +1945,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
{"use-existing", no_argument, NULL, 20},
{"launcher", required_argument, NULL, 21},
{"load-extension", required_argument, NULL, 22},
{"extra-install", required_argument, NULL, 23},
{NULL, 0, NULL, 0}
};
@ -2042,6 +2045,9 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
case 22:
add_stringlist_item(&loadextension, optarg);
break;
case 23:
add_stringlist_item(&extra_install, optarg);
break;
default:
/* getopt_long already emitted a complaint */
fprintf(stderr, _("\nTry \"%s -h\" for more information.\n"),
@ -2086,6 +2092,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
if (temp_install)
{
FILE *pg_conf;
_stringlist *sl;
/*
* Prepare the temp installation
@ -2128,6 +2135,24 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
exit_nicely(2);
}
for (sl = extra_install; sl != NULL; sl = sl->next)
{
#ifndef WIN32_ONLY_COMPILER
snprintf(buf, sizeof(buf),
SYSTEMQUOTE "\"%s\" -C \"%s/%s\" DESTDIR=\"%s/install\" install >> \"%s/log/install.log\" 2>&1" SYSTEMQUOTE,
makeprog, top_builddir, sl->str, temp_install, outputdir);
#else
fprintf(stderr, _("\n%s: --extra-install option not supported on this platform\n", progname));
exit_nicely(2);
#endif
if (system(buf))
{
fprintf(stderr, _("\n%s: installation failed\nExamine %s/log/install.log for the reason.\nCommand was: %s\n"), progname, outputdir, buf);
exit_nicely(2);
}
}
/* initdb */
header(_("initializing database system"));
snprintf(buf, sizeof(buf),

Loading…
Cancel
Save