1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

Move libm-test TEST_MSG definitions to libm-test-driver.c.

Various files using the libm-test infrastructure define a TEST_MSG
macro with an informal description of the tests being run.

This patch moves this macro to libm-test-driver.c (the definition
depending on other macros already defined), so files specific to
(type, choice of whether to test inline functions or finite-math-only
functions, vector length) no longer need to define it.  This is in
preparation for replacing files such as test-float.c with per-function
test-float-<func>.c etc. automatically generated in the build
directory when tests are run.

Tested for x86_64.

	* math/libm-test-driver.c (STRX): New macro.
	(STR): Likewise.
	(STR_FLOAT): Likewise.
	(STR_VEC_LEN): Likewise.
	(TEST_MSG): Likewise.  Define here instead of expecting to be
	defined by including file.
	* math/test-double-finite.c (TEST_MSG): Remove macro.
	* math/test-double-vlen2.h (TEST_MSG): Likewise.
	* math/test-double-vlen4.h (TEST_MSG): Likewise.
	* math/test-double-vlen8.h (TEST_MSG): Likewise.
	* math/test-double.c (TEST_MSG): Likewise.
	* math/test-float-finite.c (TEST_MSG): Likewise.
	* math/test-float-vlen16.h (TEST_MSG): Likewise.
	* math/test-float-vlen4.h (TEST_MSG): Likewise.
	* math/test-float-vlen8.h (TEST_MSG): Likewise.
	* math/test-float.c (TEST_MSG): Likewise.
	* math/test-idouble.c (TEST_MSG): Likewise.
	* math/test-ifloat.c (TEST_MSG): Likewise.
	* math/test-ildouble.c (TEST_MSG): Likewise.
	* math/test-ldouble-finite.c (TEST_MSG): Likewise.
	* math/test-ldouble.c (TEST_MSG): Likewise.
This commit is contained in:
Joseph Myers
2017-02-06 23:07:22 +00:00
parent 5cbb58493d
commit a622c2db55
17 changed files with 38 additions and 31 deletions

View File

@ -25,7 +25,6 @@
FUNC(function): converts general function name (like cos) to
name with correct suffix (e.g. cosl or cosf)
FLOAT: floating point type to test
- TEST_MSG: informal message to be displayed
chooses one of the parameters as delta for testing
equality
PREFIX A macro which defines the prefix for common macros for the
@ -108,6 +107,22 @@
arrays. */
#include "libm-test-ulps.h"
#define STRX(x) #x
#define STR(x) STRX (x)
#define STR_FLOAT STR (FLOAT)
#define STR_VEC_LEN STR (VEC_LEN)
/* Informal description of the functions being tested. */
#if TEST_MATHVEC
# define TEST_MSG "testing " STR_FLOAT " (vector length " STR_VEC_LEN ")\n"
#elif TEST_INLINE
# define TEST_MSG "testing " STR_FLOAT " (inline functions)\n"
#elif TEST_FINITE
# define TEST_MSG "testing " STR_FLOAT " (finite-math-only)\n"
#else
# define TEST_MSG "testing " STR_FLOAT " (without inline functions)\n"
#endif
/* Allow platforms without all rounding modes to test properly,
assuming they provide an __FE_UNDEFINED in <bits/fenv.h> which
causes fesetround() to return failure. */