glibc/stdlib/Makefile
Joseph Myers f0881698bf Generate .test-result files for tests with special rules.
This patch, an updated version of
<https://sourceware.org/ml/libc-alpha/2014-01/msg00194.html> now
proposed for inclusion in glibc, extends the generation of PASS and
FAIL status in .test-result files for individual tests to cover tests
with their own custom makefile rules.  This is just adding
$(evaluate-test) calls to all such rules, since tests with multiple
commands were previously split into separate tests.

Note that the tests the makefiles expect to fail (posix/annexc and
conformtest) currently get FAIL listed in the .test-result file,
rather than XFAIL; a subsequent patch will introduce a better XFAIL
mechanism.

Tested x86_64.

	* Makefile ($(objpfx)c++-types-check.out): Use $(evaluate-test).
	($(objpfx)check-local-headers.out): Likewise.
	($(objpfx)begin-end-check.out): Likewise.
	* Makerules (check-abi-%.out): Likewise.
	* catgets/Makefile ($(objpfx)test1.cat): Likewise.
	($(objpfx)test2.cat): Likewise.
	($(objpfx)de/libc.cat): Likewise.
	($(objpfx)test-gencat.out): Likewise.
	* conform/Makefile ($(objpfx)run-conformtest.out): Likewise.
	* elf/Makefile ($(objpfx)order-cmp.out): Likewise.
	($(objpfx)noload-mem): Likewise.
	($(objpfx)tst-pathopt.out): Likewise.
	($(objpfx)tst-rtld-load-self.out): Likewise.
	($(objpfx)tst-array1-cmp.out): Likewise.
	($(objpfx)tst-array1-static-cmp.out): Likewise.
	($(objpfx)tst-array2-cmp.out): Likewise.
	($(objpfx)tst-array3-cmp.out): Likewise.
	($(objpfx)tst-array4-cmp.out): Likewise.
	($(objpfx)tst-array5-cmp.out): Likewise.
	($(objpfx)tst-array5-static-cmp.out): Likewise.
	($(objpfx)check-textrel.out): Likewise.
	($(objpfx)check-execstack.out): Likewise.
	($(objpfx)check-localplt.out): Likewise.
	($(objpfx)order2-cmp.out): Likewise.
	($(objpfx)tst-leaks1-mem): Likewise.
	($(objpfx)tst-leaks1-static-mem): Likewise.
	($(objpfx)tst-initorder-cmp.out): Likewise.
	($(objpfx)tst-initorder2-cmp.out): Likewise.
	($(objpfx)tst-unused-dep.out): Likewise.
	($(objpfx)tst-unused-dep-cmp.out): Likewise.
	* grp/Makefile ($(objpfx)tst_fgetgrent.out): Likewise.
	* iconv/Makefile (test-iconvconfig): Likewise.
	* iconvdata/Makefile ($(objpfx)mtrace-tst-loading): Likewise.
	($(objpfx)iconv-test.out): Likewise.
	($(objpfx)tst-tables.out): Likewise.
	* intl/Makefile ($(objpfx)mtrace-tst-gettext): Likewise.
	($(objpfx)tst-gettext.out): Likewise.
	($(objpfx)tst-translit.out): Likewise.
	($(objpfx)tst-gettext2.out): Likewise.
	($(objpfx)tst-gettext4.out): Likewise.
	($(objpfx)tst-gettext6.out): Likewise.
	* io/Makefile ($(objpfx)ftwtest.out): Likewise.
	* libio/Makefile ($(objpfx)test-freopen.out): Likewise.
	($(objpfx)tst-fopenloc-cmp.out): Likewise.
	($(objpfx)tst-fopenloc-mem.out): Likewise.
	* malloc/Makefile ($(objpfx)tst-mtrace.out): Likewise.
	* misc/Makefile ($(objpfx)tst-error1-mem): Likewise.
	* posix/Makefile ($(objpfx)globtest.out): Likewise.
	($(objpfx)wordexp-tst.out): Likewise.
	($(objpfx)annexc.out): Likewise.
	($(objpfx)tst-fnmatch-mem): Likewise.
	($(objpfx)bug-regex2-mem): Likewise.
	($(objpfx)bug-regex14-mem): Likewise.
	($(objpfx)bug-regex21-mem): Likewise.
	($(objpfx)bug-regex31-mem): Likewise.
	($(objpfx)tst-vfork3-mem): Likewise.
	($(objpfx)tst-rxspencer-no-utf8-mem): Likewise.
	($(objpfx)tst-pcre-mem): Likewise.
	($(objpfx)tst-boost-mem): Likewise.
	($(objpfx)tst-getconf.out): Likewise.
	($(objpfx)bug-ga2-mem): Likewise.
	($(objpfx)bug-glob2-mem): Likewise.
	* resolv/Makefile ($(objpfx)mtrace-tst-leaks): Likewise.
	($(objpfx)mtrace-tst-leaks2): Likewise.
	* stdio-common/Makefile ($(objpfx)tst-unbputc.out): Likewise.
	($(objpfx)tst-printf.out): Likewise.
	($(objpfx)tst-setvbuf1.out): Likewise.
	($(objpfx)tst-setvbuf1-cmp.out): Likewise.
	* stdlib/Makefile ($(objpfx)isomac.out): Likewise.
	($(objpfx)tst-fmtmsg.out): Likewise.
	* string/Makefile ($(objpfx)tst-svc-cmp.out): Likewise.
	* sysdeps/x86/Makefile ($(objpfx)tst-xmmymm.out): Likewise.

