[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#35762: When `test-driver` script + `check` testing framework are wri

From: howaboutsynergy
Subject: bug#35762: When `test-driver` script + `check` testing framework are writing to same logfile = corrupted output
Date: Thu, 16 May 2019 08:07:36 +0000

Hi. This isn't a bug, but just to inform you that `test-driver` redirecting 
stdout(and stderr) to the log file, coupled with  the test itself also writing 
to the same log file(for whatever reason), will result in them both using the 
same outfile (with different descriptors) thus corrupted output is the result.

For an example of what happens, see this comment: 
https://github.com/libcheck/check/issues/188#issuecomment-492794060 which I'll 
reproduce below for easy reading.

For exact reproduction steps with using `check` (the unit test framework for C) 
see the previous comment aka 

#include <stdio.h>

int main() {
  f = fopen("/tmp/a_out_.log", "w");
  if (NULL == f) {
  } else {
    fprintf(stdout, "Something");
    fprintf(f," messy ");
    fprintf(f," jessy\n");
    fprintf(stdout, " or another\n");
    fprintf(f,"More stuff\n");


$ gcc a.c && { ./a.out >/tmp/a_out_.log ; cat /tmp/a_out_.log ; }
Something or another

That's basically what happens.

I'm on Arch Linux, and have the following versions:

local/autoconf 2.69-5 (base-devel)
    A GNU tool for automatically configuring source code
local/autoconf2.13 2.13-5
    A GNU tool for automatically configuring source code (Legacy 2.1x version)
local/automake 1.16.1-1 (base-devel)
    A GNU tool for automatically creating Makefiles

$ automake --version
automake (GNU automake) 1.16.1

$ autoconf --version
autoconf (GNU Autoconf) 2.69

$ make --version
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu

  # test-driver - basic testsuite driver script.

  scriptversion=2018-03-07.03; # UTC


Attachment: publickey - howaboutsynergy@protonmail.com - 0x947B9B34.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]