From: "H.J. Lu" <hjl.tools@gmail.com>
To: libc-alpha@sourceware.org
Subject: [PATCH] Add --disable-test-container to disable test container
Date: Sun, 4 Feb 2024 10:55:31 -0800 [thread overview]
Message-ID: <20240204185531.2816341-1-hjl.tools@gmail.com> (raw)
It can be difficult to run tests in container under simulator. Add
--disable-test-container configure option to disable test container.
Container tests are enabled by default.
---
Makefile | 2 ++
Rules | 5 +++++
configure | 7 +++++++
configure.ac | 6 ++++++
nss/Makefile | 2 ++
posix/Makefile | 6 +++++-
resolv/Makefile | 11 +++++++++--
7 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 7052b46df8..2ba4a5ecd3 100644
--- a/Makefile
+++ b/Makefile
@@ -610,6 +610,7 @@ else
LINKS_DSO_PROGRAM = links-dso-program
endif
+ifeq (yes,$(enable-test-container))
$(tests-container) $(addsuffix /tests,$(subdirs)) : \
$(objpfx)testroot.pristine/install.stamp
$(objpfx)testroot.pristine/install.stamp :
@@ -655,6 +656,7 @@ endif
INSTALL_UNCOMPRESSED=yes subdirs='$(sorted-subdirs)'
rm -f $(symbolic-link-list)
touch $(objpfx)testroot.pristine/install.stamp
+endif
tests-special-notdir = $(patsubst $(objpfx)%, %, $(tests-special))
tests: $(tests-special)
diff --git a/Rules b/Rules
index c7db0a4869..787024c729 100644
--- a/Rules
+++ b/Rules
@@ -142,6 +142,11 @@ endif
# Generate constant files for Python pretty printers if required.
others: $(py-const)
+ifeq (no,$(enable-test-container))
+# Don't run any container tests with --disable-test-container.
+tests-container :=
+endif
+
ifeq ($(run-built-tests),no)
tests: $(addprefix $(objpfx),$(filter-out $(tests-unsupported), \
$(tests) $(tests-internal) \
diff --git a/configure b/configure
index 59ff1e415d..2ca1fcf43f 100755
--- a/configure
+++ b/configure
@@ -7852,6 +7852,13 @@ fi
config_vars="$config_vars
enable-static-pie = $libc_cv_static_pie"
+# Enable test-container by default.
+if test "x$enable_test_container" = x; then
+ enable_test_container=yes
+fi
+config_vars="$config_vars
+enable-test-container = $enable_test_container"
+
# Set the `multidir' variable by grabbing the variable from the compiler.
# We do it once and save the result in a generated makefile.
libc_cv_multidir=`${CC-cc} $CFLAGS $CPPFLAGS -print-multi-directory`
diff --git a/configure.ac b/configure.ac
index 65799e5685..e1956b98cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1740,6 +1740,12 @@ if test "$libc_cv_static_pie" = "yes"; then
fi
LIBC_CONFIG_VAR([enable-static-pie], [$libc_cv_static_pie])
+# Enable test-container by default.
+if test "x$enable_test_container" = x; then
+ enable_test_container=yes
+fi
+LIBC_CONFIG_VAR([enable-test-container], [$enable_test_container])
+
# Set the `multidir' variable by grabbing the variable from the compiler.
# We do it once and save the result in a generated makefile.
libc_cv_multidir=`${CC-cc} $CFLAGS $CPPFLAGS -print-multi-directory`
diff --git a/nss/Makefile b/nss/Makefile
index 9331b3308c..ae083a9343 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -434,9 +434,11 @@ extra-test-objs += nss_test1.os nss_test2.os nss_test_errno.os \
ifeq ($(run-built-tests),yes)
ifneq (no,$(PERL))
+ifeq (yes,$(enable-test-container))
tests-special += $(objpfx)mtrace-tst-nss-gai-hv2-canonname.out
endif
endif
+endif
generated += mtrace-tst-nss-gai-hv2-canonname.out \
tst-nss-gai-hv2-canonname.mtrace
diff --git a/posix/Makefile b/posix/Makefile
index a1e84853a8..d3a70ab6b4 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -462,7 +462,6 @@ endif
tests-special += $(objpfx)annexc.out
ifeq ($(run-built-tests),yes)
tests-special += \
- $(objpfx)bug-ga2-mem.out \
$(objpfx)bug-glob2-mem.out \
$(objpfx)bug-regex14-mem.out \
$(objpfx)bug-regex2-mem.out \
@@ -475,9 +474,14 @@ tests-special += \
$(objpfx)tst-glob-tilde-mem.out \
$(objpfx)tst-pcre-mem.out \
$(objpfx)tst-rxspencer-no-utf8-mem.out \
+ # tests-special
+ifeq (yes,$(enable-test-container))
+tests-special += \
+ $(objpfx)bug-ga2-mem.out \
$(objpfx)tst-vfork3-mem.out \
# tests-special
endif
+endif
include ../Rules
diff --git a/resolv/Makefile b/resolv/Makefile
index 5f44f5896b..62c81fe998 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -221,8 +221,15 @@ $(inst_libdir)/libnss_dns.so:
ifeq ($(run-built-tests),yes)
ifneq (no,$(PERL))
-tests-special += $(objpfx)mtrace-tst-leaks.out $(objpfx)mtrace-tst-leaks2.out \
- $(objpfx)mtrace-tst-resolv-res_ninit.out
+tests-special += \
+ $(objpfx)mtrace-tst-leaks.out \
+ $(objpfx)mtrace-tst-resolv-res_ninit.out \
+# tests-special
+ifeq (yes,$(enable-test-container))
+tests-special += \
+ $(objpfx)mtrace-tst-leaks2.out \
+# tests-special
+endif
endif
endif
--
2.43.0
next reply other threads:[~2024-02-04 18:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-04 18:55 H.J. Lu [this message]
2024-02-05 13:55 ` Adhemerval Zanella Netto
2024-02-05 14:41 ` H.J. Lu
2024-02-05 14:54 ` Adhemerval Zanella Netto
2024-02-05 15:20 ` H.J. Lu
2024-02-05 14:46 ` Florian Weimer
2024-02-05 15:22 ` H.J. Lu
2024-02-05 15:34 ` Florian Weimer
2024-02-05 15:38 ` H.J. Lu
2024-02-05 15:44 ` Florian Weimer
2024-02-05 15:51 ` H.J. Lu
2024-02-05 15:48 ` Andreas Schwab
2024-02-05 15:50 ` H.J. Lu
2024-02-05 15:57 ` Andreas Schwab
2024-02-05 16:19 ` H.J. Lu
2024-02-05 15:51 ` Adhemerval Zanella Netto
2024-02-05 15:55 ` Florian Weimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240204185531.2816341-1-hjl.tools@gmail.com \
--to=hjl.tools@gmail.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).