localedata:
	* Makefile ($(objpfx)sort-test.out): Use $(evaluate-test).
	($(objpfx)tst-fmon.out): Likewise.
	($(objpfx)tst-numeric.out): Likewise.
	($(objpfx)tst-locale.out): Likewise.
	($(objpfx)tst-rpmatch.out): Likewise.
	($(objpfx)tst-trans.out): Likewise.
	($(objpfx)tst-mbswcs.out): Likewise.
	($(objpfx)tst-ctype.out): Likewise.
	($(objpfx)tst-wctype.out): Likewise.
	($(objpfx)tst-langinfo.out): Likewise.
	($(objpfx)mtrace-tst-leaks): Likewise.

nptl:
	* Makefile ($(objpfx)tst-stack3-mem): Use $(evaluate-test).
	($(objpfx)tst-tls6.out): Likewise.
	($(objpfx)tst-cleanup0.out): Likewise.
	($(objpfx)tst-cleanup0-cmp.out): Likewise.
	($(objpfx)tst-cancel-wrappers.out): Likewise.
	($(objpfx)tst-oddstacklimit.out): Likewise.

nptl_db:
	* Makefile ($(objpfx)db-symbols.out): Use
	$(evaluate-test).
2014-02-21 21:48:08 +00:00

169 lines
5.8 KiB
Makefile

