Merge #685: Fix issue where travis does not show the ./tests seed…

a0771d1 Explicitly disable buffering for stderr in tests (Jonas Nick)
fb424fb Make travis show the ./tests seed by removing stdout buffering and always cat tests.log after a travis run. (Jonas Nick)

Pull request description:

  …by removing stdout buffering and always cat tests.log after a travis run. Fixes #645.

  I noticed that according to the [doc](https://www.gnu.org/software/automake/manual/html_node/Parallel-Test-Harness.html) tests.log should contain stdout as well as stderr. But it doesn't because stdout isn't flushed. I removed buffering completely to avoid having to call `fflush` twice.

  Travis is instructed to always show the seed which seems helpful with `after_script` by `cat`ing `./tests.log`. In case the tests fail it looks like https://travis-ci.org/jonasnick/secp256k1/jobs/606446234.

ACKs for commit a0771d:
  real-or-random:
    ACK a0771d15e67d3fe6ac1791f81d9731f73c550e5e I looked at the diff and checked that it does not break the tests

Tree-SHA512: 3ba37c2d9169867112981bba3d56680000651ef22ef684c3703f26ed3f71bf415fb23875d30059c8247ea9520c9cfad2c9207badf1b33da8fa3b7b7235a8bf16
This commit is contained in:
Tim Ruffing 2019-11-25 15:03:15 +01:00
commit 0db61d25c9
No known key found for this signature in database
GPG Key ID: 8C461CCD293F6011
2 changed files with 15 additions and 2 deletions

View File

@ -77,7 +77,7 @@ matrix:
apt:
packages:
- valgrind
before_install: mkdir -p `dirname $GUAVA_JAR`
install: if [ ! -f $GUAVA_JAR ]; then wget $GUAVA_URL -O $GUAVA_JAR; fi
before_script: ./autogen.sh
@ -93,4 +93,8 @@ script:
make -j2 &&
travis_wait 30 valgrind --error-exitcode=42 ./tests 16 &&
travis_wait 30 valgrind --error-exitcode=42 ./exhaustive_tests;
fi
fi
after_script:
- cat ./tests.log
- cat ./exhaustive_tests.log

View File

@ -5169,6 +5169,15 @@ void run_ecdsa_openssl(void) {
int main(int argc, char **argv) {
unsigned char seed16[16] = {0};
unsigned char run32[32] = {0};
/* Disable buffering for stdout to improve reliability of getting
* diagnostic information. Happens right at the start of main because
* setbuf must be used before any other operation on the stream. */
setbuf(stdout, NULL);
/* Also disable buffering for stderr because it's not guaranteed that it's
* unbuffered on all systems. */
setbuf(stderr, NULL);
/* find iteration count */
if (argc > 1) {
count = strtol(argv[1], NULL, 0);