diff mbox

[fixincludes] Fix pthread.h failure (PR other/52626)

Message ID ydd1uolnco9.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth March 21, 2012, 4:25 p.m. UTC
As reported in PR other/52626, make check in fixincludes is currently
failing since I neglected to adapt the baseline for the Solaris 8
removal ;-(  I always meant to run make check, but forgot.

On the other hand, it would be really helpful if fixincludes make check
could emit DejaGnu-style fixincludes.{sum, log} files which would
automatically be picked up by make mail-report.log and make failures
immediately obvious.

The following patch fixes this, tested with make check in fixincludes on
i386-pc-solaris2.11.

Ok for mainline?

	Rainer


2012-03-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR other/52626
	* tests/base/pthread.h [SOLARIS_MUTEX_INIT_2_CHECK]
	(PTHREAD_COND_INITIALIZER): Adapt for solaris_cond_init removal.

Comments

Bruce Korb March 21, 2012, 5:16 p.m. UTC | #1
Hi Rainer,

On Wed, Mar 21, 2012 at 9:25 AM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> As reported in PR other/52626, make check in fixincludes is currently
> failing since I neglected to adapt the baseline for the Solaris 8
> removal ;-(  I always meant to run make check, but forgot.
>
> On the other hand, it would be really helpful if fixincludes make check
> could emit DejaGnu-style fixincludes.{sum, log} files which would
> automatically be picked up by make mail-report.log and make failures
> immediately obvious.

Patch welcome!  I, myself, don't know what "emit DejaGnu-style
fixincludes.{sum, log} files" would mean.

> The following patch fixes this, tested with make check in fixincludes on
> i386-pc-solaris2.11.
>
> Ok for mainline?

I'm sure you examined the difference by hand and confirmed that the change is
expected.  Then yes, please, by all means.  Thank you!  - Bruce
Mike Stump March 21, 2012, 9:46 p.m. UTC | #2
On Mar 21, 2012, at 10:16 AM, Bruce Korb wrote:
> Patch welcome!  I, myself, don't know what "emit DejaGnu-style
> fixincludes.{sum, log} files" would mean.

Rather simple...  In a file called fixinclude.sum, put

  PASS: unique string

or

  FAIL: unique string

one per line, as many times as you want.  The unique strings should be meaningful to you in some way, and be stable over long periods of time (no `pwd` or `date` in them for example).  You can write a python script, a awk script, a bash script or a c program to generate this.  You can synthesize this from any source you can pull from, for example, the existing testing code or test report you might have.

Bonus points if you can total passes and failures:

exec >>$file
echo
echo "# of expected passes            $(cat $file | grep 'PASS:' | wc -l)"
echo "# of expected failures            $(cat $file | grep 'FAIL:' | wc -l)"

at the end of the file.  The above by the way, will add it (/bin/sh style), if you just create the $file.  That's it, done.  For example, if you just had a single, it all worked flawlessly thing, you could do:

if check-cmd; then
 echo "PASS: fixinclude"
else
 echo "FAIL: fixinclude"
fi

and then the code above, and viola, you're done.  To create the .log file, cp fixincludes.sum fixincludes.log, if you have nothing better to do.
Mike Stump March 21, 2012, 9:52 p.m. UTC | #3
On Mar 21, 2012, at 2:46 PM, Mike Stump wrote:
> echo "# of expected failures            $(cat $file | grep 'FAIL:' | wc -l)"

Oh, and if you expect perfection, you should use:

echo "# of unexpected failures            $(cat $file | grep 'FAIL:' | wc -l)"

instead.
diff mbox

Patch

# HG changeset patch
# Parent aa297e98c9489d9734c7a503fc3275455c33985e
Fix pthread.h failure (PR other/52626)

diff --git a/fixincludes/tests/base/pthread.h b/fixincludes/tests/base/pthread.h
--- a/fixincludes/tests/base/pthread.h
+++ b/fixincludes/tests/base/pthread.h
@@ -83,9 +83,9 @@  extern int __sigsetjmp (struct __jmp_buf
 #define PTHREAD_MUTEX_INITIALIZER	{{{0},0}, {{{0}}}, {0}}
 #endif
 #if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
-#define PTHREAD_COND_INITIALIZER	{{{0}, 0, 0x4356}, 0}	/* DEFAULTCV */
+#define PTHREAD_COND_INITIALIZER	{{{0}, 0}, 0}	/* DEFAULTCV */
 #else
-#define PTHREAD_COND_INITIALIZER	{{{0}, 0, 0x4356}, {0}}	/* DEFAULTCV */
+#define PTHREAD_COND_INITIALIZER	{{{0}, 0}, {0}}	/* DEFAULTCV */
 #endif
 #if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
 #define	PTHREAD_MUTEX_INITIALIZER		/* = DEFAULTMUTEX */	\