travis-ci: only print test failures if there are test results available
authorSZEDER Gábor <szeder.dev@gmail.com>
Wed, 27 Dec 2017 16:36:03 +0000 (17:36 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Dec 2017 20:15:22 +0000 (12:15 -0800)
commit677c70799c70a4e176ff3743c7daafe5193b7b2c
treed6c400214030abad6f759d44cd7867bf71392667
parent7e72cfceed2e1e74e6bbe8ab41cacda4a66b0e4a
travis-ci: only print test failures if there are test results available

When a build job running the test suite fails, our
'ci/print-test-failures.sh' script scans all 't/test-results/*.exit'
files to find failed tests and prints their verbose output.  However,
if a build job were to fail before it ever gets to run the test suite,
then there will be no files to match the above pattern and the shell
will take the pattern literally, resulting in errors like this in the
trace log:

  cat: t/test-results/*.exit: No such file or directory
  ------------------------------------------------------------------------
  t/test-results/*.out...
  ------------------------------------------------------------------------
  cat: t/test-results/*.out: No such file or directory

Check upfront and proceed only if there are any such files present.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Reviewed-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ci/print-test-failures.sh