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

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

Porting to FreeBSD 64-bit

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