malloc/Makefile: Split and sort tests

Put each test on a separate line and sort tests.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
H.J. Lu 2024-05-09 20:27:39 -07:00
parent 2dcaf70643
commit d49cd6a191

View File

@ -24,60 +24,92 @@ include ../Makeconfig
dist-headers := malloc.h dist-headers := malloc.h
headers := $(dist-headers) obstack.h mcheck.h headers := $(dist-headers) obstack.h mcheck.h
tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \ tests := \
tst-malloc-check tst-mallocfork tst-trim1 \ mallocbug \
tst-malloc-usable tst-realloc tst-reallocarray tst-posix_memalign \ tst-aligned-alloc \
tst-pvalloc tst-pvalloc-fortify tst-memalign tst-mallopt \ tst-alloc_buffer \
tst-malloc-backtrace tst-malloc-thread-exit \ tst-calloc \
tst-malloc-thread-fail tst-malloc-fork-deadlock \ tst-free-errno \
tst-mallocfork2 \ tst-interpose-nothread \
tst-mallocfork3 \ tst-interpose-thread \
tst-interpose-nothread \ tst-malloc \
tst-interpose-thread \ tst-malloc-backtrace \
tst-alloc_buffer \ tst-malloc-check \
tst-free-errno \ tst-malloc-fork-deadlock \
tst-malloc-tcache-leak \ tst-malloc-stats-cancellation \
tst-malloc_info tst-mallinfo2 \ tst-malloc-tcache-leak \
tst-malloc-too-large \ tst-malloc-thread-exit \
tst-malloc-stats-cancellation \ tst-malloc-thread-fail \
tst-tcfree1 tst-tcfree2 tst-tcfree3 \ tst-malloc-too-large \
tst-safe-linking \ tst-malloc-usable \
tst-mallocalign1 \ tst-malloc_info tst-mallinfo2 \
tst-memalign-2 \ tst-mallocalign1 \
tst-memalign-3 \ tst-mallocfork \
tst-aligned-alloc tst-mallocfork2 \
tst-mallocfork3 \
tst-mallopt \
tst-memalign \
tst-memalign-2 \
tst-memalign-3 \
tst-obstack \
tst-posix_memalign \
tst-pvalloc \
tst-pvalloc-fortify \
tst-realloc \
tst-reallocarray \
tst-safe-linking \
tst-tcfree1 tst-tcfree2 tst-tcfree3 \
tst-trim1 \
tst-valloc \
# tests
tests-static := \ tests-static := \
tst-interpose-static-nothread \ tst-aligned-alloc-static \
tst-interpose-static-thread \ tst-interpose-static-nothread \
tst-aligned-alloc-static tst-interpose-static-thread \
# tests-static
# Test for the malloc_set_state symbol removed in glibc 2.25. # Test for the malloc_set_state symbol removed in glibc 2.25.
ifeq ($(have-GLIBC_2.23)$(build-shared),yesyes) ifeq ($(have-GLIBC_2.23)$(build-shared),yesyes)
tests += tst-mallocstate tst-compathooks-off tst-compathooks-on tests += \
tst-compathooks-off \
tst-compathooks-on \
tst-mallocstate \
# tests
endif endif
tests-internal := tst-scratch_buffer tests-internal := tst-scratch_buffer
# The dynarray framework is only available inside glibc. # The dynarray framework is only available inside glibc.
tests-internal += \ tests-internal += \
tst-dynarray \ tst-dynarray \
tst-dynarray-fail \ tst-dynarray-at-fail \
tst-dynarray-at-fail \ tst-dynarray-fail \
# tests-internal
tests += tst-malloc-usable-tunables tst-mxfast tests += \
tst-malloc-usable-tunables \
tst-mxfast \
# tests
tests += $(tests-static) tests += $(tests-static)
test-srcs = tst-mtrace test-srcs = tst-mtrace
# These tests either are run with MALLOC_CHECK_=3 by default or do not work # These tests either are run with MALLOC_CHECK_=3 by default or do not work
# with MALLOC_CHECK_=3 because they expect a specific failure. # with MALLOC_CHECK_=3 because they expect a specific failure.
tests-exclude-malloc-check = tst-malloc-check tst-malloc-usable \ tests-exclude-malloc-check = \
tst-mxfast tst-safe-linking \ tst-compathooks-off \
tst-compathooks-off tst-compathooks-on tst-memalign-2 tst-memalign-3 \ tst-compathooks-on \
tst-mallocfork2 \ tst-malloc-check \
tst-mallocfork3 \ tst-malloc-tcache-leak \
tst-malloc-tcache-leak tst-malloc-usable \
tst-mallocfork2 \
tst-mallocfork3 \
tst-memalign-2 \
tst-memalign-3 \
tst-mxfast \
tst-safe-linking \
# tests-exclude-malloc-check
# Run all tests with MALLOC_CHECK_=3 # Run all tests with MALLOC_CHECK_=3
tests-malloc-check = $(filter-out $(tests-exclude-malloc-check) \ tests-malloc-check = $(filter-out $(tests-exclude-malloc-check) \
@ -87,18 +119,19 @@ tests-malloc-check = $(filter-out $(tests-exclude-malloc-check) \
# the Transparent Huge Pages support (1) or automatic huge page support (2). # the Transparent Huge Pages support (1) or automatic huge page support (2).
# We need exclude some tests that define the ENV vars. # We need exclude some tests that define the ENV vars.
tests-exclude-hugetlb1 = \ tests-exclude-hugetlb1 = \
tst-compathooks-off \ tst-compathooks-off \
tst-compathooks-on \ tst-compathooks-on \
tst-interpose-nothread \ tst-interpose-nothread \
tst-interpose-thread \ tst-interpose-static-nothread \
tst-interpose-static-nothread \ tst-interpose-static-thread \
tst-interpose-static-thread \ tst-interpose-thread \
tst-malloc-usable \ tst-malloc-tcache-leak \
tst-malloc-usable-tunables \ tst-malloc-usable \
tst-mallocstate \ tst-malloc-usable-tunables \
tst-malloc-tcache-leak \ tst-mallocfork2 \
tst-mallocfork2 \ tst-mallocfork3 \
tst-mallocfork3 tst-mallocstate \
# tests-exclude-hugetlb1
# The tst-free-errno relies on the used malloc page size to mmap an # The tst-free-errno relies on the used malloc page size to mmap an
# overlapping region. # overlapping region.
tests-exclude-hugetlb2 = \ tests-exclude-hugetlb2 = \
@ -114,22 +147,25 @@ ifeq ($(have-GLIBC_2.23)$(build-shared),yesyes)
# Tests that don't play well with mcheck. They are either bugs in mcheck or # Tests that don't play well with mcheck. They are either bugs in mcheck or
# the tests expect specific internal behavior that is changed due to linking to # the tests expect specific internal behavior that is changed due to linking to
# libmcheck.a. # libmcheck.a.
tests-exclude-mcheck = tst-mallocstate \ tests-exclude-mcheck = \
tst-safe-linking \ tst-compathooks-off \
tst-malloc-backtrace \ tst-compathooks-on \
tst-malloc-fork-deadlock \ tst-malloc-backtrace \
tst-malloc-stats-cancellation \ tst-malloc-fork-deadlock \
tst-malloc-tcache-leak \ tst-malloc-stats-cancellation \
tst-malloc-thread-exit \ tst-malloc-tcache-leak \
tst-malloc-thread-fail \ tst-malloc-thread-exit \
tst-malloc-usable-tunables \ tst-malloc-thread-fail \
tst-malloc_info \ tst-malloc-usable-tunables \
tst-compathooks-off tst-compathooks-on \ tst-malloc_info \
tst-memalign-2 \ tst-mallocfork2 \
tst-memalign-3 \ tst-mallocfork3 \
tst-mxfast \ tst-mallocstate \
tst-mallocfork2 \ tst-memalign-2 \
tst-mallocfork3 tst-memalign-3 \
tst-mxfast \
tst-safe-linking \
# tests-exclude-mcheck
tests-mcheck = $(filter-out $(tests-exclude-mcheck) $(tests-static), $(tests)) tests-mcheck = $(filter-out $(tests-exclude-mcheck) $(tests-static), $(tests))
endif endif
@ -159,10 +195,12 @@ extra-libs-others = $(extra-libs)
extra-test-objs += \ extra-test-objs += \
tst-interpose-aux-nothread.o \ tst-interpose-aux-nothread.o \
tst-interpose-aux-thread.o \ tst-interpose-aux-thread.o \
# extra-test-objs
test-extras = \ test-extras = \
tst-interpose-aux-nothread \ tst-interpose-aux-nothread \
tst-interpose-aux-thread \ tst-interpose-aux-thread \
# test-extras
libmemusage-routines = memusage libmemusage-routines = memusage
libmemusage-inhibit-o = $(filter-out .os,$(object-suffixes)) libmemusage-inhibit-o = $(filter-out .os,$(object-suffixes))