Merge bitcoin/bitcoin#24715: build, test: Fix test logfile name

8b517fae7e build, refactor: Replace tabs with spaces (Hennadii Stepanov)
dc0774cbdf build, test: Fix test logfile name (Hennadii Stepanov)

Pull request description:

  Recently merged bitcoin/bitcoin#19385 was flawed as it tries to `cat` a non-existed logfile:
  - https://github.com/bitcoin/bitcoin/pull/19385#discussion_r835300701
  - https://github.com/bitcoin/bitcoin/pull/19385#issuecomment-1082748549

  Closes bitcoin/bitcoin#17224.

ACKs for top commit:
  luke-jr:
    utACK 8b517fae7e

Tree-SHA512: 6c6dab6d7d38b5e949f1159ddff8e431f26d7254157f8308d63383c0642154271107e384c77722b7cf77f0be204bd21d69f3a9e93a8d19cf48954ac673df6c7a
This commit is contained in:
MarcoFalke
2022-03-31 08:27:12 +02:00

View File

@@ -388,16 +388,16 @@ endif
@echo Running tests: $$(\ @echo Running tests: $$(\
cat $< | \ cat $< | \
grep -E "(BOOST_FIXTURE_TEST_SUITE\\(|BOOST_AUTO_TEST_SUITE\\()" | \ grep -E "(BOOST_FIXTURE_TEST_SUITE\\(|BOOST_AUTO_TEST_SUITE\\()" | \
cut -d '(' -f 2 | cut -d ',' -f 1 | cut -d ')' -f 1) \ cut -d '(' -f 2 | cut -d ',' -f 1 | cut -d ')' -f 1\
from $< ) from $<
$(AM_V_at)$(TEST_BINARY) \ $(AM_V_at)export TEST_LOGFILE=$(abs_builddir)/$$(\
--catch_system_errors=no -l test_suite -t "$$(\ echo $< | grep -E -o "(wallet/test/.*\.cpp|test/.*\.cpp)" | $(SED) -e s/\.cpp/.log/ \
) && \
$(TEST_BINARY) --catch_system_errors=no -l test_suite -t "$$(\
cat $< | \ cat $< | \
grep -E "(BOOST_FIXTURE_TEST_SUITE\\(|BOOST_AUTO_TEST_SUITE\\()" | \ grep -E "(BOOST_FIXTURE_TEST_SUITE\\(|BOOST_AUTO_TEST_SUITE\\()" | \
cut -d '(' -f 2 | cut -d ',' -f 1 | cut -d ')' -f 1\ cut -d '(' -f 2 | cut -d ',' -f 1 | cut -d ')' -f 1\
)" -- DEBUG_LOG_OUT > $(abs_builddir)/$$(\ )" -- DEBUG_LOG_OUT > "$$TEST_LOGFILE" 2>&1 || (cat "$$TEST_LOGFILE" && false)
echo $< | grep -E -o "(wallet/test/.*\.cpp|test/.*\.cpp)" | $(SED) -e s/\.cpp/.log/\
) 2>&1 || (cat $<.log && false)
%.json.h: %.json %.json.h: %.json
@$(MKDIR_P) $(@D) @$(MKDIR_P) $(@D)