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

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

hacking.

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