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

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

initial config / 'porting'.

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