Commit Graph

660 Commits

Author SHA1 Message Date
Joseph Myers 6e89caf118 Split up rules for tests that compare output with baselines.
This patch splits makefile rules that generate a file then run cmp to
check the contents of that file into separate rules to generate and
compare the file.  This simplifies making those tests generate PASS /
FAIL results, by removing the need to insert && between commands in
the test so that a $(evaluate-test) call is reached.  It also avoids
the oddity of the .out file being an intermediate file rather than the
final result generated, as noted for some of these tests in
<https://sourceware.org/ml/libc-alpha/2012-10/msg00894.html>.

In many cases, the rule to run the program was no longer needed
because the default rules for running test programs on the host to
generate a .out file sufficed.  (I'm not asserting the commands run
after this patch are *exactly* the same as before, simply that the
rules did nothing special that appeared deliberate or relevant to
anything about what the tests were testing.  In cases where the rules
redirected stderr as well as stdout, I left the existing rule's
redirection in place to avoid changing what gets compared with the
expected results.)

It's clear there is a lot in common between the various -cmp.out rules
and it might be possible in future to refactor them into more generic
support for the case of comparing test output against a baseline.
(Some baselines are *.exp, some *.expect, some directly embedded in
the makefiles, and nptl/tst-cleanupx0.expect appears unused.)

Tested x86_64.

	* elf/Makefile ($(objpfx)order.out): Remove rule.
	[$(run-built-tests) = yes] (tests): Depend on
	$(objpfx)order-cmp.out.
	($(objpfx)order-cmp.out): New rule.
	[$(run-built-tests) = yes] (tests): Depend on
	$(objpfx)tst-array1-cmp.out, $(objpfx)tst-array1-static-cmp.out,
	$(objpfx)tst-array2-cmp.out, $(objpfx)tst-array3-cmp.out,
	$(objpfx)tst-array4-cmp.out, $(objpfx)tst-array5-cmp.out and
	$(objpfx)tst-array5-static-cmp.out.
	($(objpfx)tst-array1.out): Remove rule.
	($(objpfx)tst-array1-cmp.out): New rule.
	($(objpfx)tst-array1-static.out): Remove rule.
	($(objpfx)tst-array1-static-cmp.out): New rule.
	($(objpfx)tst-array2.out): Remove rule.
	($(objpfx)tst-array2-cmp.out): New rule.
	($(objpfx)tst-array3.out): Remove rule.
	($(objpfx)tst-array3-cmp.out): New rule.
	($(objpfx)tst-array4.out): Remove rule.
	($(objpfx)tst-array4-cmp.out): New rule.
	($(objpfx)tst-array5.out): Remove rule.
	($(objpfx)tst-array5-cmp.out): New rule.
	($(objpfx)tst-array5-static.out): Remove rule.
	($(objpfx)tst-array5-static-cmp.out): New rule.
	[$(run-built-tests) = yes] (tests): Depend on
	$(objpfx)order2-cmp.out.
	($(objpfx)order2.out): Remove rule.
	($(objpfx)order2-cmp.out): New rule.
	($(objpfx)tst-initorder.out): Remove rule.
	[$(run-built-tests) = yes] (tests): Depend on
	$(objpfx)tst-initorder-cmp.out.
	($(objpfx)tst-initorder-cmp.out): New rule.
	($(objpfx)tst-initorder2.out): Remove rule.
	[$(run-built-tests) = yes] (tests): Depend on
	$(objpfx)tst-initorder2-cmp.out.
	($(objpfx)tst-initorder2-cmp.out): New rule.
	[$(run-built-tests) = yes] (tests): Depend on
	$(objpfx)tst-unused-dep-cmp.out.
	($(objpfx)tst-unused-dep-cmp.out): Do not run cmp.
	($(objpfx)tst-unused-dep-cmp.out): New rule.
	* stdio-common/Makefile [$(run-built-tests) = yes] (tests): Depend
	on $(objpfx)tst-setvbuf1-cmp.out.
	($(objpfx)tst-setvbuf1.out): Do not run cmp.
	($(objpfx)tst-setvbuf1-cmp.out): New rule.
	* string/Makefile [$(run-built-tests) = yes] (tests): Depend
	$(objpfx)tst-svc-cmp.out instead of $(objpfx)tst-svc.out.
	($(objpfx)tst-svc.out): Remove rule.
	($(objpfx)tst-svc-cmp.out): New rule.

nptl:
	* Makefile ($(objpfx)tst-cleanup0.out): Do not run cmp.
	[$(run-built-tests) = yes] (tests): Depend on
	$(objpfx)tst-cleanup0-cmp.out.
	($(objpfx)tst-cleanup0-cmp.out): New rule.
2014-02-14 13:42:44 +00:00
Joseph Myers a2c4c1991d Remove indirection in stdio-common tests dependencies.
stdio-common/Makefile has the tests target depend on two test output
files indirectly through rules do-tst-unbputc and do-tst-printf.  I
see no reason for such an indirection, and everywhere else the tests
just depend on the output files directly, so this patch removes the
indirection.

