| 1 | # $Id: Makefile 2092 2005-06-27 04:03:05Z bird $
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 | # default rule
|
|---|
| 5 | all: tests-logged
|
|---|
| 6 |
|
|---|
| 7 | #
|
|---|
| 8 | # Basic setup.
|
|---|
| 9 | #
|
|---|
| 10 | OUTDIR = ./out
|
|---|
| 11 | TS = $(shell date '+"%Y-%m-%d-%H-%M-%S"')
|
|---|
| 12 | LOG = $(OUTDIR)/$(1)-$(TS).log
|
|---|
| 13 | CC = gcc
|
|---|
| 14 | LDFLAGS=
|
|---|
| 15 | CFLAGS = -O -D_GNU_SOURCE -std=gnu99 -DOBJPFX=\"$(OUTDIR)/\"
|
|---|
| 16 | ifeq ($(shell uname -m),amd64)
|
|---|
| 17 | CFLAGS+= -I sysdeps/x86_64 -I .
|
|---|
| 18 | else
|
|---|
| 19 | CFLAGS+= -I sysdeps/i386/i686 -I sysdeps/i386 -I .
|
|---|
| 20 | endif
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 | #
|
|---|
| 24 | # Skipped tests, Expected failures.
|
|---|
| 25 | #
|
|---|
| 26 | ifeq ($(TARGET),)
|
|---|
| 27 | TARGET := innoteklibc
|
|---|
| 28 | endif
|
|---|
| 29 |
|
|---|
| 30 | ifeq ($(TARGET),glibc)
|
|---|
| 31 | SKIPPED :=
|
|---|
| 32 | EXPECTED :=
|
|---|
| 33 | _TARGET_OK := ok
|
|---|
| 34 | CFLAGS += \
|
|---|
| 35 | -DHAVE_MCHECK_H \
|
|---|
| 36 | -DHAVE___STRTOD_INTERNAL \
|
|---|
| 37 | -DHAVE_ASPRINTF \
|
|---|
| 38 | -DHAVE_GETLINE \
|
|---|
| 39 | -DHAVE_STRNLEN \
|
|---|
| 40 | -DHAVE_STPNCPY \
|
|---|
| 41 | -DHAVE_STRCHRNUL \
|
|---|
| 42 | -DHAVE_RAWMEMCHR \
|
|---|
| 43 | -DHAVE_MEMRCHR \
|
|---|
| 44 | -DHAVE_STRSEP \
|
|---|
| 45 | -DHAVE_STRNDUP \
|
|---|
| 46 | -DHAVE_MEMPCPY \
|
|---|
| 47 | -DHAVE_NEWLOCALE \
|
|---|
| 48 | -DHAVE_64BIT_FILEIO_TYPES \
|
|---|
| 49 | -DHAVE_SWPRINTF
|
|---|
| 50 | endif
|
|---|
| 51 |
|
|---|
| 52 | ifeq ($(TARGET),innoteklibc)
|
|---|
| 53 | SKIPPED := \
|
|---|
| 54 | stdio-common/tst-cookie.c \
|
|---|
| 55 | stdio-common/tst-fmemopen.c \
|
|---|
| 56 | stdio-common/tst-fmemopen2.c \
|
|---|
| 57 | stdio-common/tst-obprintf.c \
|
|---|
| 58 | stdio-common/tst-perror.c \
|
|---|
| 59 | stdio-common/tst-popen.c \
|
|---|
| 60 | stdio-common/tst-printfsz.c \
|
|---|
| 61 | stdio-common/tst-swprintf.c \
|
|---|
| 62 | stdio-common/tstgetln.c \
|
|---|
| 63 | \
|
|---|
| 64 | stdlib/test-a64l.c \
|
|---|
| 65 | stdlib/tst-setcontext.c \
|
|---|
| 66 | \
|
|---|
| 67 | string/test-ffs.c \
|
|---|
| 68 | string/test-stpncpy.c \
|
|---|
| 69 | string/tst-bswap.c \
|
|---|
| 70 | string/tst-strfry.c \
|
|---|
| 71 | \
|
|---|
| 72 | sunrpc/tst-getmyaddr.c \
|
|---|
| 73 | \
|
|---|
| 74 | time/tst_wcsftime.c \
|
|---|
| 75 | time/tst-ftime_l.c \
|
|---|
| 76 | time/tst-getdate.c \
|
|---|
| 77 | time/tst-strptime2.c \
|
|---|
| 78 | \
|
|---|
| 79 | timezone/test-tz.c \
|
|---|
| 80 | timezone/tst-timezone.c \
|
|---|
| 81 | \
|
|---|
| 82 | wcsmbs/tst-wcpncpy.c \
|
|---|
| 83 | wcsmbs/tst-wcsnlen.c \
|
|---|
| 84 |
|
|---|
| 85 | EXPECTED := \
|
|---|
| 86 | wcsmbs/tst-mbrtowc.c \
|
|---|
| 87 | wcsmbs/tst-wcrtomb.c \
|
|---|
| 88 | time/tst-posixtz.c \
|
|---|
| 89 | time/tst-strftime.c \
|
|---|
| 90 | stdlib/tst-bsearch.c \
|
|---|
| 91 | stdlib/tst-qsort.c \
|
|---|
| 92 | stdlib/tst-putenv.c \
|
|---|
| 93 | stdio-common/test-popen.c \
|
|---|
| 94 | stdio-common/test-vfprintf.c \
|
|---|
| 95 | stdio-common/tst-fphex.c \
|
|---|
| 96 | stdio-common/tstscanf.c
|
|---|
| 97 |
|
|---|
| 98 | # NOTES:
|
|---|
| 99 | # stdio-common/test-vfprintf.c: File duplication and truncation needs exploring with regards to file position!
|
|---|
| 100 | # stdio-common/tst-fphex.c: We don't implement %a.
|
|---|
| 101 | # stdio-common/tst-sscanf.c: Is doing some thousand separator and internationalization stuff which we don't implement.
|
|---|
| 102 | # stdio-common/tstscanf.c: two cases of sscan working in three different ways depending on glibc, bsd or libc. cool!
|
|---|
| 103 |
|
|---|
| 104 | CFLAGS += -Zomf -g \
|
|---|
| 105 | -DHAVE_STRNLEN \
|
|---|
| 106 | -DHAVE_MEMPCPY
|
|---|
| 107 | LDFLAGS += -Zstack 512
|
|---|
| 108 | _TARGET_OK := ok
|
|---|
| 109 | endif
|
|---|
| 110 |
|
|---|
| 111 | ifeq ($(TARGET),bsd)
|
|---|
| 112 | SKIPPED := \
|
|---|
| 113 | argp/tst-argp1.c \
|
|---|
| 114 | argp/argp-test.c \
|
|---|
| 115 | \
|
|---|
| 116 | assert/test-assert-perr.c \
|
|---|
| 117 | \
|
|---|
| 118 | crypt/cert.c \
|
|---|
| 119 | \
|
|---|
| 120 | iconv/tst-iconv1.c \
|
|---|
| 121 | iconv/tst-iconv2.c \
|
|---|
| 122 | iconv/tst-iconv3.c \
|
|---|
| 123 | iconv/tst-iconv5.c \
|
|---|
| 124 | \
|
|---|
| 125 | inet/tst-ether_aton.c \
|
|---|
| 126 | \
|
|---|
| 127 | intl/tst-ngettext.c \
|
|---|
| 128 | \
|
|---|
| 129 | string/test-mempcpy.c \
|
|---|
| 130 | string/test-stpncpy.c \
|
|---|
| 131 | string/tst-bswap.c \
|
|---|
| 132 | string/tst-strfry.c
|
|---|
| 133 | EXCEPTIONS := \
|
|---|
| 134 | catgets/test-gencat.c
|
|---|
| 135 | _TARGET_OK := ok
|
|---|
| 136 | CFLAGS += -I sysdeps/unix/bsd -D__BSD__ \
|
|---|
| 137 | -DHAVE_ASPRINTF \
|
|---|
| 138 | -DHAVE_SWPRINTF \
|
|---|
| 139 | -DHAVE_GETLINE
|
|---|
| 140 | endif
|
|---|
| 141 |
|
|---|
| 142 | ifndef _TARGET_OK
|
|---|
| 143 | $(error Invalid TARGET definition '$(TARGET)'. valid: glibc, innoteklibc, bsd)
|
|---|
| 144 | endif
|
|---|
| 145 |
|
|---|
| 146 |
|
|---|
| 147 | nothing:
|
|---|
| 148 | @echo TS=$(TS)
|
|---|
| 149 |
|
|---|
| 150 |
|
|---|
| 151 | #
|
|---|
| 152 | # The test.
|
|---|
| 153 | #
|
|---|
| 154 |
|
|---|
| 155 | ARGP := \
|
|---|
| 156 | argp/tst-argp1.c \
|
|---|
| 157 | argp/argp-test.c
|
|---|
| 158 |
|
|---|
| 159 | ASSERT := \
|
|---|
| 160 | assert/test-assert-perr.c \
|
|---|
| 161 | assert/test-assert.c
|
|---|
| 162 |
|
|---|
| 163 | CATGETS := \
|
|---|
| 164 | catgets/test-gencat.c
|
|---|
| 165 |
|
|---|
| 166 | #CONFORM - separate.
|
|---|
| 167 |
|
|---|
| 168 | CRYPT := \
|
|---|
| 169 | crypt/md5c-test.c \
|
|---|
| 170 | crypt/cert.c
|
|---|
| 171 |
|
|---|
| 172 | crypt/md5c-test.c_LDFLAGS = -lcrypt
|
|---|
| 173 | crypt/cert.c_LDFLAGS = -lcrypt
|
|---|
| 174 | crypt/cert.c_INPUT = crypt/cert.input
|
|---|
| 175 |
|
|---|
| 176 | CSU := \
|
|---|
| 177 | csu/tst-empty.c
|
|---|
| 178 | # csu/tst-atomic.c \
|
|---|
| 179 | # csu/tst-atomic-long.c \
|
|---|
| 180 |
|
|---|
| 181 | CTYPE := \
|
|---|
| 182 | ctype/test_ctype.c
|
|---|
| 183 |
|
|---|
| 184 | DEBUG := # skipped
|
|---|
| 185 |
|
|---|
| 186 | DIRENT := \
|
|---|
| 187 | dirent/list.c \
|
|---|
| 188 | dirent/bug-readdir1.c \
|
|---|
| 189 | dirent/opendir-tst1.c \
|
|---|
| 190 | dirent/tst-seekdir.c
|
|---|
| 191 |
|
|---|
| 192 | DLFCN := # postponed
|
|---|
| 193 | ELF := # postponed
|
|---|
| 194 | GMON := # postponed
|
|---|
| 195 |
|
|---|
| 196 | GNULIB := \
|
|---|
| 197 | gnulib/tst-gcc.c
|
|---|
| 198 |
|
|---|
| 199 | GRP := \
|
|---|
| 200 | grp/testgrp.c
|
|---|
| 201 | # grp/tst_fgetgrent.c
|
|---|
| 202 |
|
|---|
| 203 | ICONV := \
|
|---|
| 204 | iconv/tst-iconv1.c \
|
|---|
| 205 | iconv/tst-iconv2.c \
|
|---|
| 206 | iconv/tst-iconv3.c \
|
|---|
| 207 | iconv/tst-iconv5.c
|
|---|
| 208 |
|
|---|
| 209 | ICONVDATA := # skipped
|
|---|
| 210 |
|
|---|
| 211 | INET := \
|
|---|
| 212 | inet/bug-if1.c \
|
|---|
| 213 | inet/htontest.c \
|
|---|
| 214 | inet/test-ifaddrs.c \
|
|---|
| 215 | inet/test_ifindex.c \
|
|---|
| 216 | inet/tst-ether_aton.c \
|
|---|
| 217 | inet/tst-gethnm.c \
|
|---|
| 218 | inet/tst-network.c \
|
|---|
| 219 | inet/tst-ntoa.c
|
|---|
| 220 |
|
|---|
| 221 | INTL := \
|
|---|
| 222 | intl/tst-ngettext.c
|
|---|
| 223 | # more intl todo
|
|---|
| 224 | IO := \
|
|---|
| 225 | io/bug-ftw1.c \
|
|---|
| 226 | io/bug-ftw2.c \
|
|---|
| 227 | io/bug-ftw3.c \
|
|---|
| 228 | io/bug-ftw4.c \
|
|---|
| 229 | io/ftwtest.c \
|
|---|
| 230 | io/test-lfs.c \
|
|---|
| 231 | io/test-stat.c \
|
|---|
| 232 | io/test-stat2.c \
|
|---|
| 233 | io/test-utime.c \
|
|---|
| 234 | io/tst-fcntl.c \
|
|---|
| 235 | io/tst-getcwd.c \
|
|---|
| 236 | io/tst-statvfs.c
|
|---|
| 237 | # todo io/ftwtest.sh
|
|---|
| 238 |
|
|---|
| 239 | LIBIO := \
|
|---|
| 240 | libio/bug-fopena+.c \
|
|---|
| 241 | libio/bug-fseek.c \
|
|---|
| 242 | libio/bug-ftell.c \
|
|---|
| 243 | libio/bug-mmap-fflush.c \
|
|---|
| 244 | libio/bug-rewind.c \
|
|---|
| 245 | libio/bug-rewind2.c \
|
|---|
| 246 | libio/bug-ungetc.c \
|
|---|
| 247 | libio/bug-ungetc2.c \
|
|---|
| 248 | libio/bug-ungetc3.c \
|
|---|
| 249 | libio/bug-ungetc4.c \
|
|---|
| 250 | libio/bug-ungetwc1.c \
|
|---|
| 251 | libio/bug-ungetwc2.c \
|
|---|
| 252 | libio/bug-wfflush.c \
|
|---|
| 253 | libio/test-fmemopen.c \
|
|---|
| 254 | libio/test-freopen.c \
|
|---|
| 255 | libio/tst-atime.c \
|
|---|
| 256 | libio/tst-eof.c \
|
|---|
| 257 | libio/tst-ext.c \
|
|---|
| 258 | libio/tst-fgetws.c \
|
|---|
| 259 | libio/tst-fopenloc.c \
|
|---|
| 260 | libio/tst-freopen.c \
|
|---|
| 261 | libio/tst-mmap-eofsync.c \
|
|---|
| 262 | libio/tst-mmap-fflushsync.c \
|
|---|
| 263 | libio/tst-mmap-offend.c \
|
|---|
| 264 | libio/tst-mmap-setvbuf.c \
|
|---|
| 265 | libio/tst-mmap2-eofsync.c \
|
|---|
| 266 | libio/tst-sscanf.c \
|
|---|
| 267 | libio/tst-swscanf.c \
|
|---|
| 268 | libio/tst-ungetwc1.c \
|
|---|
| 269 | libio/tst-ungetwc2.c \
|
|---|
| 270 | libio/tst-widetext.c \
|
|---|
| 271 | libio/tst_getwc.c \
|
|---|
| 272 | libio/tst_putwc.c \
|
|---|
| 273 | libio/tst_swprintf.c \
|
|---|
| 274 | libio/tst_swscanf.c \
|
|---|
| 275 | libio/tst_wprintf.c \
|
|---|
| 276 | libio/tst_wprintf2.c \
|
|---|
| 277 | libio/tst_wscanf.c
|
|---|
| 278 |
|
|---|
| 279 | libio/tst-widetext.c_INPUT = libio/tst-widetext.input
|
|---|
| 280 | libio/tst_getwc.c_INPUT = libio/tst_getwc.input
|
|---|
| 281 | libio/tst_wscanf.c_INPUT = libio/tst_wscanf.input
|
|---|
| 282 |
|
|---|
| 283 | # todo libio/test-freopen.sh
|
|---|
| 284 |
|
|---|
| 285 | LINUXTHREADS := # skipped
|
|---|
| 286 |
|
|---|
| 287 | LOCALE := \
|
|---|
| 288 | locale/tst-C-locale.c
|
|---|
| 289 |
|
|---|
| 290 | LOCALEDATA := # todo later
|
|---|
| 291 |
|
|---|
| 292 | LOGIN := \
|
|---|
| 293 | login/tst-grantpt.c \
|
|---|
| 294 | login/tst-utmp.c \
|
|---|
| 295 | login/tst-utmpx.c
|
|---|
| 296 |
|
|---|
| 297 | MALLOC := \
|
|---|
| 298 | malloc/tst-calloc.c \
|
|---|
| 299 | malloc/tst-malloc.c \
|
|---|
| 300 | malloc/tst-mallocstate.c \
|
|---|
| 301 | malloc/tst-mcheck.c \
|
|---|
| 302 | malloc/tst-obstack.c \
|
|---|
| 303 | malloc/tst-valloc.c
|
|---|
| 304 | # malloc/tst-mtrace.c
|
|---|
| 305 | # malloc/tst-mtrace.sh
|
|---|
| 306 |
|
|---|
| 307 | MATH := \
|
|---|
| 308 | math/basic-test.c \
|
|---|
| 309 | math/bug-nextafter.c \
|
|---|
| 310 | math/bug-nexttoward.c \
|
|---|
| 311 | math/bug-tgmath1.c \
|
|---|
| 312 | math/test-double.c \
|
|---|
| 313 | math/test-fenv.c \
|
|---|
| 314 | math/test-float.c \
|
|---|
| 315 | math/test-fpucw.c \
|
|---|
| 316 | math/test-idouble.c \
|
|---|
| 317 | math/test-ifloat.c \
|
|---|
| 318 | math/test-ildoubl.c \
|
|---|
| 319 | math/test-ldouble.c \
|
|---|
| 320 | math/test-matherr.c \
|
|---|
| 321 | math/test-misc.c \
|
|---|
| 322 | math/test-tgmath-ret.c \
|
|---|
| 323 | math/test-tgmath.c \
|
|---|
| 324 | math/tst-definitions.c
|
|---|
| 325 | # math/atest-exp2.c
|
|---|
| 326 | # math/atest-sincos.c
|
|---|
| 327 | # math/atest-exp.c
|
|---|
| 328 | # math/gen-libm-test.pl
|
|---|
| 329 | $(foreach t,$(MATH),$(eval $(t)_LDFLAGS := -lm))
|
|---|
| 330 | $(foreach t,$(filter math/test-%,$(MATH)), \
|
|---|
| 331 | $(eval $(t)_DEPS := $(OUTDIR)/math/libm-test.stamp) \
|
|---|
| 332 | $(eval $(t)_CFLAGS := -I $(OUTDIR)/math/) \
|
|---|
| 333 | )
|
|---|
| 334 |
|
|---|
| 335 | $(OUTDIR)/math/libm-test.stamp: \
|
|---|
| 336 | sysdeps/i386/fpu/libm-test-ulps \
|
|---|
| 337 | math/libm-test.inc \
|
|---|
| 338 | math/gen-libm-test.pl Makefile
|
|---|
| 339 | cd math && perl gen-libm-test.pl -u ../$< -o ../$(OUTDIR)/math/
|
|---|
| 340 | @echo > $@
|
|---|
| 341 |
|
|---|
| 342 |
|
|---|
| 343 | MISC :=\
|
|---|
| 344 | misc/tst-dirname.c \
|
|---|
| 345 | misc/tst-efgcvt.c \
|
|---|
| 346 | misc/tst-fdset.c \
|
|---|
| 347 | misc/tst-hsearch.c \
|
|---|
| 348 | misc/tst-mntent.c \
|
|---|
| 349 | misc/tst-tsearch.c
|
|---|
| 350 | misc/tst-tsearch.c_LDFLAGS = -lm
|
|---|
| 351 |
|
|---|
| 352 | NPTL := # skipped
|
|---|
| 353 |
|
|---|
| 354 | NSS := \
|
|---|
| 355 | nss/bug-erange.c \
|
|---|
| 356 | nss/test-netdb.c
|
|---|
| 357 |
|
|---|
| 358 |
|
|---|
| 359 | # posix/bug-regex5.c - internal
|
|---|
| 360 | # posix/bug-regex20.c - internal
|
|---|
| 361 | # posix/bug-regex24.c - goes on forever it seems
|
|---|
| 362 | POSIX :=\
|
|---|
| 363 | posix/bug-ga1.c \
|
|---|
| 364 | posix/bug-ga2.c \
|
|---|
| 365 | posix/bug-glob1.c \
|
|---|
| 366 | posix/bug-glob2.c \
|
|---|
| 367 | posix/bug-regex1.c \
|
|---|
| 368 | posix/bug-regex10.c \
|
|---|
| 369 | posix/bug-regex11.c \
|
|---|
| 370 | posix/bug-regex12.c \
|
|---|
| 371 | posix/bug-regex13.c \
|
|---|
| 372 | posix/bug-regex14.c \
|
|---|
| 373 | posix/bug-regex15.c \
|
|---|
| 374 | posix/bug-regex16.c \
|
|---|
| 375 | posix/bug-regex17.c \
|
|---|
| 376 | posix/bug-regex18.c \
|
|---|
| 377 | posix/bug-regex19.c \
|
|---|
| 378 | posix/bug-regex2.c \
|
|---|
| 379 | posix/bug-regex21.c \
|
|---|
| 380 | posix/bug-regex22.c \
|
|---|
| 381 | posix/bug-regex23.c \
|
|---|
| 382 | posix/bug-regex3.c \
|
|---|
| 383 | posix/bug-regex4.c \
|
|---|
| 384 | posix/bug-regex6.c \
|
|---|
| 385 | posix/bug-regex7.c \
|
|---|
| 386 | posix/bug-regex8.c \
|
|---|
| 387 | posix/bug-regex9.c \
|
|---|
| 388 | posix/runptests.c \
|
|---|
| 389 | posix/runtests.c \
|
|---|
| 390 | posix/test-vfork.c \
|
|---|
| 391 | posix/testfnm.c \
|
|---|
| 392 | posix/tst-boost.c \
|
|---|
| 393 | posix/tst-chmod.c \
|
|---|
| 394 | posix/tst-dir.c \
|
|---|
| 395 | posix/tst-exec.c \
|
|---|
| 396 | posix/tst-execl1.c \
|
|---|
| 397 | posix/tst-execl2.c \
|
|---|
| 398 | posix/tst-execle1.c \
|
|---|
| 399 | posix/tst-execle2.c \
|
|---|
| 400 | posix/tst-execlp1.c \
|
|---|
| 401 | posix/tst-execlp2.c \
|
|---|
| 402 | posix/tst-execv1.c \
|
|---|
| 403 | posix/tst-execv2.c \
|
|---|
| 404 | posix/tst-execve1.c \
|
|---|
| 405 | posix/tst-execve2.c \
|
|---|
| 406 | posix/tst-execvp1.c \
|
|---|
| 407 | posix/tst-execvp2.c \
|
|---|
| 408 | posix/tst-execvp3.c \
|
|---|
| 409 | posix/tst-fnmatch.c \
|
|---|
| 410 | posix/tst-fork.c \
|
|---|
| 411 | posix/tst-getaddrinfo.c \
|
|---|
| 412 | posix/tst-getaddrinfo2.c \
|
|---|
| 413 | posix/tst-getlogin.c \
|
|---|
| 414 | posix/tst-gnuglob.c \
|
|---|
| 415 | posix/tst-mmap.c \
|
|---|
| 416 | posix/tst-nanosleep.c \
|
|---|
| 417 | posix/tst-nice.c \
|
|---|
| 418 | posix/tst-pcre.c \
|
|---|
| 419 | posix/tst-preadwrite.c \
|
|---|
| 420 | posix/tst-preadwrite64.c \
|
|---|
| 421 | posix/tst-rxspencer.c \
|
|---|
| 422 | posix/tst-spawn.c \
|
|---|
| 423 | posix/tst-truncate.c \
|
|---|
| 424 | posix/tst-truncate64.c \
|
|---|
| 425 | posix/tst-vfork1.c \
|
|---|
| 426 | posix/tst-vfork2.c \
|
|---|
| 427 | posix/tst-waitid.c \
|
|---|
| 428 | posix/tstgetopt.c
|
|---|
| 429 | # posix/tst-regex.c - internal?
|
|---|
| 430 | # posix/tst-regex2.c - too new?
|
|---|
| 431 | # posix/tst-regexloc.c - internal?
|
|---|
| 432 | # posix/tst-sysconf.c - too new?
|
|---|
| 433 | # todo:
|
|---|
| 434 | # posix/wordexp-test.c
|
|---|
| 435 | # posix/wordexp-tst.sh
|
|---|
| 436 | # posix/globtest.c
|
|---|
| 437 | # posix/globtest.sh
|
|---|
| 438 | # posix/tst-getconf.sh
|
|---|
| 439 |
|
|---|
| 440 | posix/tst-fnmatch.c_INPUT = posix/tst-fnmatch.input
|
|---|
| 441 |
|
|---|
| 442 | posix/tstgetopt.c_ARGS = -a -b -cfoobar --required foobar --optional=bazbug --none random --col --color --colour
|
|---|
| 443 | posix/tst-exec.c_ARGS = -- $(OUTDIR)/posix/tst-exec.exe
|
|---|
| 444 | posix/tst-spawn.c_ARGS = -- $(OUTDIR)/posix/tst-spawn.exe
|
|---|
| 445 | posix/tst-dir.c_ARGS = `pwd` `cd $(OUTDIR)/$(posix); pwd` `cd $(OUTDIR)/; pwd` $(OUTDIR)/tst-dir.exe
|
|---|
| 446 | posix/tst-chmod.c_ARGS = `cd posix/; pwd`
|
|---|
| 447 | posix/tst-rxspencer.c_ARGS = --utf8 posix/rxspencer/tests
|
|---|
| 448 | posix/tst-pcre.c_ARGS = posix/PCRE.tests
|
|---|
| 449 | posix/tst-boost.c_ARGS = posix/BOOST.tests
|
|---|
| 450 | posix/bug-glob1.c_ARGS = "$(OBJDIR)/posix/"
|
|---|
| 451 | posix/tst-execvp3.c_ARGS = --test-dir="$(OBJDIR)/posix/"
|
|---|
| 452 |
|
|---|
| 453 |
|
|---|
| 454 | PWD := \
|
|---|
| 455 | pwd/tst-getpw.c
|
|---|
| 456 |
|
|---|
| 457 | RESOLV := \
|
|---|
| 458 | resolv/tst-aton.c \
|
|---|
| 459 | resolv/tst-leaks.c
|
|---|
| 460 | resolv/tst-leaks.c_LDFLAGS = -lresolv
|
|---|
| 461 |
|
|---|
| 462 | RT := # todo
|
|---|
| 463 | SETJMP := \
|
|---|
| 464 | setjmp/tst-setjmp.c
|
|---|
| 465 |
|
|---|
| 466 | SIGNAL := \
|
|---|
| 467 | signal/tst-raise.c \
|
|---|
| 468 | signal/tst-signal.c \
|
|---|
| 469 | signal/tst-sigset.c \
|
|---|
| 470 | signal/tst-sigsimple.c
|
|---|
| 471 |
|
|---|
| 472 | SOFT-FP := # skipping
|
|---|
| 473 |
|
|---|
| 474 | STDIO-COMMON := \
|
|---|
| 475 | stdio-common/temptest.c \
|
|---|
| 476 | stdio-common/test-fseek.c \
|
|---|
| 477 | stdio-common/test-fwrite.c \
|
|---|
| 478 | stdio-common/test-popen.c \
|
|---|
| 479 | stdio-common/test-vfprintf.c \
|
|---|
| 480 | stdio-common/test_rdwr.c \
|
|---|
| 481 | stdio-common/tst-cookie.c \
|
|---|
| 482 | stdio-common/tst-fdopen.c \
|
|---|
| 483 | stdio-common/tst-ferror.c \
|
|---|
| 484 | stdio-common/tst-fileno.c \
|
|---|
| 485 | stdio-common/tst-fmemopen.c \
|
|---|
| 486 | stdio-common/tst-fmemopen2.c \
|
|---|
| 487 | stdio-common/tst-fphex.c \
|
|---|
| 488 | stdio-common/tst-fseek.c \
|
|---|
| 489 | stdio-common/tst-gets.c \
|
|---|
| 490 | stdio-common/tst-obprintf.c \
|
|---|
| 491 | stdio-common/tst-perror.c \
|
|---|
| 492 | stdio-common/tst-popen.c \
|
|---|
| 493 | stdio-common/tst-printfsz.c \
|
|---|
| 494 | stdio-common/tst-rndseek.c \
|
|---|
| 495 | stdio-common/tst-sprintf.c \
|
|---|
| 496 | stdio-common/tst-sscanf.c \
|
|---|
| 497 | stdio-common/tst-swprintf.c \
|
|---|
| 498 | stdio-common/tst-tmpnam.c \
|
|---|
| 499 | stdio-common/tst-ungetc.c \
|
|---|
| 500 | stdio-common/tst-unlockedio.c \
|
|---|
| 501 | stdio-common/tst-wc-printf.c \
|
|---|
| 502 | stdio-common/tstdiomisc.c \
|
|---|
| 503 | stdio-common/tstgetln.c \
|
|---|
| 504 | stdio-common/tstscanf.c
|
|---|
| 505 | stdio-common/tst-ferror.c_INPUT = stdio-common/tst-ferror.input
|
|---|
| 506 | stdio-common/tst-gets.c_INPUT = stdio-common/tst-gets.input
|
|---|
| 507 | stdio-common/tstgetln.c_INPUT = stdio-common/tstgetln.input
|
|---|
| 508 | stdio-common/tstscanf.c_INPUT = stdio-common/tstscanf.input
|
|---|
| 509 | # stdio-common/tst-printf.c
|
|---|
| 510 | # stdio-common/tst-printf.sh
|
|---|
| 511 | # stdio-common/tst-unbputc.c
|
|---|
| 512 | # stdio-common/tst-unbputc.sh
|
|---|
| 513 |
|
|---|
| 514 | STDLIB := \
|
|---|
| 515 | stdlib/bug-strtod.c \
|
|---|
| 516 | stdlib/test-a64l.c \
|
|---|
| 517 | stdlib/test-canon.c \
|
|---|
| 518 | stdlib/test-canon2.c \
|
|---|
| 519 | stdlib/testmb.c \
|
|---|
| 520 | stdlib/testmb2.c \
|
|---|
| 521 | stdlib/testrand.c \
|
|---|
| 522 | stdlib/testsort.c \
|
|---|
| 523 | stdlib/tst-bsearch.c \
|
|---|
| 524 | stdlib/tst-environ.c \
|
|---|
| 525 | stdlib/tst-limits.c \
|
|---|
| 526 | stdlib/tst-putenv.c \
|
|---|
| 527 | stdlib/tst-qsort.c \
|
|---|
| 528 | stdlib/tst-rand48.c \
|
|---|
| 529 | stdlib/tst-random.c \
|
|---|
| 530 | stdlib/tst-random2.c \
|
|---|
| 531 | stdlib/tst-setcontext.c \
|
|---|
| 532 | stdlib/tst-strtod.c \
|
|---|
| 533 | stdlib/tst-strtol.c \
|
|---|
| 534 | stdlib/tst-strtoll.c \
|
|---|
| 535 | stdlib/tst-system.c \
|
|---|
| 536 | stdlib/tst-xpg-basename.c \
|
|---|
| 537 | stdlib/testdiv.c
|
|---|
| 538 | # todo:
|
|---|
| 539 | # stdlib/tst-fmtmsg.c
|
|---|
| 540 | # stdlib/tst-fmtmsg.sh
|
|---|
| 541 | # stdlib/tst-putenvmod.c
|
|---|
| 542 | stdlib/testdiv.c_INPUT = stdlib/testdiv.input
|
|---|
| 543 |
|
|---|
| 544 | STRING := \
|
|---|
| 545 | string/bug-strcoll1.c \
|
|---|
| 546 | string/bug-strncat1.c \
|
|---|
| 547 | string/bug-strpbrk1.c \
|
|---|
| 548 | string/bug-strspn1.c \
|
|---|
| 549 | string/inl-tester.c \
|
|---|
| 550 | string/noinl-tester.c \
|
|---|
| 551 | string/test-ffs.c \
|
|---|
| 552 | string/test-memccpy.c \
|
|---|
| 553 | string/test-memchr.c \
|
|---|
| 554 | string/test-memcmp.c \
|
|---|
| 555 | string/test-memcpy.c \
|
|---|
| 556 | string/test-memmove.c \
|
|---|
| 557 | string/test-mempcpy.c \
|
|---|
| 558 | string/test-memset.c \
|
|---|
| 559 | string/test-stpcpy.c \
|
|---|
| 560 | string/test-stpncpy.c \
|
|---|
| 561 | string/test-strcat.c \
|
|---|
| 562 | string/test-strchr.c \
|
|---|
| 563 | string/test-strcmp.c \
|
|---|
| 564 | string/test-strcpy.c \
|
|---|
| 565 | string/test-strcspn.c \
|
|---|
| 566 | string/test-strlen.c \
|
|---|
| 567 | string/test-strncmp.c \
|
|---|
| 568 | string/test-strncpy.c \
|
|---|
| 569 | string/test-strpbrk.c \
|
|---|
| 570 | string/test-strrchr.c \
|
|---|
| 571 | string/test-strspn.c \
|
|---|
| 572 | string/testcopy.c \
|
|---|
| 573 | string/tester.c \
|
|---|
| 574 | string/tst-bswap.c \
|
|---|
| 575 | string/tst-inlcall.c \
|
|---|
| 576 | string/tst-strfry.c \
|
|---|
| 577 | string/tst-strlen.c \
|
|---|
| 578 | string/tst-strtok.c \
|
|---|
| 579 | string/tst-strxfrm.c \
|
|---|
| 580 |
|
|---|
| 581 | STRING_IN_EXP := \
|
|---|
| 582 | string/tst-svc.c
|
|---|
| 583 |
|
|---|
| 584 | SUNRPC := \
|
|---|
| 585 | sunrpc/tst-getmyaddr.c
|
|---|
| 586 |
|
|---|
| 587 | SYSDEPS := # todo
|
|---|
| 588 |
|
|---|
| 589 | TIME := \
|
|---|
| 590 | time/clocktest.c \
|
|---|
| 591 | time/test_time.c \
|
|---|
| 592 | time/tst-ftime_l.c \
|
|---|
| 593 | time/tst-getdate.c \
|
|---|
| 594 | time/tst-mktime.c \
|
|---|
| 595 | time/tst-mktime2.c \
|
|---|
| 596 | time/tst-mktime3.c \
|
|---|
| 597 | time/tst-posixtz.c \
|
|---|
| 598 | time/tst-strftime.c \
|
|---|
| 599 | time/tst-strptime.c \
|
|---|
| 600 | time/tst-strptime2.c \
|
|---|
| 601 | time/tst_wcsftime.c
|
|---|
| 602 |
|
|---|
| 603 | TIMEZONE := \
|
|---|
| 604 | timezone/test-tz.c \
|
|---|
| 605 | timezone/tst-timezone.c
|
|---|
| 606 |
|
|---|
| 607 | WCSMBS := \
|
|---|
| 608 | wcsmbs/tst-btowc.c \
|
|---|
| 609 | wcsmbs/tst-mbrtowc.c \
|
|---|
| 610 | wcsmbs/tst-mbsrtowcs.c \
|
|---|
| 611 | wcsmbs/tst-wcpncpy.c \
|
|---|
| 612 | wcsmbs/tst-wcrtomb.c \
|
|---|
| 613 | wcsmbs/tst-wcsnlen.c \
|
|---|
| 614 | wcsmbs/tst-wcstof.c \
|
|---|
| 615 | wcsmbs/wcsmbs-tst1.c
|
|---|
| 616 |
|
|---|
| 617 | WCTYPE := \
|
|---|
| 618 | wctype/test_wcfuncs.c \
|
|---|
| 619 | wctype/test_wctype.c
|
|---|
| 620 |
|
|---|
| 621 |
|
|---|
| 622 | SUBTESTS := \
|
|---|
| 623 | ARGP \
|
|---|
| 624 | ASSERT \
|
|---|
| 625 | CATGETS \
|
|---|
| 626 | CRYPT \
|
|---|
| 627 | CSU \
|
|---|
| 628 | CTYPE \
|
|---|
| 629 | DEBUG \
|
|---|
| 630 | DIRENT \
|
|---|
| 631 | DLFCN \
|
|---|
| 632 | ELF \
|
|---|
| 633 | GMON \
|
|---|
| 634 | GNULIB \
|
|---|
| 635 | GRP \
|
|---|
| 636 | ICONV \
|
|---|
| 637 | ICONVDATA \
|
|---|
| 638 | INET \
|
|---|
| 639 | INTL \
|
|---|
| 640 | IO \
|
|---|
| 641 | LIBIO \
|
|---|
| 642 | LINUXTHREADS \
|
|---|
| 643 | LOCALE \
|
|---|
| 644 | LOCALEDATA \
|
|---|
| 645 | LOGIN \
|
|---|
| 646 | MALLOC \
|
|---|
| 647 | MANUAL \
|
|---|
| 648 | MATH \
|
|---|
| 649 | MISC \
|
|---|
| 650 | NPTL \
|
|---|
| 651 | NSS \
|
|---|
| 652 | POSIX \
|
|---|
| 653 | PWD \
|
|---|
| 654 | RESOLV \
|
|---|
| 655 | RT \
|
|---|
| 656 | SCRIPTS \
|
|---|
| 657 | SETJMP \
|
|---|
| 658 | SIGNAL \
|
|---|
| 659 | SOFT-FP \
|
|---|
| 660 | STDIO-COMMON \
|
|---|
| 661 | STDLIB \
|
|---|
| 662 | STRING \
|
|---|
| 663 | SUNRPC \
|
|---|
| 664 | SYSDEPS \
|
|---|
| 665 | TIME \
|
|---|
| 666 | TIMEZONE \
|
|---|
| 667 | WCSMBS \
|
|---|
| 668 | WCTYPE
|
|---|
| 669 |
|
|---|
| 670 | .SUFFIXES:
|
|---|
| 671 | .SUFFIXES: .c .exe .result
|
|---|
| 672 |
|
|---|
| 673 |
|
|---|
| 674 | #
|
|---|
| 675 | # Generate test rules
|
|---|
| 676 | #
|
|---|
| 677 | _TESTS :=
|
|---|
| 678 |
|
|---|
| 679 | # process one test
|
|---|
| 680 | define def_simple
|
|---|
| 681 |
|
|---|
| 682 | $(OUTDIR)/$2.result: $1 $(OUTDIR)/$(dir $1).dir_created $($(1)_DEPS)
|
|---|
| 683 | @echo "########## $1"; \
|
|---|
| 684 | echo "## BUILDING: $$(CC) $$(CFLAGS) $$(LDFLAGS) -o $(OUTDIR)/$2.exe $($(1)_CFLAGS) $($(1)_LDFLAGS) $$<"; \
|
|---|
| 685 | if $$(CC) $$(CFLAGS) $$(LDFLAGS) -o $(OUTDIR)/$2.exe $($(1)_CFLAGS) $($(1)_LDFLAGS) $$<; then \
|
|---|
| 686 | echo "## RUNNING : (cd $$(dir $$@) && LC_ALL=C $($1_ENVS) $(notdir $2).exe $($1_ARGS)) $(if $($(1)_INPUT), < $($(1)_INPUT),)"; \
|
|---|
| 687 | if (cd $$(dir $$@) && LC_ALL=C $($1_ENVS) $(notdir $2).exe $($1_ARGS)) $(if $($(1)_INPUT), < $($(1)_INPUT),); then\
|
|---|
| 688 | echo OK > $$@; \
|
|---|
| 689 | printf "########## %-26s - SUCCESS\n" "$1"; \
|
|---|
| 690 | else \
|
|---|
| 691 | echo "## rc=$$$$?"; \
|
|---|
| 692 | printf "########## %-26s - $(if $(filter $1,$(EXPECTED)),EXPECTED FAILURE,FAILURE)\n" "$1"; \
|
|---|
| 693 | echo "$(if $(filter $1,$(EXPECTED)),EXPECTED,FAILURE)" > $$@; \
|
|---|
| 694 | fi \
|
|---|
| 695 | else \
|
|---|
| 696 | echo "## rc=$$$$? "; \
|
|---|
| 697 | echo "## $$(CC) $$(CFLAGS) -o $(OUTDIR)/$2.exe $($(1)_CFLAGS) $($(1)_LDFLAGS) $$<"; \
|
|---|
| 698 | printf "########## %-26s - BUILD FAILURE\n" "$1"; \
|
|---|
| 699 | echo "FAILURE - $$(CC) $$(CFLAGS) -o $(OUTDIR)/$2.exe $($(1)_CFLAGS) $($(1)_LDFLAGS) $$<" > $$@; \
|
|---|
| 700 | fi
|
|---|
| 701 |
|
|---|
| 702 | $2: $(OUTDIR)/$2.result
|
|---|
| 703 | @
|
|---|
| 704 |
|
|---|
| 705 | _TESTS += $(OUTDIR)/$2.result
|
|---|
| 706 | $(eval _$(TEST) += $(OUTDIR)/$2.result)
|
|---|
| 707 | endef
|
|---|
| 708 |
|
|---|
| 709 | # skip on test
|
|---|
| 710 | define def_skipped
|
|---|
| 711 | $(OUTDIR)/$2.result: $(OUTDIR)/$(dir $1).dir_created
|
|---|
| 712 | @printf "########## %-26s - SKIPPED\n" "$1"; \
|
|---|
| 713 | echo "SKIPPED" > $$@
|
|---|
| 714 |
|
|---|
| 715 | _TESTS += $(OUTDIR)/$2.result
|
|---|
| 716 | $(eval _$(TEST) += $(OUTDIR)/$2.result)
|
|---|
| 717 | endef
|
|---|
| 718 |
|
|---|
| 719 | # process a subtest
|
|---|
| 720 | define def_subtest
|
|---|
| 721 | $(eval test := $(shell echo $(TEST) | tr 'A-Z' 'a-z'))
|
|---|
| 722 | $(eval _$(TEST) :=)
|
|---|
| 723 | $(foreach src, $($(TEST)), \
|
|---|
| 724 | $(if $(filter $(src),$(SKIPPED)),\
|
|---|
| 725 | $(eval $(call def_skipped,$(src),$(basename $(src)),)),\
|
|---|
| 726 | $(eval $(call def_simple,$(src),$(basename $(src)),)) \
|
|---|
| 727 | ) \
|
|---|
| 728 | )
|
|---|
| 729 |
|
|---|
| 730 | .PHONY: $(test)
|
|---|
| 731 | $(test): $(_$(TEST))
|
|---|
| 732 | @echo "**** $$@ ****"
|
|---|
| 733 | @echo " SUCCESS : `cat /dev/null $$^ | grep OK | wc -l`"
|
|---|
| 734 | @echo " SKIPPED : `cat /dev/null $$^ | grep SKIPPED | wc -l`"
|
|---|
| 735 | @echo " EXPECTED: `cat /dev/null $$^ | grep EXPECTED | wc -l`"
|
|---|
| 736 | @echo " FAILURES: `cat /dev/null $$^ | grep FAILURE | wc -l`"
|
|---|
| 737 |
|
|---|
| 738 | endef
|
|---|
| 739 |
|
|---|
| 740 | # process all subtests
|
|---|
| 741 | $(foreach TEST, $(SUBTESTS), $(eval $(def_subtest)))
|
|---|
| 742 |
|
|---|
| 743 |
|
|---|
| 744 | #
|
|---|
| 745 | # generate directory rules
|
|---|
| 746 | #
|
|---|
| 747 | define def_dir
|
|---|
| 748 | $1.dir_created:
|
|---|
| 749 | @mkdir -p $1
|
|---|
| 750 | @echo > $$@
|
|---|
| 751 | endef
|
|---|
| 752 |
|
|---|
| 753 | _DIRS := $(sort $(dir $(_TESTS)))
|
|---|
| 754 | $(foreach d,$(_DIRS), $(eval $(call def_dir,$(d))))
|
|---|
| 755 |
|
|---|
| 756 |
|
|---|
| 757 | #
|
|---|
| 758 | # All tests (expect the ones in the next sections).
|
|---|
| 759 | #
|
|---|
| 760 | tests: $(_TESTS)
|
|---|
| 761 | @echo "***************"
|
|---|
| 762 | @echo " SUCCESS : `cat /dev/null $^ | grep OK | wc -l`"
|
|---|
| 763 | @echo " SKIPPED : `cat /dev/null $^ | grep SKIPPED | wc -l`"
|
|---|
| 764 | @echo " EXPECTED: `cat /dev/null $^ | grep EXPECTED | wc -l`"
|
|---|
| 765 | @echo " FAILURES: `cat /dev/null $^ | grep FAILURE | wc -l`"
|
|---|
| 766 |
|
|---|
| 767 | tests-logged:
|
|---|
| 768 | @echo "**** logging to $(call LOG,test) ****"
|
|---|
| 769 | $(MAKE) tests 2>&1 | tee $(call LOG,test)
|
|---|
| 770 |
|
|---|
| 771 |
|
|---|
| 772 | #
|
|---|
| 773 | # Special and separate tests.
|
|---|
| 774 | #
|
|---|
| 775 | .PHONY: conform
|
|---|
| 776 | conform:
|
|---|
| 777 | cd conform/ && perl ./conformtest.pl
|
|---|
| 778 |
|
|---|
| 779 | conform-logged:
|
|---|
| 780 | @echo "**** logging to $(call LOG,conform) ****"
|
|---|
| 781 | $(MAKE) conform 2>&1 | tee $(call LOG,conform)
|
|---|
| 782 |
|
|---|