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

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

libc adjustments / config.

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