Tested x86_64.

	* stdio-common/Makefile (do-tst-unbputc): Remove target.
	(do-tst-printf): Likewise.
	(tests): Depend directly on $(objpfx)tst-unbputc.out and
	$(objpfx)tst-printf.out.
2014-02-12 22:19:20 +00:00
David S. Miller 195b8165ac Fix tst-sscanf and tst-swscanf on 64-bit.
* stdio-common/tst-sscanf.c (main): Use 'long' for 'dummy' when
	processing int_tests.
2014-02-11 00:37:53 -08:00
Ondřej Bílka a1ffb40e32 Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
Ondřej Bílka 94c8a4bc57 Fix integer overflow in vfwprintf. Fixes bug 14286. 2014-01-07 12:05:32 +01:00
Allan McRae d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Ondřej Bílka 728dab0e13 Do not let scanf("%4p") accept "(nil)". Fixes bug 16055 2013-11-18 12:42:23 +01:00
Andreas Schwab a4966c6104 Fix parsing of 0e+0 as float 2013-10-31 12:51:03 +01:00
Andreas Schwab 36a4953a1d Let tst-swscanf find its locale 2013-10-29 17:24:53 +01:00
Yuri Chornoivan 5560275828 Fix typos. 2013-10-12 14:47:50 +02:00
Eric Biggers 3d110c7c6e Fix fwrite() reading beyond end of buffer in error path
Partially revert commits 2b766585f9 and
de2fd463b1, which were intended to fix BZ#11741
but caused another, likely worse bug, namely that fwrite() and fputs() could,
in an error path, read data beyond the end of the specified buffer, and
potentially even write this data to the file.

Fix BZ#11741 properly by checking the return value from _IO_padn() in
stdio-common/vfprintf.c.
2013-10-11 22:29:38 +05:30
Alan Modra 1b6adf888d PowerPC floating point little-endian [1 of 15]
http://sourceware.org/ml/libc-alpha/2013-08/msg00081.html

This is the first of a series of patches to ban ieee854_long_double
and the ieee854_long_double macros when using IBM long double.  union
ieee854_long_double just isn't correct for IBM long double, especially
when little-endian, and pretending it is OK has allowed a number of
bugs to remain undetected in sysdeps/ieee754/ldbl-128ibm/.

This changes the few places in generic code that use it.

	* stdio-common/printf_size.c (__printf_size): Don't use
	union ieee854_long_double in fpnum union.
	* stdio-common/printf_fphex.c (__printf_fphex): Likewise.  Use
	signbit macro to retrieve sign from long double.
	* stdio-common/printf_fp.c (___printf_fp): Use signbit macro to
	retrieve sign from long double.
	* sysdeps/ieee754/ldbl-128ibm/printf_fphex.c: Adjust for fpnum change.
	* sysdeps/ieee754/ldbl-128/printf_fphex.c: Likewise.
	* sysdeps/ieee754/ldbl-96/printf_fphex.c: Likewise.
	* sysdeps/x86_64/fpu/printf_fphex.c: Likewise.
	* math/test-misc.c (main): Don't use union ieee854_long_double.
ports/
	* sysdeps/ia64/fpu/printf_fphex.c: Adjust for fpnum change.
