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

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

...

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