bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] stdbit-tests: make GNULIB_TEST_STDBIT work standalone


From: Paul Eggert
Subject: [PATCH 1/2] stdbit-tests: make GNULIB_TEST_STDBIT work standalone
Date: Mon, 13 May 2024 01:27:32 -0700

* modules/stdbit-tests (GNULIB_TEST_STDBIT):
Do not define in config.h, since config.h is conditionally
included depending on this macro.
Instead, specify -DGNULIB_TEST_STDBIT in the CPPFLAGS
of each test.
---
 ChangeLog            |  9 +++++++++
 modules/stdbit-tests | 18 ++++++++++++++++--
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b6aa21d7f7..e14eedd9c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-05-12  Paul Eggert  <eggert@cs.ucla.edu>
+
+       stdbit-tests: make GNULIB_TEST_STDBIT work standalone
+       * modules/stdbit-tests (GNULIB_TEST_STDBIT):
+       Do not define in config.h, since config.h is conditionally
+       included depending on this macro.
+       Instead, specify -DGNULIB_TEST_STDBIT in the CPPFLAGS
+       of each test.
+
 2024-05-12  Simon Josefsson  <simon@josefsson.org>
 
        maintainer-makefile: Silence announce-gen error with GNULIB_REVISION.
diff --git a/modules/stdbit-tests b/modules/stdbit-tests
index a5832c84f2..3361ff62e0 100644
--- a/modules/stdbit-tests
+++ b/modules/stdbit-tests
@@ -23,8 +23,6 @@ libc-config
 stdint
 
 configure.ac:
-AC_DEFINE([GNULIB_TEST_STDBIT], [1],
-  [Define to 1 so that stdbit tests use the Gnulib framework, not glibc's.])
 
 Makefile.am:
 TESTS += \
@@ -42,3 +40,19 @@ check_PROGRAMS += \
    tst-stdc_first_trailing_zero tst-stdc_has_single_bit \
    tst-stdc_leading_ones tst-stdc_leading_zeros tst-stdc_trailing_ones \
    tst-stdc_trailing_zeros
+
+TEST_STDBIT_CPPFLAGS = $(AM_CPPFLAGS) -DGNULIB_TEST_STDBIT
+tst_stdc_bit_ceil_CPPFLAGS            = $(TEST_STDBIT_CPPFLAGS)
+tst_stdc_bit_floor_CPPFLAGS           = $(TEST_STDBIT_CPPFLAGS)
+tst_stdc_bit_width_CPPFLAGS           = $(TEST_STDBIT_CPPFLAGS)
+tst_stdc_count_ones_CPPFLAGS          = $(TEST_STDBIT_CPPFLAGS)
+tst_stdc_count_zeros_CPPFLAGS         = $(TEST_STDBIT_CPPFLAGS)
+tst_stdc_first_leading_one_CPPFLAGS   = $(TEST_STDBIT_CPPFLAGS)
+tst_stdc_first_leading_zero_CPPFLAGS  = $(TEST_STDBIT_CPPFLAGS)
+tst_stdc_first_trailing_one_CPPFLAGS  = $(TEST_STDBIT_CPPFLAGS)
+tst_stdc_first_trailing_zero_CPPFLAGS = $(TEST_STDBIT_CPPFLAGS)
+tst_stdc_has_single_bit_CPPFLAGS      = $(TEST_STDBIT_CPPFLAGS)
+tst_stdc_leading_ones_CPPFLAGS        = $(TEST_STDBIT_CPPFLAGS)
+tst_stdc_leading_zeros_CPPFLAGS       = $(TEST_STDBIT_CPPFLAGS)
+tst_stdc_trailing_ones_CPPFLAGS       = $(TEST_STDBIT_CPPFLAGS)
+tst_stdc_trailing_zeros_CPPFLAGS      = $(TEST_STDBIT_CPPFLAGS)
-- 
2.40.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]