diff --git a/HISTORY.asc b/HISTORY.asc index 3d588c0..8ebcb06 100644 --- a/HISTORY.asc +++ b/HISTORY.asc @@ -1,3 +1,26 @@ +STABLE +------ +== Bug fixes + +=== Fix targets that ignored a failure partway through a loop +Several targets run one command per file or per extension, and a failure +partway through was ignored. They now fail as soon as any one +command fails: + +* `make pgtle` exited 0 if `pgtle.sh` failed for any extension other than + the last one. +* `make results` exited 0 if copying any `test/results/*.out` file other + than the last one into `test/expected/` failed. +* `make results-build` exited 0 if copying any file into + `test/build/expected/` failed, including the last one. +* `make print-pgtle` exited 0 if reading the generated SQL for any + extension other than the last one failed. +* With `PGXNTOOL_ENABLE_TEST_INSTALL=yes`, a failed write to + `test/install/schedule` for any file other than the last one left an + incomplete schedule without an error. + +Issues fixed in this release: #140 + 2.4.0 ----- == Breaking changes diff --git a/base.mk b/base.mk index 36c7e79..f990b92 100644 --- a/base.mk +++ b/base.mk @@ -423,7 +423,7 @@ REGRESS_OPTS += --schedule=$(_PGXNTOOL_INSTALL_SCHEDULE) $(_PGXNTOOL_INSTALL_SCHEDULE): @echo "# Auto-generated - DO NOT EDIT" > $@ @for f in $(notdir $(basename $(TEST_INSTALL_SQL_FILES))); do \ - echo "test: ../install/$$f" >> $@; \ + echo "test: ../install/$$f" >> $@ || exit 1; \ done installcheck: $(_PGXNTOOL_INSTALL_SCHEDULE) @@ -579,7 +579,7 @@ endif @mkdir -p $(TESTDIR)/expected @for f in $(TESTOUT)/results/*.out; do \ [ -f "$$f" ] || continue; \ - cp "$$f" $(TESTDIR)/expected/$$(basename "$$f"); \ + cp "$$f" $(TESTDIR)/expected/$$(basename "$$f") || exit 1; \ done # testdeps is a generic dependency target that you can add targets to @@ -605,8 +605,9 @@ _PGXNTOOL_EXTENSIONS = $(basename $(_PGXNTOOL_CONTROL_FILES)) # with this variable silently instead of erroring. .PHONY: pgtle pgtle: all control.mk $(_PGXNTOOL_CONTROL_FILES) - @$(foreach ext,$(_PGXNTOOL_EXTENSIONS),\ - $(PGXNTOOL_DIR)/pgtle.sh --extension $(ext) $(if $(PGXNTOOL_PGTLE_VERSION),--pgtle-version $(PGXNTOOL_PGTLE_VERSION));) + @for ext in $(_PGXNTOOL_EXTENSIONS); do \ + $(PGXNTOOL_DIR)/pgtle.sh --extension $$ext $(if $(PGXNTOOL_PGTLE_VERSION),--pgtle-version $(PGXNTOOL_PGTLE_VERSION)) || exit 1; \ + done # # pg_tle installation support @@ -670,7 +671,7 @@ print-pgtle: pgtle echo "ERROR: $$f does not exist (run 'make pgtle' first)" >&2; \ exit 1; \ fi; \ - cat "$$f";) + cat "$$f" || exit 1;) # These targets ensure all the relevant directories exist $(TESTDIR)/sql/ $(TESTDIR)/expected/ $(TESTOUT)/results/: @@ -779,7 +780,7 @@ results-build: echo " cp $$f $(TESTDIR)/build/expected/$$(basename "$$f")" >&2; \ skipped=1; continue; \ fi; \ - cp "$$f" $(TESTDIR)/build/expected/$$(basename "$$f"); \ + cp "$$f" $(TESTDIR)/build/expected/$$(basename "$$f") || exit 1; \ done; \ [ "$$skipped" = 0 ] || exit 1 endif