2013-10-04 10:31:41 +09:30
Olivier Langlois 12c22bc4e3 Fix tst-long-dbl-fphex swprintf length calculation. 2013-09-24 16:12:12 -07:00
Ondřej Bílka 382466e04e Fix typos. 2013-08-30 18:08:59 +02:00
Joseph Myers 2e09a79ada Avoid use of "register" as optimization hint. 2013-06-07 22:24:35 +00:00
Ondrej Bilka 350635a59a Fix leading whitespaces. 2013-06-06 20:36:07 +02:00
Joseph Myers 9c84384cc1 Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
Thomas Schwinge 528c24058f * stdio-common/bug26.c (main): Correct fscanf template.
Fixup for commit 6ecec3b616.
2013-05-26 21:59:24 +02:00
Thomas Schwinge 207d1e2a6c Fix coding-style violation.
Introduced in commit ee091edf1a.
2013-04-15 22:11:30 +02:00
Andreas Schwab 6ecec3b616 Don't accept exp char without preceding digits in scanf float parsing 2013-04-11 10:24:37 +02:00
Thomas Schwinge ee091edf1a More tests for external charater sequences representing NaNs. 2013-04-05 22:41:20 +02:00
Thomas Schwinge a8b792d6bb Properly collect individual tests' results.
Fixup for commit 003c9895a8.
2013-04-05 22:39:26 +02:00
Thomas Schwinge 67e971f18f Better distinguish between NaN/qNaN/sNaN. 2013-03-15 19:06:02 +01:00
Thomas Schwinge a57da95516 Remove unused declarations.
Added in commit f83af095b6, and forgotten to be
removed in commit 76f2646f3d.
2013-03-15 19:00:23 +01:00
Paul Pluzhnikov e1b42695ea Replace __builtin_expect(..., 0) with __glibc_unlikely(). 2013-03-05 21:38:19 -08:00
Paul Pluzhnikov cdcf361fda * stdio-common/vfprintf.c (vfprintf): Check malloc return; don't
call free(NULL).
2013-03-05 13:44:33 -08:00
Joseph Myers 70d9946a44 Remove __ptrvalue, __bounded and __unbounded. 2013-02-13 23:30:40 +00:00
H.J. Lu 740b3dbee8 Add --enable-hardcoded-path-in-tests configure option 2013-01-11 07:14:18 -08:00
Joseph Myers 568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Joseph Myers f4cf5f2d8b Add script to update copyright notices and reformat some to facilitate its use. 2013-01-01 16:29:10 +00:00
Siddhesh Poyarekar 7728c57488 Add newline to last test in stdio-common/tst-put-error.c
The newline ensures that the buffer is flushed and the test executes
as expected.
2012-12-06 11:10:18 +05:30
Joseph Myers 363313b5be Increase width of padded output in stdio-common/tst-put-error. 2012-12-05 20:02:41 +00:00
Joseph Myers be14d48f5a Fix more set-but-not-used warnings in _itowa.c. 2012-11-20 00:05:23 +00:00
Siddhesh Poyarekar 2b766585f9 printf should return negative value on error
[BZ #11741]
Fixed bug where printf and family may return a spurious success when
printing padded formats.
2012-11-16 19:13:11 +05:30
Thomas Schwinge b830319d49 [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
Joseph Myers 03ac099f6b Define and use $(run-built-tests). 2012-10-24 00:08:46 +00:00
Jeff Law 715a900c90 2012-09-28 Andreas Schwab <schwab@linux-m68k.org>
[BZ #6530]
        * stdio-common/vfprintf.c (process_string_arg): Revert
        2000-07-22 change.

2011-09-28  Jonathan Nieder  <jrnieder@gmail.com>

        * stdio-common/Makefile (tst-sprintf-ENV): Set environment
        for testcase.
        * stdio-common/tst-sprintf.c: Include <locale.h>
        (main): Test sprintf's handling of incomplete multibyte
        characters.
2012-09-28 12:49:51 -06:00
Dmitry V. Levin 57c69bef13 Set "fail on error" mode directly in testsuite shell scripts 2012-09-25 02:48:31 +00:00
Joseph Myers a9f8e53a5b Make printf respect the rounding mode for hex output (bug 5044). 2012-09-24 15:38:21 +00:00
Joseph Myers 784761bee3 Make printf respect the rounding mode for decimal output (bug 5044). 2012-09-14 20:18:49 +00:00
Andreas Jaeger 88d506def0 Fix last patch: Add missing DUMMY variable 2012-08-18 18:01:46 +02:00
Roland McGrath c75ccd4c3a Clean up definition of _LIBC_REENTRANT and _IO_MTSAFE_IO. 2012-08-17 09:35:15 -07:00
Roland McGrath db1ee0a836 Suppress -Wunused-but-set warnings in GMP code. 2012-08-16 14:08:47 -07:00
Roland McGrath bea9b19322 Fix lots of bitrot for stub configurations. 2012-07-30 16:34:33 -07:00
Andreas Schwab 5be8418cb0 Remove use of INTDEF/INTUSE in stdio-common 2012-06-01 01:25:41 +02:00
Jeff Law b0bc23a177 2012-05-24 Jeff Law <law@redhat.com>
* stdio-common/Makefile (tests): Add bug25.
        * stdio-common/bug25.c: New test.
2012-05-24 21:30:43 -06:00
Andreas Schwab d18ea0c5e6 Remove use of INTDEF/INTUSE in libio 2012-05-24 23:06:20 +02:00
Andreas Jaeger 5fefb43629 [BZ #13691], Revert breakage of iconv() converter for TCVN-5712.
* iconvdata/tcvn5712-1.c (BODY for FROM_LOOP): Don't consider
	inptr and inend for must_buffer_ch.
	* wcsmbs/tst-mbsnrtowcs.c: Remove file.
	* wcsmbs/Makefile (tests): Remove tst-mbsnrtowcs.
	* stdio-common/Makefile (tests): Remove bug15.
	(bug15-ENV): Remove macro.
	* stdio-common/bug15.c: Remove, we do not support vi_VN.TCVN5712-1
	anymore.

localedata:
	* SUPPORTED: Remove vi_VN.TCVN/TCVN5712-1.
	* tst-strptime.c: Remove, we do not support vi_VN.TCVN5712-1
	anymore.
	* Makefile (LOCALES): Remove vi_VN.TCVN5712-1 from list.
	(tests): Remove tst-strptime.
2012-05-21 20:41:36 +02:00
H.J. Lu 94b07d20dd Check _ITOA_NEEDED and use _ITOA_WORD_TYPE 2012-05-18 06:03:04 -07:00
Chris Metcalf 286abc3dea Bump up stdio bug22 timeout from 30 seconds to 60 seconds
The older Tilera platform (tilepro) needs just a hair over 30 seconds
to run this on one core.
2012-05-17 12:59:08 -04:00