* tests/test-c-strtod-mt.c:
* tests/test-c-strtof-mt.c:
* tests/test-c-strtold-mt.c:
(main): The tests make no sense when single-threaded, so skip them
by exiting with status 77.
* tests/test-c-strtod-mt.sh:
* tests/test-c-strtof-mt.sh:
* tests/test-c-strtold-mt.sh:
Exit with the failing test’s status, so that if it exits with
status 77 then we do too.
---
 ChangeLog                  | 12 ++++++++++++
 tests/test-c-strtod-mt.c   | 10 ++++++++++
 tests/test-c-strtod-mt.sh  |  4 ++--
 tests/test-c-strtof-mt.c   | 10 ++++++++++
 tests/test-c-strtof-mt.sh  |  4 ++--
 tests/test-c-strtold-mt.c  | 10 ++++++++++
 tests/test-c-strtold-mt.sh |  4 ++--
 7 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5ef5207cc6..454b9983ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2026-04-25  Paul Eggert  <[email protected]>
 
+       c-strtod-tests: port to single-threaded builds
+       * tests/test-c-strtod-mt.c:
+       * tests/test-c-strtof-mt.c:
+       * tests/test-c-strtold-mt.c:
+       (main): The tests make no sense when single-threaded, so skip them
+       by exiting with status 77.
+       * tests/test-c-strtod-mt.sh:
+       * tests/test-c-strtof-mt.sh:
+       * tests/test-c-strtold-mt.sh:
+       Exit with the failing test’s status, so that if it exits with
+       status 77 then we do too.
+
        cond: always include glthread/lock.h
        * lib/glthread/cond.h: Revert my 2026-03-31 namespace cleanup
        patch, which was incorrect because this header’s
diff --git a/tests/test-c-strtod-mt.c b/tests/test-c-strtod-mt.c
index f898a839e4..9e423f3758 100644
--- a/tests/test-c-strtod-mt.c
+++ b/tests/test-c-strtod-mt.c
@@ -104,6 +104,9 @@ main (int argc, char *argv[])
   if (setlocale (LC_ALL, "") == NULL)
     return 1;
 
+#if (USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS \
+     || USE_WINDOWS_THREADS)
+
   /* Create the threads.  */
   gl_thread_create (thread1_func, NULL);
   gl_thread_create (thread2_func, NULL);
@@ -119,6 +122,13 @@ main (int argc, char *argv[])
   }
 
   return 0;
+
+#else
+
+  fputs ("Skipping test: multithreading not enabled\n", stderr);
+  return 77;
+
+#endif
 }
 
 #else
diff --git a/tests/test-c-strtod-mt.sh b/tests/test-c-strtod-mt.sh
index 8c0e6e9006..3e44ce6726 100755
--- a/tests/test-c-strtod-mt.sh
+++ b/tests/test-c-strtod-mt.sh
@@ -20,11 +20,11 @@ else
 fi
 
 if test $LOCALE_FR != none; then
-  LC_ALL=$LOCALE_FR      ${CHECKER} ./test-c-strtod-mt${EXEEXT} || exit 1
+  LC_ALL=$LOCALE_FR      ${CHECKER} ./test-c-strtod-mt${EXEEXT} || exit
 fi
 
 if test $LOCALE_FR_UTF8 != none; then
-  LC_ALL=$LOCALE_FR_UTF8 ${CHECKER} ./test-c-strtod-mt${EXEEXT} || exit 1
+  LC_ALL=$LOCALE_FR_UTF8 ${CHECKER} ./test-c-strtod-mt${EXEEXT} || exit
 fi
 
 exit 0
diff --git a/tests/test-c-strtof-mt.c b/tests/test-c-strtof-mt.c
index f0145a43bb..f80366790b 100644
--- a/tests/test-c-strtof-mt.c
+++ b/tests/test-c-strtof-mt.c
@@ -104,6 +104,9 @@ main (int argc, char *argv[])
   if (setlocale (LC_ALL, "") == NULL)
     return 1;
 
+#if (USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS \
+     || USE_WINDOWS_THREADS)
+
   /* Create the threads.  */
   gl_thread_create (thread1_func, NULL);
   gl_thread_create (thread2_func, NULL);
@@ -119,6 +122,13 @@ main (int argc, char *argv[])
   }
 
   return 0;
+
+#else
+
+  fputs ("Skipping test: multithreading not enabled\n", stderr);
+  return 77;
+
+#endif
 }
 
 #else
diff --git a/tests/test-c-strtof-mt.sh b/tests/test-c-strtof-mt.sh
index 27a647fcf2..f580e88c0f 100755
--- a/tests/test-c-strtof-mt.sh
+++ b/tests/test-c-strtof-mt.sh
@@ -20,11 +20,11 @@ else
 fi
 
 if test $LOCALE_FR != none; then
-  LC_ALL=$LOCALE_FR      ${CHECKER} ./test-c-strtof-mt${EXEEXT} || exit 1
+  LC_ALL=$LOCALE_FR      ${CHECKER} ./test-c-strtof-mt${EXEEXT} || exit
 fi
 
 if test $LOCALE_FR_UTF8 != none; then
-  LC_ALL=$LOCALE_FR_UTF8 ${CHECKER} ./test-c-strtof-mt${EXEEXT} || exit 1
+  LC_ALL=$LOCALE_FR_UTF8 ${CHECKER} ./test-c-strtof-mt${EXEEXT} || exit
 fi
 
 exit 0
diff --git a/tests/test-c-strtold-mt.c b/tests/test-c-strtold-mt.c
index 110ea35af3..8b5fde38d9 100644
--- a/tests/test-c-strtold-mt.c
+++ b/tests/test-c-strtold-mt.c
@@ -104,6 +104,9 @@ main (int argc, char *argv[])
   if (setlocale (LC_ALL, "") == NULL)
     return 1;
 
+#if (USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS \
+     || USE_WINDOWS_THREADS)
+
   /* Create the threads.  */
   gl_thread_create (thread1_func, NULL);
   gl_thread_create (thread2_func, NULL);
@@ -119,6 +122,13 @@ main (int argc, char *argv[])
   }
 
   return 0;
+
+#else
+
+  fputs ("Skipping test: multithreading not enabled\n", stderr);
+  return 77;
+
+#endif
 }
 
 #else
diff --git a/tests/test-c-strtold-mt.sh b/tests/test-c-strtold-mt.sh
index 7983587693..7394b2dfa7 100755
--- a/tests/test-c-strtold-mt.sh
+++ b/tests/test-c-strtold-mt.sh
@@ -20,11 +20,11 @@ else
 fi
 
 if test $LOCALE_FR != none; then
-  LC_ALL=$LOCALE_FR      ${CHECKER} ./test-c-strtold-mt${EXEEXT} || exit 1
+  LC_ALL=$LOCALE_FR      ${CHECKER} ./test-c-strtold-mt${EXEEXT} || exit
 fi
 
 if test $LOCALE_FR_UTF8 != none; then
-  LC_ALL=$LOCALE_FR_UTF8 ${CHECKER} ./test-c-strtold-mt${EXEEXT} || exit 1
+  LC_ALL=$LOCALE_FR_UTF8 ${CHECKER} ./test-c-strtold-mt${EXEEXT} || exit
 fi
 
 exit 0
-- 
2.53.0


Reply via email to