All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Triplett <josh@freedesktop.org>
To: Damien Lespiau <damien.lespiau@gmail.com>
Cc: Josh Triplett <josht@linux.vnet.ibm.com>,
	Pavel Roskin <proski@gnu.org>,
	linux-sparse@vger.kernel.org
Subject: Re: [PATCH 6/6] Add a simple test script, embed expected results into test files
Date: Sun, 01 Jul 2007 22:19:00 -0700	[thread overview]
Message-ID: <46888AC4.4050005@freedesktop.org> (raw)
In-Reply-To: <cbf3148c0707012159l65432435we10fd9370c282dc4@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1884 bytes --]

Damien Lespiau wrote:
> A small update,
> 
>> Yes, but I still prefer the delimited format for readability.
> 
> Ok: expected output is now between check-output-start / check-output-end
> tags.
> I've added a clean-check target in the Makefile, updated the provided
> test-cases and documentation.

Thanks!  Will review and apply soon.

>> You can't redirect two things independently to the same file; that will
>> open the file twice, and the writes will conflict, giving exactly the
>> result you saw.  > o 2>&1 should work; it has exactly the same effect as
>> &> .
> 
> For some reason I was expecting that:
> 
> [pid  8877] open("o", O_WRONLY|O_CREAT|O_TRUNC| \
>         O_LARGEFILE, 0666) = 3
> [pid  8877] dup2(3, 1)                  = 1
> [pid  8877] close(3)                    = 0
> [pid  8877] open("o", O_WRONLY|O_CREAT|O_TRUNC| \
>         O_LARGEFILE, 0666) = 3
> [pid  8877] dup2(3, 2)                  = 2
> [pid  8877] close(3)                    = 0
> 
> and
> 
> [pid 10777] open("o", O_WRONLY|O_CREAT|O_TRUNC| \
>         O_LARGEFILE, 0666) = 3
> [pid 10777] dup2(3, 1)                  = 1
> [pid 10777] close(3)                    = 0
> [pid 10777] dup2(1, 2)                  = 2
> 
> followed by:
> 
> [pid  xxxxx] write(2, "validation/preprocessor19.c:4:9:"..., 73) = 73
> [pid  xxxxx] write(2, "validation/preprocessor19.c:3:9:"..., 66) = 66
> [pid  xxxxx] write(1, "\ny\n", 3)        = o
> 
> to give the same result and that the first one would not eat characters.

In the first case, fd 1 and fd 2 represent separate open files, and have
independent file offsets; thus, writes through the two file descriptors
overwrite each other.  In the second case, fd 1 and fd 2 represent the same
open file, and have the same file offset, so writes to either one appear in
the file in sequence.

- Josh Triplett


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

  reply	other threads:[~2007-07-02  5:19 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-28  5:39 [PATCH 1/6] Bitfield without explicit sign should be a warning, not an error Pavel Roskin
2007-06-28  5:39 ` [PATCH 2/6] Hardcode actual type sizes, add -m32 support Pavel Roskin
2007-06-28  5:58   ` Al Viro
2007-06-28  6:05     ` Josh Triplett
2007-06-28  6:23       ` Al Viro
2007-06-28  6:27         ` Jeff Garzik
2007-06-28  6:46         ` Josh Triplett
2007-06-28  6:25       ` Jeff Garzik
2007-06-28  6:44         ` Pavel Roskin
2007-06-28  6:47           ` Jeff Garzik
2007-06-28  6:55             ` Josh Triplett
2007-06-28  6:54         ` Josh Triplett
2007-06-28  7:01           ` Jeff Garzik
2007-06-28  7:38             ` Josh Triplett
2007-06-28  6:27       ` Pavel Roskin
2007-06-28  5:40 ` [PATCH 3/6] cgcc: preserve sparse exit code if -no-compile is used Pavel Roskin
2007-06-28  6:12   ` Josh Triplett
2007-06-28  5:40 ` [PATCH 4/6] Avoid use of libc headers in the validation suite Pavel Roskin
2007-06-28  6:14   ` Josh Triplett
2007-06-28  5:40 ` [PATCH 5/6] Fix warnings about undeclared globals, they are irrelevant to the test Pavel Roskin
2007-06-28  6:18   ` Josh Triplett
2007-06-28  5:40 ` [PATCH 6/6] Add a simple test script, embed expected results into test files Pavel Roskin
2007-06-28  7:20   ` Josh Triplett
2007-06-28 18:59     ` Damien Lespiau
2007-06-28 21:21       ` Pavel Roskin
2007-06-28 21:38       ` Josh Triplett
2007-06-29  0:13         ` Damien Lespiau
2007-06-29  0:29           ` Josh Triplett
2007-07-02  4:59             ` Damien Lespiau
2007-07-02  5:19               ` Josh Triplett [this message]
2007-07-08 21:52               ` Josh Triplett
2007-07-09  2:15                 ` Josh Triplett
2007-07-09 21:27                   ` Damien Lespiau
2007-07-11  0:48                     ` Anderson Lizardo
2007-06-28  6:09 ` [PATCH 1/6] Bitfield without explicit sign should be a warning, not an error Josh Triplett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46888AC4.4050005@freedesktop.org \
    --to=josh@freedesktop.org \
    --cc=damien.lespiau@gmail.com \
    --cc=josht@linux.vnet.ibm.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=proski@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.