]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Move libm-test TEST_MSG definitions to libm-test-driver.c.
authorJoseph Myers <joseph@codesourcery.com>
Mon, 6 Feb 2017 23:07:22 +0000 (23:07 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Mon, 6 Feb 2017 23:07:22 +0000 (23:07 +0000)
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.

17 files changed:
ChangeLog
math/libm-test-driver.c
math/test-double-finite.c
math/test-double-vlen2.h
math/test-double-vlen4.h
math/test-double-vlen8.h
math/test-double.c
math/test-float-finite.c
math/test-float-vlen16.h
math/test-float-vlen4.h
math/test-float-vlen8.h
math/test-float.c
math/test-idouble.c
math/test-ifloat.c
math/test-ildouble.c
math/test-ldouble-finite.c
math/test-ldouble.c

index 7fc0ad0b9f83cf767e36855c68e101dda0674498..944e587ae69ba66c72a177e761a3b40d5731090f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,27 @@
 2017-02-06  Joseph Myers  <joseph@codesourcery.com>
 
+       * 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.
+
        * math/libm-test.inc: Move all tests of individual functions to
        libm-test-*.inc and #include libm-test-*.c files.
        (acos_test_data): Remove.
index 1227d52d06ff07d49c07da9ccc560adef386dc3f..ea890bab2248743b09feac9495311977f67ee6b7 100644 (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
    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.  */
index 6de894ac047c5cf6458eb504bdd9e9d30678c3b4..c181925ffb21619545a34c627473e7bf6008e6e9 100644 (file)
@@ -20,6 +20,4 @@
 #include "test-math-no-inline.h"
 #include "test-math-scalar.h"
 
-#define TEST_MSG "testing double (finite-math-only)\n"
-
 #include "libm-test.c"
index c913878f3e162de0e6ed8472f7c8971dbcc29535..58d029ab2a0a5fbbbfce21381a830bee14393d7d 100644 (file)
@@ -20,8 +20,6 @@
 #include "test-math-no-inline.h"
 #include "test-math-vector.h"
 
-#define TEST_MSG "testing double vector math (without inline functions)\n"
-
 #define EXCEPTION_TESTS_double 0
 #define ROUNDING_TESTS_double(MODE) ((MODE) == FE_TONEAREST)
 
index 5346613aedef51ee51ee86b3908029d7abf532db..5ebcd133b1887ea9783ec0e04521387182778521 100644 (file)
@@ -20,8 +20,6 @@
 #include "test-math-no-inline.h"
 #include "test-math-vector.h"
 
-#define TEST_MSG "testing double vector math (without inline functions)\n"
-
 #define EXCEPTION_TESTS_double 0
 #define ROUNDING_TESTS_double(MODE) ((MODE) == FE_TONEAREST)
 
index e91c256190440f3e913bb7b06ce0a484f973019a..8d9049eb285e32717c0fdc2600b17bbf3d7c5e3e 100644 (file)
@@ -20,8 +20,6 @@
 #include "test-math-no-inline.h"
 #include "test-math-vector.h"
 
-#define TEST_MSG "testing double vector math (without inline functions)\n"
-
 #define EXCEPTION_TESTS_double 0
 #define ROUNDING_TESTS_double(MODE) ((MODE) == FE_TONEAREST)
 
index d81632ec9f25e8cf52b09b5ce8ebaa0744bb58e1..3672370bcbf2df069eb9bdee294c5a35fb66c7e7 100644 (file)
@@ -22,6 +22,4 @@
 #include "test-math-errno.h"
 #include "test-math-scalar.h"
 
-#define TEST_MSG "testing double (without inline functions)\n"
-
 #include "libm-test.c"
index 5a6092ce0425d45827d5e38963eb644a0b45a3a3..09ea1e948bb8f15343e757ec5fe36c8e45614848 100644 (file)
@@ -20,6 +20,4 @@
 #include "test-math-no-inline.h"
 #include "test-math-scalar.h"
 
-#define TEST_MSG "testing float (finite-math-only)\n"
-
 #include "libm-test.c"
index 76aa4437ac6e51d658b6b15418ccf483ca94d088..9388d77a82f15238414f8519c20644b1d0990909 100644 (file)
@@ -20,8 +20,6 @@
 #include "test-math-no-inline.h"
 #include "test-math-vector.h"
 
-#define TEST_MSG "testing float vector math (without inline functions)\n"
-
 #define EXCEPTION_TESTS_float 0
 #define ROUNDING_TESTS_float(MODE) ((MODE) == FE_TONEAREST)
 
index d3d69b79156098cae5fa1365a42cfd756b2fdab8..0a3a25463a98a83982ccc4379de07e9a1974ef3b 100644 (file)
@@ -20,8 +20,6 @@
 #include "test-math-no-inline.h"
 #include "test-math-vector.h"
 
-#define TEST_MSG "testing float vector math (without inline functions)\n"
-
 #define EXCEPTION_TESTS_float 0
 #define ROUNDING_TESTS_float(MODE) ((MODE) == FE_TONEAREST)
 
index 42e60920ddfa77087d3797c2acb35187dbe4e65b..f744dc5771e1ee6c84a0e4dd4a026d48c1c0e34d 100644 (file)
@@ -20,8 +20,6 @@
 #include "test-math-no-inline.h"
 #include "test-math-vector.h"
 
-#define TEST_MSG "testing float vector math (without inline functions)\n"
-
 #define EXCEPTION_TESTS_float 0
 #define ROUNDING_TESTS_float(MODE) ((MODE) == FE_TONEAREST)
 
index 1c0d40cf9d36c03bab93f1db7344544747a85e21..25ba35a9d1237c9d64af9aed9fa826373a576cf5 100644 (file)
@@ -22,6 +22,4 @@
 #include "test-math-errno.h"
 #include "test-math-scalar.h"
 
-#define TEST_MSG "testing float (without inline functions)\n"
-
 #include "libm-test.c"
index b1c59603c62a912400a5b8058b499edb6dafd670..944d981cc269f8ba4944cef271af86f282349c9a 100644 (file)
@@ -20,6 +20,4 @@
 #include "test-math-inline.h"
 #include "test-math-scalar.h"
 
-#define TEST_MSG "testing double (inline functions)\n"
-
 #include "libm-test.c"
index aee108601ff9c7ea6555d5e1638440d8934fdc06..20c028e1a3b9b46cc08677c6d486c51f62f3ad89 100644 (file)
@@ -20,6 +20,4 @@
 #include "test-math-inline.h"
 #include "test-math-scalar.h"
 
-#define TEST_MSG "testing float (inline functions)\n"
-
 #include "libm-test.c"
index fd5e2cbda0c71cc758e6813d0e87c2e0e9aa2e7d..ddba3e4722ca2236cfba219b74a8cf3fed52a826 100644 (file)
@@ -20,6 +20,4 @@
 #include "test-math-inline.h"
 #include "test-math-scalar.h"
 
-#define TEST_MSG "testing long double (inline functions)\n"
-
 #include "libm-test.c"
index d07d618130bbed55c1870a21c58baebc3e5f95ae..47cac2c71ef8adfc369bfd15d87ad9a2808ce132 100644 (file)
@@ -20,6 +20,4 @@
 #include "test-math-no-inline.h"
 #include "test-math-scalar.h"
 
-#define TEST_MSG "testing long double (finite-math-only)\n"
-
 #include "libm-test.c"
index 5a598f4ce544922ff89d5a97278af0a07abdeb91..209a81683f0a5a84b0be8b699093d5d994abadb0 100644 (file)
@@ -22,6 +22,4 @@
 #include "test-math-errno.h"
 #include "test-math-scalar.h"
 
-#define TEST_MSG "testing long double (without inline functions)\n"
-
 #include "libm-test.c"