about summary refs log tree commit diff
path: root/math/libm-test-support.h
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2018-08-09 15:34:12 +0000
committerJoseph Myers <joseph@codesourcery.com>2018-08-09 15:34:12 +0000
commit2813e41e9049ccd0c75edc19c4fdefb21213b495 (patch)
tree1b60b7cd3434f9756b373963c5e249230bf3b7da /math/libm-test-support.h
parent8ac0f9e6f742dba698dc2ae0461f76a4b46a7971 (diff)
downloadglibc-2813e41e9049ccd0c75edc19c4fdefb21213b495.tar.gz
glibc-2813e41e9049ccd0c75edc19c4fdefb21213b495.tar.xz
glibc-2813e41e9049ccd0c75edc19c4fdefb21213b495.zip
Replace gen-libm-test.pl with gen-libm-test.py.
Following the recent discussion of using Python instead of Perl and
Awk for glibc build / test, this patch replaces gen-libm-test.pl with
a new gen-libm-test.py script.  This script should work with all
Python versions supported by glibc (tested by hand with Python 2.7,
tested in the build system with Python 3.5; configure prefers Python 3
if available).

This script is designed to give identical output to gen-libm-test.pl
for ease of verification of the change, except for generated comments
referring to .py instead of .pl.  (That is, identical for actual
inputs passed to the script, not necessarily for all possible input;
for example, this version more precisely follows the C standard syntax
for floating-point constants when deciding when to add LIT macro
calls.)  In one place a comment notes that the generation of
NON_FINITE flags is replicating a bug in the Perl script to assist in
such comparisons (with the expectation that this bug can then be
separately fixed in the Python script later).

Tested for x86_64, including comparison of generated files (and hand
testing of the case of generating a sorted libm-test-ulps file, which
isn't covered by normal "make check").

I'd expect to follow this up by extending the new script to produce
the ulps tables for the manual as well (replacing
manual/libm-err-tab.pl, so that then we just have one ulps file
parser) - at which point the manual build would depend on both Perl
and Python (eliminating the Perl dependency would require someone to
rewrite summary.pl in Python, and that would only eliminate the
*direct* Perl dependency; current makeinfo is written in Perl so there
would still be an indirect dependency).

I think install.texi is more or less equally out-of-date regarding
Perl and Python uses before and after this patch, so I don't think
this patch depends on my patch
<https://sourceware.org/ml/libc-alpha/2018-08/msg00133.html> to update
install.texi regarding such uses (pending review).

	* math/gen-libm-test.py: New file.
	* math/gen-libm-test.pl: Remove.
	* math/Makefile [$(PERL) != no]: Change condition to [PYTHON].
	($(objpfx)libm-test-ulps.h): Use gen-libm-test.py instead of
	gen-libm-test.pl.
	($(libm-test-c-noauto-obj)): Likewise.
	($(libm-test-c-auto-obj)): Likewise.
	($(libm-test-c-narrow-obj)): Likewise.
	(regen-ulps): Likewise.
	* math/README.libm-test: Update references to gen-libm-test.pl.
	* math/libm-test-driver.c (struct test_fj_f_data): Update comment
	referencing gen-libm-test.pl.
	* math/libm-test-nexttoward.inc (nexttoward_test_data): Likewise.
	* math/libm-test-support.c: Likewise.
	* math/libm-test-support.h: Likewise.
	* sysdeps/generic/libm-test-ulps: Likewise.
Diffstat (limited to 'math/libm-test-support.h')
-rw-r--r--math/libm-test-support.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/math/libm-test-support.h b/math/libm-test-support.h
index 42637741ab..194da4966d 100644
--- a/math/libm-test-support.h
+++ b/math/libm-test-support.h
@@ -67,7 +67,7 @@ extern const char doc[];
 #define ERRNO_UNCHANGED			0x8000
 #define ERRNO_EDOM			0x10000
 #define ERRNO_ERANGE			0x20000
-/* Flags generated by gen-libm-test.pl, not entered here manually.  */
+/* Flags generated by gen-libm-test.py, not entered here manually.  */
 #define IGNORE_RESULT			0x40000
 #define NON_FINITE			0x80000
 #define TEST_SNAN			0x100000
@@ -125,7 +125,7 @@ extern const char doc[];
 #endif
 
 /* Mark a test as expected to fail for ibm128-libgcc.  This is used
-   via XFAIL_ROUNDING_IBM128_LIBGCC, which gen-libm-test.pl transforms
+   via XFAIL_ROUNDING_IBM128_LIBGCC, which gen-libm-test.py transforms
    appropriately for each rounding mode.  */
 #define XFAIL_IBM128_LIBGCC (TEST_COND_ibm128_libgcc ? XFAIL_TEST : 0)