[Top][All Lists]

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

Re: yaccvpath.test

From: Alexandre Duret-Lutz
Subject: Re: yaccvpath.test
Date: 28 Feb 2001 09:40:34 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>> "Tom" == Tom Tromey <address@hidden> writes:

 >>>>>> "Pavel" == Pavel Roskin <address@hidden> writes:
 Pavel> I don't quite understand whether your test is supposed to work
 Pavel> or not.  It's failing for me (besides the typo in
 Pavel> tests/ that I've just fixed).

 Tom> Alexandre claims it fails.
 Tom> I've updated it a bit.  Now it works for me.
 Tom> Alexandre, can you investigate the change?

 Tom> I changed it to only configure and build once.

 Tom> Actually, sometimes bison complains when I run the test and sometimes
 Tom> it does not.  Weird.

Ok, I think I have fixed the testcase (I mean, it now fails succesfully :))

It seems it was a timestamp issue.  First parse.y is create, then
parse.c is generated, (this takes less than a second since you removed
the first configure/make call); if parse.y is updated during this same
second, parse.c is considered up-to-date by make, and make distcheck
doesn't complain.  I have fixed that in two ways:

  - when parse.y is updated, add a string that can be grepped for
    latter in parse.c; and grep for this string in the fresh
    distribution made by make distcheck (make dist would be enough).
  - add a sleep before updating parse.y

Actually grepping is not needed when `make distcheck' does its job
correctly, so if you think two checks for the same things are too much
you might want to remove the grep call, or replace `make distcheck' by
`make dist'.

2001-02-27  Alexandre Duret-Lutz  <address@hidden>

        * tests/yaccvpath.test: Check for no gzip; run bison in yacc mode;
        sleep before updating parse.y to have a different timestamp;
        append a comment to parse.y instead of adding an usused rule;
        grep for that comment in the resulting parse.c from the distribution
        in addition to running make distcheck.

--- tests/yaccvpath.test.old    Tue Feb 27 20:18:29 2001
+++ tests/yaccvpath.test        Tue Feb 27 20:55:03 2001
@@ -42,10 +42,11 @@
 (gcc -v) > /dev/null 2>&1 || exit 77
 (flex -V) > /dev/null 2>&1 || exit 77
 (bison -V) > /dev/null 2>&1 || exit 77
+(gzip -V) > /dev/null 2>&1 || exit 77
 export LEX
+YACC='bison -y'
 export YACC
 # Remove some files installed by defs.
@@ -58,11 +59,16 @@
-bison -y parse.y
+$YACC parse.y
 mv parse.c
+# sleep to make sure the timestamp of parse.y will be
+# different from the timestamp of parse.c when make distcheck run.
+sleep 2
 cat >> parse.y << 'END'
-fubar : 'f' foobar {};
+/* GrepMe */
 mkdir sub
@@ -70,3 +76,8 @@
 $MAKE distcheck
+# distcheck should be king enough to detect if parse.c is up-to-date
+# in the distribution.
+# Below is another way to test for the same thing.
+gzip -d -c foo-0.1.tar.gz | tar xf -
+grep GrepMe foo-0.1/parse.c


Alexandre Duret-Lutz

reply via email to

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