Changeset 2076
- Timestamp:
- Jun 26, 2005, 12:42:04 AM (20 years ago)
- Location:
- trunk/src/libctests
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libctests/glibc/Makefile
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r2075 r2076 1 1 # $Id$ 2 3 4 # default rule 5 all: test -logged2 3 4 # default rule 5 all: tests-logged 6 6 7 7 # … … 12 12 LOG = $(OUTDIR)/$(1)-$(TS).log 13 13 CC = gcc 14 LDFLAGS= 14 15 CFLAGS = -O -D_GNU_SOURCE -std=gnu99 -DOBJPFX=\"$(OUTDIR)/\" 15 16 ifeq ($(shell uname -m),amd64) … … 24 25 # 25 26 ifeq ($(TARGET),) 26 TARGET := bsd27 TARGET := innoteklibc 27 28 endif 28 29 29 30 ifeq ($(TARGET),glibc) 30 SKIPPED := 31 EX CEPTIONS :=31 SKIPPED := 32 EXPECTED := 32 33 _TARGET_OK := ok 33 34 CFLAGS += \ … … 44 45 45 46 ifeq ($(TARGET),innoteklibc) 46 SKIPPED := 47 EXCEPTIONS := 47 SKIPPED := \ 48 \ 49 string/test-ffs.c \ 50 string/test-stpncpy.c \ 51 string/tst-bswap.c \ 52 string/tst-strfry.c \ 53 \ 54 time/tst_wcsftime.c \ 55 time/tst-ftime_l.c \ 56 time/tst-getdate.c \ 57 \ 58 timezone/test-tz.c \ 59 timezone/tst-timezone.c \ 60 \ 61 wcsmbs/tst-wcpncpy.c \ 62 wcsmbs/tst-wcsnlen.c \ 63 64 EXPECTED := \ 65 wcsmbs/tst-mbrtowc.c \ 66 wcsmbs/tst-wcrtomb.c \ 67 time/tst-posixtz.c 68 69 CFLAGS += -Zomf -g \ 70 -DHAVE_STRNLEN \ 71 -DHAVE_MEMPCPY 72 LDFLAGS += -Zstack 512 48 73 _TARGET_OK := ok 49 74 endif … … 72 97 string/tst-strfry.c 73 98 EXCEPTIONS := \ 74 catgets/test-gencat.c 99 catgets/test-gencat.c 75 100 _TARGET_OK := ok 76 101 CFLAGS += -I sysdeps/unix/bsd -D__BSD__ … … 85 110 @echo TS=$(TS) 86 111 87 112 88 113 # 89 114 # The test. … … 135 160 136 161 GRP := \ 137 grp/testgrp.c 162 grp/testgrp.c 138 163 # grp/tst_fgetgrent.c 139 164 … … 213 238 libio/tst_wprintf2.c \ 214 239 libio/tst_wscanf.c 215 240 216 241 libio/tst-widetext.c_INPUT = libio/tst-widetext.input 217 242 libio/tst_getwc.c_INPUT = libio/tst_getwc.input … … 240 265 malloc/tst-valloc.c 241 266 # malloc/tst-mtrace.c 242 # malloc/tst-mtrace.sh 267 # malloc/tst-mtrace.sh 243 268 244 269 MATH := \ … … 260 285 math/test-tgmath.c \ 261 286 math/tst-definitions.c 262 # math/atest-exp2.c 263 # math/atest-sincos.c 264 # math/atest-exp.c 287 # math/atest-exp2.c 288 # math/atest-sincos.c 289 # math/atest-exp.c 265 290 # math/gen-libm-test.pl 266 291 $(foreach t,$(MATH),$(eval $(t)_LDFLAGS := -lm)) … … 369 394 # posix/tst-sysconf.c - too new? 370 395 # todo: 371 # posix/wordexp-test.c 372 # posix/wordexp-tst.sh 373 # posix/globtest.c 374 # posix/globtest.sh 375 # posix/tst-getconf.sh 396 # posix/wordexp-test.c 397 # posix/wordexp-tst.sh 398 # posix/globtest.c 399 # posix/globtest.sh 400 # posix/tst-getconf.sh 376 401 377 402 posix/tst-fnmatch.c_INPUT = posix/tst-fnmatch.input … … 387 412 posix/bug-glob1.c_ARGS = "$(OBJDIR)/posix/" 388 413 posix/tst-execvp3.c_ARGS = --test-dir="$(OBJDIR)/posix/" 389 414 390 415 391 416 PWD := \ … … 444 469 stdio-common/tstgetln.c_INPUT = stdio-common/tstgetln.input 445 470 stdio-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 471 # stdio-common/tst-printf.c 472 # stdio-common/tst-printf.sh 473 # stdio-common/tst-unbputc.c 474 # stdio-common/tst-unbputc.sh 450 475 451 476 STDLIB := \ … … 474 499 stdlib/testdiv.c 475 500 # todo: 476 # stdlib/tst-fmtmsg.c 501 # stdlib/tst-fmtmsg.c 477 502 # stdlib/tst-fmtmsg.sh 478 503 # stdlib/tst-putenvmod.c … … 611 636 # 612 637 # Generate test rules 613 # 638 # 614 639 _TESTS := 615 640 … … 617 642 define def_simple 618 643 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 $$@`" 644 $(OUTDIR)/$2.result: $1 $(OUTDIR)/$(dir $1).dir_created $($(1)_DEPS) 645 @echo "########## $1"; \ 646 echo "## BUILDING: $$(CC) $$(CFLAGS) -o $(OUTDIR)/$2.exe $($(1)_CFLAGS) $($(1)_LDFLAGS) $$<"; \ 647 if $$(CC) $$(CFLAGS) -o $(OUTDIR)/$2.exe $($(1)_CFLAGS) $($(1)_LDFLAGS) $$<; then \ 648 echo "## RUNNING : LC_ALL=C $($1_ENVS) $(OUTDIR)/$2.exe $($1_ARGS) $(if $($(1)_INPUT), < $($(1)_INPUT),)"; \ 649 if LC_ALL=C $($1_ENVS) $(OUTDIR)/$2.exe $($1_ARGS) $(if $($(1)_INPUT), < $($(1)_INPUT),); then\ 650 echo OK > $$@; \ 651 printf "########## %-26s - SUCCESS\n" "$1"; \ 652 else \ 653 echo "## rc=$$$$?"; \ 654 printf "########## %-26s - $(if $(filter $1,$(EXPECTED)),EXPECTED FAILURE,FAILURE)\n" "$1"; \ 655 echo "$(if $(filter $1,$(EXPECTED)),EXPECTED,FAILURE)" > $$@; \ 656 fi \ 657 else \ 658 echo "## rc=$$$$? "; \ 659 echo "## $$(CC) $$(CFLAGS) -o $(OUTDIR)/$2.exe $($(1)_CFLAGS) $($(1)_LDFLAGS) $$<"; \ 660 printf "########## %-26s - BUILD FAILURE\n" "$1"; \ 661 echo "FAILURE - $$(CC) $$(CFLAGS) -o $(OUTDIR)/$2.exe $($(1)_CFLAGS) $($(1)_LDFLAGS) $$<" > $$@; \ 662 fi 663 664 $2: $(OUTDIR)/$2.result 665 @ 627 666 628 667 _TESTS += $(OUTDIR)/$2.result … … 633 672 define def_skipped 634 673 $(OUTDIR)/$2.result: 635 @ echo "* SKIPPING : $1"636 @echo "SKIPPED" > $$@674 @printf "########## %-26s - SKIPPED\n" "$1"; \ 675 echo "SKIPPED" > $$@ 637 676 638 677 _TESTS += $(OUTDIR)/$2.result … … 656 695 @echo " SUCCESS : `cat /dev/null $$^ | grep OK | wc -l`" 657 696 @echo " SKIPPED : `cat /dev/null $$^ | grep SKIPPED | wc -l`" 697 @echo " EXPECTED: `cat /dev/null $$^ | grep EXPECTED | wc -l`" 658 698 @echo " FAILURES: `cat /dev/null $$^ | grep FAILURE | wc -l`" 659 699 … … 664 704 665 705 666 # 667 # generate directory rules 706 # 707 # generate directory rules 668 708 # 669 709 define def_dir 670 710 $1.dir_created: 671 mkdir -p $1672 echo > $$@711 @mkdir -p $1 712 @echo > $$@ 673 713 endef 674 714 … … 679 719 # 680 720 # All tests (expect the ones in the next sections). 681 # 721 # 682 722 tests: $(_TESTS) 683 723 @echo "***************" 684 724 @echo " SUCCESS : `cat /dev/null $^ | grep OK | wc -l`" 685 725 @echo " SKIPPED : `cat /dev/null $^ | grep SKIPPED | wc -l`" 726 @echo " EXPECTED: `cat /dev/null $^ | grep EXPECTED | wc -l`" 686 727 @echo " FAILURES: `cat /dev/null $^ | grep FAILURE | wc -l`" 687 728 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/string/test-string.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r2075 r2076 25 25 long test; 26 26 } impl_t; 27 28 #ifdef __EMX__ /* aout based */ 29 #include <stdint.h> 30 extern uintptr_t __impls__; 31 asm (".stabs \"___impls__\", 21, 0, 0, 0xffffffff"); 32 33 #define IMPL(name, test) \ 34 impl_t tst_ ## name = { #name, (void (*) (void))name, test }; \ 35 asm (".stabs \"___impls__\", 25, 0, 0, _tst_" #name); 36 #else 27 37 extern impl_t __start_impls[], __stop_impls[]; 28 29 38 #define IMPL(name, test) \ 30 39 impl_t tst_ ## name \ 31 40 __attribute__ ((section ("impls"), aligned (sizeof (void *)))) \ 32 41 = { #name, (void (*) (void))name, test }; 42 #endif 33 43 34 44 #ifdef TEST_MAIN … … 70 80 return psz - psz2; 71 81 } 72 #endif 82 #endif 73 83 74 84 … … 124 134 (* (proto_t) (impl)->fn) (__VA_ARGS__) 125 135 136 #ifdef __EMX__ 137 #define FOR_EACH_IMPL(impl, notall) \ 138 for (uintptr_t *_ptrfirst = __impls__ == -1 ? &__impls__ - 1 : &__impls__; \ 139 _ptrfirst; \ 140 _ptrfirst = NULL) \ 141 for (uintptr_t *_ptr = *_ptrfirst == -2 ? _ptrfirst + 1 : _ptrfirst + 2; \ 142 _ptr && *_ptr != NULL; \ 143 _ptr = *_ptrfirst == -2 /* emxomf */ || (_ptr - _ptrfirst < *_ptrfirst /* a.out */ ) ? _ptr + 1 : NULL) \ 144 for (impl_t *impl = *(impl_t **)_ptr; impl; impl = NULL) \ 145 if (!notall || impl->test) 146 #else 126 147 #define FOR_EACH_IMPL(impl, notall) \ 127 148 for (impl_t *impl = __start_impls; impl < __stop_impls; ++impl) \ 128 149 if (!notall || impl->test) 150 #endif 129 151 130 152 #define HP_TIMING_BEST(best_time, start, end) \ … … 146 168 page_size = MIN_PAGE_SIZE; 147 169 #endif 170 #ifdef HAVE_MMAP 148 171 buf1 = mmap (0, 2 * page_size, PROT_READ | PROT_WRITE, 149 172 MAP_PRIVATE | MAP_ANON, -1, 0); 150 173 if (buf1 == MAP_FAILED) 151 174 error (EXIT_FAILURE, errno, "mmap failed"); 175 #else 176 buf1 = memalign (getpagesize (), 2 * page_size); 177 if (!buf1) 178 error (EXIT_FAILURE, errno, "memalign failed"); 179 #endif 152 180 if (mprotect (buf1 + page_size, page_size, PROT_NONE)) 153 181 error (EXIT_FAILURE, errno, "mprotect failed"); 182 #ifdef HAVE_MMAP 154 183 buf2 = mmap (0, 2 * page_size, PROT_READ | PROT_WRITE, 155 184 MAP_PRIVATE | MAP_ANON, -1, 0); 156 185 if (buf2 == MAP_FAILED) 157 186 error (EXIT_FAILURE, errno, "mmap failed"); 187 #else 188 buf2 = memalign (getpagesize (), 2 * page_size); 189 if (!buf2) 190 error (EXIT_FAILURE, errno, "memalign failed"); 191 #endif 158 192 if (mprotect (buf2 + page_size, page_size, PROT_NONE)) 159 193 error (EXIT_FAILURE, errno, "mprotect failed"); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/string/tst-strxfrm.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r2075 r2076 6 6 7 7 8 char const string[] = "";9 10 11 8 static int 12 test (const char *locale )9 test (const char *locale, const char *string) 13 10 { 14 11 size_t bufsize; … … 18 15 #ifdef HAVE_NEWLOCALE 19 16 locale_t loc; 20 #endif 17 #endif 21 18 int result = 0; 22 19 … … 55 52 56 53 freelocale (loc); 57 #endif 54 #endif 58 55 59 56 free (buf); … … 68 65 int result = 0; 69 66 70 result |= test ("C"); 71 #ifdef __BSD__ /* bsd is missing the aliases. loosers. */ 72 result |= test ("en_US.ISO8859-1"); 67 result |= test ("C", ""); 68 result |= test ("C", "abcABCxyzXYZ|+-/*(%$"); 69 #ifdef __BSD__ /* BSD is missing the aliases. loosers. */ 70 result |= test ("en_US.ISO8859-1", ""); 71 result |= test ("en_US.ISO8859-1", "abcABCxyzXYZ|+-/*(%$"); 73 72 #else 74 result |= test ("en_US.ISO-8859-1"); 75 #endif 76 result |= test ("de_DE.UTF-8"); 73 result |= test ("en_US.ISO-8859-1", ""); 74 result |= test ("en_US.ISO-8859-1", "abcABCxyzXYZ|+-/*(%$"); 75 #endif 76 result |= test ("de_DE.UTF-8", ""); 77 result |= test ("de_DE.UTF-8", "abcABCxyzXYZ|+-/*(%$"); 77 78 78 79 return result; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/sysdeps/i386/i686/hp-timing.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r2075 r2076 27 27 #include <stdio-common/_itoa.h> 28 28 #else 29 #ifdef __EMX__ 30 #include <stdlib.h> 31 #else 29 32 extern char *_itoa(int, char *, int, int); 30 #endif 33 #endif 34 #endif 31 35 32 36 /* The macros defined here use the timestamp counter in i586 and up versions -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/test-skeleton.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r2075 r2076 50 50 char q_data[1]; 51 51 }; 52 #endif 52 #endif 53 53 54 54 /* The test function is normally called `do_test' and it is called … … 220 220 #if 0 /* bird */ 221 221 mallopt (M_PERTURB, 42); 222 #endif 222 #endif 223 223 224 224 #ifdef STDOUT_UNBUFFERED … … 321 321 data_limit.rlim_max); 322 322 if (setrlimit (RLIMIT_DATA, &data_limit) < 0) 323 #ifndef __EMX__ 323 324 perror ("setrlimit: RLIMIT_DATA"); 325 #else 326 ; 327 #endif 324 328 } 325 329 else -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/time/tst-strptime.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2075 r2076 47 47 { "en_US.ISO-8859-1", "2000-01-01 08:12:21 PM", "%Y-%m-%d %I:%M:%S %p", 48 48 6, 0, 0, 1 }, 49 #ifndef __EMX__ /* locale mismatch */ 49 50 { "ja_JP.EUC-JP", "2001 20 \xb7\xee", "%Y %U %a", 1, 140, 4, 21 }, 50 51 { "ja_JP.EUC-JP", "2001 21 \xb7\xee", "%Y %W %a", 1, 140, 4, 21 }, 52 #endif 51 53 }; 52 54 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/libctests/glibc/wctype/test_wctype.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r2075 r2076 21 21 #include <stdlib.h> 22 22 #include <wctype.h> 23 #include <locale.h> 23 24 24 int 25 main (int argc, char *argv[]) 25 int do_tests() 26 26 { 27 27 int result = 0; … … 49 49 #define TEST(test) \ 50 50 do \ 51 52 53 54 55 56 57 58 59 60 61 62 63 64 51 { \ 52 if ((is##test (ch) == 0) != (iswctype (ch, bit_##test) == 0)) \ 53 { \ 54 printf ("`iswctype' class `%s' test " \ 55 "for character \\%o failed\n", #test, ch); \ 56 result = 1; \ 57 } \ 58 if ((is##test (ch) == 0) != (isw##test (ch) == 0)) \ 59 { \ 60 printf ("`isw%s' test for character \\%o failed\n", \ 61 #test, ch); \ 62 result = 1; \ 63 } \ 64 } \ 65 65 while (0) 66 66 … … 77 77 TEST (xdigit); 78 78 } 79 return result; 80 } 79 81 82 int 83 main (int argc, char *argv[]) 84 { 85 int result = do_tests(); 86 /* bird: test switching back and forth makes any difference. */ 87 setlocale (LC_CTYPE, "en_US"); 88 setlocale (LC_CTYPE, "en_US.UTF-8"); 89 setlocale (LC_CTYPE, "en_US.UTF8"); 90 setlocale (LC_CTYPE, "de_DE"); 91 setlocale (LC_CTYPE, "de_DE.UTF-8"); 92 setlocale (LC_CTYPE, "no_NO"); 93 if (!setlocale (LC_CTYPE, "C")) 94 { 95 puts ("setlocale(LC_CTYPE, C) failed!"); 96 result |= 1; 97 } 98 result |= do_tests(); 80 99 if (result == 0) 81 100 puts ("All test successful!"); -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.