# Copyright (C) 1991-2014 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# The GNU C Library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with the GNU C Library; if not, see
# <http://www.gnu.org/licenses/>.
#
# Makefile for stdlib routines
#
subdir := stdlib
headers := stdlib.h bits/stdlib.h bits/stdlib-ldbl.h bits/stdlib-float.h \
monetary.h bits/monetary-ldbl.h \
inttypes.h stdint.h bits/wordsize.h \
errno.h sys/errno.h bits/errno.h \
ucontext.h sys/ucontext.h \
alloca.h fmtmsg.h \
bits/stdlib-bsearch.h
routines := \
atof atoi atol atoll \
abort \
bsearch qsort msort \
getenv putenv setenv secure-getenv \
exit on_exit atexit cxa_atexit cxa_finalize old_atexit \
quick_exit at_quick_exit cxa_at_quick_exit cxa_thread_atexit_impl \
abs labs llabs \
div ldiv lldiv \
mblen mbstowcs mbtowc wcstombs wctomb \
random random_r rand rand_r \
drand48 erand48 lrand48 nrand48 mrand48 jrand48 \
srand48 seed48 lcong48 \
drand48_r erand48_r lrand48_r nrand48_r mrand48_r jrand48_r \
srand48_r seed48_r lcong48_r \
drand48-iter \
strtol strtoul strtoll strtoull \
strtol_l strtoul_l strtoll_l strtoull_l \
strtof strtod strtold \
strtof_l strtod_l strtold_l \
system canonicalize \
a64l l64a \
rpmatch strfmon strfmon_l getsubopt xpg_basename fmtmsg \
strtoimax strtoumax wcstoimax wcstoumax \
getcontext setcontext makecontext swapcontext
aux = grouping groupingwc tens_in_limb
# These routines will be omitted from the libc shared object.
# Instead the static object files will be included in a special archive
# linked against when the shared library will be used.
static-only-routines = atexit at_quick_exit
test-srcs := tst-fmtmsg
tests := tst-strtol tst-strtod testmb testrand testsort testdiv \
test-canon test-canon2 tst-strtoll tst-environ \
tst-xpg-basename tst-random tst-random2 tst-bsearch \
tst-limits tst-rand48 bug-strtod tst-setcontext \
test-a64l tst-qsort tst-system testmb2 bug-strtod2 \
tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 tst-rand48-2 \
tst-makecontext tst-strtod4 tst-strtod5 tst-qsort2 \
tst-makecontext2 tst-strtod6 tst-unsetenv1 \
tst-makecontext3 bug-getcontext bug-fmtmsg1 \
tst-secure-getenv tst-strtod-overflow tst-strtod-round \
tst-tininess tst-strtod-underflow tst-tls-atexit
tests-static := tst-secure-getenv
modules-names = tst-tls-atexit-lib
include ../Makeconfig
ifeq ($(build-shared),yes)
tests += tst-putenv
endif
# Several mpn functions from GNU MP are used by the strtod function.
mpn-routines := inlines add_n addmul_1 cmp divmod_1 divrem udiv_qrnnd \
lshift rshift mod_1 mul mul_1 mul_n sub_n submul_1
mpn-headers = longlong.h gmp.h gmp-impl.h gmp-mparam.h asm-syntax.h
routines := $(strip $(routines) $(mpn-routines)) \
dbl2mpn ldbl2mpn \
mpn2flt mpn2dbl mpn2ldbl
aux += fpioconst mp_clz_tab
tests-extras += tst-putenvmod
extra-test-objs += tst-putenvmod.os
generated += isomac isomac.out tst-putenvmod.so
CFLAGS-bsearch.c = $(uses-callbacks)
CFLAGS-msort.c = $(uses-callbacks)
CFLAGS-qsort.c = $(uses-callbacks)
CFLAGS-system.c = -fexceptions
CFLAGS-system.os = -fomit-frame-pointer
CFLAGS-fmtmsg.c = -fexceptions
CFLAGS-strfmon.c = $(libio-mtsafe)
CFLAGS-strfmon_l.c = $(libio-mtsafe)
CFLAGS-tst-bsearch.c = $(stack-align-test-flags)
CFLAGS-tst-qsort.c = $(stack-align-test-flags)
CFLAGS-tst-makecontext2.c = $(stack-align-test-flags)
include ../Rules
# Testdir has to be named stdlib and needs to be writable
test-canon-ARGS = --test-dir=${common-objpfx}stdlib
tst-strtod-ENV = LOCPATH=$(common-objpfx)localedata
tst-strtod3-ENV = LOCPATH=$(common-objpfx)localedata
tst-strtod4-ENV = LOCPATH=$(common-objpfx)localedata
tst-strtod5-ENV = LOCPATH=$(common-objpfx)localedata
testmb2-ENV = LOCPATH=$(common-objpfx)localedata
bug-fmtmsg1-ENV = SEV_LEVEL=foo,11,newsev
# Run a test on the header files we use.
tests: $(objpfx)isomac.out
ifeq ($(run-built-tests),yes)
tests: $(objpfx)tst-fmtmsg.out
endif
$(objpfx)isomac.out: $(objpfx)isomac
$(dir $<)$(notdir $<) '$(CC)' \
'-I../include $(+sysdep-includes) $(sysincludes) -I..' > $<.out; \
$(evaluate-test)
isomac-CFLAGS = -O
$(objpfx)isomac: isomac.c
$(native-compile)
$(objpfx)tst-fmtmsg.out: tst-fmtmsg.sh $(objpfx)tst-fmtmsg
$(SHELL) $< $(common-objpfx) '$(test-program-prefix)' $(common-objpfx)stdlib/; \
$(evaluate-test)
$(objpfx)tst-putenv: $(objpfx)tst-putenvmod.so
LDFLAGS-tst-putenv = $(no-as-needed)
$(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os $(link-libc-deps)
$(build-module)
CFLAGS-tst-putenvmod.c = -DNOT_IN_libc=1
ifeq ($(build-shared),yes)
link-libm = $(common-objpfx)math/libm.so
else
link-libm = $(common-objpfx)math/libm.a
endif
$(objpfx)bug-getcontext: $(link-libm)
$(objpfx)tst-strtod-round: $(link-libm)
$(objpfx)tst-tininess: $(link-libm)
$(objpfx)tst-strtod-underflow: $(link-libm)
$(objpfx)tst-strtod6: $(link-libm)
tst-tls-atexit-lib.so-no-z-defs = yes
$(objpfx)tst-tls-atexit: $(common-objpfx)nptl/libpthread.so \
$(common-objpfx)dlfcn/libdl.so
$(objpfx)tst-tls-atexit.out: $(objpfx)tst-tls-atexit-lib.so