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

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

libio on libc.

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