source: trunk/src/libctests/glibc/Makefile@ 2240

Last change on this file since 2240 was 2240, checked in by bird, 20 years ago

Replaced BSD regex with the new GLIBC implementation.

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