bug-gperf
[Top][All Lists]
Advanced

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

Re: [bug-gperf] [PATCH] Fix issues with parallel make check


From: Bruno Haible
Subject: Re: [bug-gperf] [PATCH] Fix issues with parallel make check
Date: Sun, 20 Dec 2009 10:43:30 +0100
User-agent: KMail/1.9.9

Hi,

Bryan Østergaard wrote on 2009-10-27:
> As part of Exherbo's normal build process we run make check / make
> test for all packages. We've recently started using parallel make for
> that which breaks in a few cases. The attached patch fixes the issues
> for gperf.

Thanks for the report and patch. The patch works for gcc, but not for other
compilers: When you ask a compiler to compile test.c into an executable,
some other compilers create test.o as temporary file in the current
directory. It's only gcc which is good enough to create it in /tmp and
with a randomly chosen name.

Therefore I'm applying this patch instead.


2009-12-20  Bruno Haible  <address@hidden>

        Allow processing the tests with parallel make.
        * tests/Makefile.in (check-link-c, check-link-c++): Remove rules.
        (test.$(OBJEXT), test2.$(OBJEXT)): New rules.
        (check-c): Add commands for building cout. Depend on test.$(OBJEXT).
        (check-ada, check-modula3, check-pascal, check-lang-utf8): Depend on
        test.$(OBJEXT).
        (check-lang-ucs2): Depend on test2.$(OBJEXT).
        Reported by Bryan Østergaard <address@hidden>.

--- tests/Makefile.in.orig      2009-12-20 10:35:57.000000000 +0100
+++ tests/Makefile.in   2009-12-20 10:34:54.000000000 +0100
@@ -60,26 +60,20 @@
 
 uninstall :
 
-check : check-link-c check-link-c++ check-c check-ada check-modula3 
check-pascal check-lang-utf8 check-lang-ucs2 check-smtp check-test
+check : check-c check-ada check-modula3 check-pascal check-lang-utf8 
check-lang-ucs2 check-smtp check-test
        @true
 
 extracheck : @CHECK_LANG_SYNTAX@
        @true
 
-check-link-c: force
-       @echo "performing some tests of the perfect hash generator"
-       $(CC) -c $(CFLAGS) $(srcdir)/test.c
+check-c: test.$(OBJEXT)
+       @echo "testing ANSI C reserved words, all items should be found in the 
set"
        $(GPERF) -c -l -S1 -I -o $(srcdir)/c.gperf > cinset.c
        $(CC) $(CFLAGS) $(LDFLAGS) -o cout cinset.c test.$(OBJEXT)
-
-check-link-c++: force
-
-check-c:
-       @echo "testing ANSI C reserved words, all items should be found in the 
set"
        ./cout -v < $(srcdir)/c.gperf | LC_ALL=C tr -d '\r' > c.out
        diff $(srcdir)/c.exp c.out
 
-check-ada:
+check-ada: test.$(OBJEXT)
        $(GPERF) -k1,4,'$$' -I $(srcdir)/ada.gperf > adainset.c
 # double '$$' is only there since make gets confused; program wants only 1 '$'
        $(CC) $(CFLAGS) $(LDFLAGS) -o aout adainset.c test.$(OBJEXT)
@@ -92,14 +86,14 @@
        ./preout -v < $(srcdir)/adadefs.gperf | LC_ALL=C tr -d '\r' > 
ada-pred.out
        diff $(srcdir)/ada-pred.exp ada-pred.out
 
-check-modula3:
+check-modula3: test.$(OBJEXT)
        $(GPERF) -k1,2,'$$' -I -o $(srcdir)/modula3.gperf > m3inset.c
        $(CC) $(CFLAGS) $(LDFLAGS) -o m3out m3inset.c test.$(OBJEXT)
        @echo "testing Modula3 reserved words, all items should be found in the 
set"
        ./m3out -v < $(srcdir)/modula3.gperf | LC_ALL=C tr -d '\r' > modula.out
        diff $(srcdir)/modula.exp modula.out
 
-check-pascal:
+check-pascal: test.$(OBJEXT)
        $(GPERF) -o -S2 -I < $(srcdir)/pascal.gperf > pinset.c
        $(CC) $(CFLAGS) $(LDFLAGS) -o pout pinset.c test.$(OBJEXT)
        @echo "testing Pascal reserved words, all items should be found in the 
set"
@@ -107,22 +101,27 @@
        diff $(srcdir)/pascal.exp pascal.out
 
 # check for 8-bit cleanliness
-check-lang-utf8:
+check-lang-utf8: test.$(OBJEXT)
        $(GPERF) -k1 -t -I -K foreign_name < $(srcdir)/lang-utf8.gperf > 
lu8inset.c
        $(CC) $(CFLAGS) $(LDFLAGS) -o lu8out lu8inset.c test.$(OBJEXT)
        @echo "testing UTF-8 encoded languages, all items should be found in 
the set"
        sed -e '1,6d' -e 's/,.*//' < $(srcdir)/lang-utf8.gperf | ./lu8out -v | 
LC_ALL=C tr -d '\r' > lang-utf8.out
        diff $(srcdir)/lang-utf8.exp lang-utf8.out
 
+test.$(OBJEXT) : $(srcdir)/test.c
+       $(CC) -c $(CFLAGS) $(srcdir)/test.c
+
 # check for binary keywords with NUL bytes
-check-lang-ucs2:
-       $(CC) -c $(CFLAGS) $(srcdir)/test2.c
+check-lang-ucs2: test2.$(OBJEXT)
        $(GPERF) -k4 -t -l -I -K foreign_name < $(srcdir)/lang-ucs2.gperf > 
lu2inset.c
        $(CC) $(CFLAGS) $(LDFLAGS) -o lu2out lu2inset.c test2.$(OBJEXT)
        @echo "testing UCS-2 encoded languages, all items should be found in 
the set"
        ./lu2out -v < $(srcdir)/lang-ucs2.in | LC_ALL=C tr -d '\r' > 
lang-ucs2.out
        diff $(srcdir)/lang-ucs2.exp lang-ucs2.out
 
+test2.$(OBJEXT) : $(srcdir)/test2.c
+       $(CC) -c $(CFLAGS) $(srcdir)/test2.c
+
 # check case-insensitive lookup
 check-smtp:
        @echo "testing SMTP keywords, case-insensitive"




reply via email to

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