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

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

..

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