Changeset 2135


Ignore:
Timestamp:
Jul 1, 2005, 6:20:01 AM (20 years ago)
Author:
bird
Message:

libc adjustments / config.

Location:
trunk/src/libctests/glibc
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libctests/glibc/Makefile

    • Property cvs2svn:cvs-rev changed from 1.10 to 1.11
    r2134 r2135  
    3232EXPECTED   :=
    3333_TARGET_OK := ok
    34 CFLAGS     += \
    35     -DHAVE_MCHECK_H \
     34CFLAGS     += -D__GLIBC__ \
    3635        -DHAVE___STRTOD_INTERNAL \
    3736        -DHAVE_ASPRINTF \
     
    5453        posix/bug-ga1.c \
    5554        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 \
    5668        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 \
    5786        \
    5887        pwd/tst-getpw.c \
     
    6695        stdio-common/tst-printfsz.c \
    6796        stdio-common/tst-swprintf.c \
    68         stdio-common/tstgetln.c \
    6997        \
    7098    stdlib/test-a64l.c \
     
    101129        resolv/tst-aton.c \
    102130        posix/bug-glob1.c \
    103         posix/bug-glob2.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
    104141       
    105142# NOTES:       
     
    108145# stdio-common/tst-sscanf.c:            Is doing some thousand separator and internationalization stuff which we don't implement.
    109146# stdio-common/tstscanf.c:                      two cases of sscan working in three different ways depending on glibc, bsd or libc. cool!
    110        
    111 CFLAGS     += -Zomf -g \
     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 \
    112152        -DHAVE_STRNLEN \
    113         -DHAVE_MEMPCPY
     153        -DHAVE_MEMPCPY \
     154        -DHAVE_ASPRINTF \
     155        -DHAVE_GETLINE \
     156        -DHAVE_STRCHRNUL \
     157        -DHAVE_RAWMEMCHR \
     158        -DHAVE_MEMRCHR
    114159LDFLAGS    += -Zstack 512
    115160_TARGET_OK := ok
     161
     162posix/runptests.c_ARGS = 15             # expect 15 errors
    116163endif
    117164
     
    448495       
    449496posix/tstgetopt.c_ARGS = -a -b -cfoobar --required foobar --optional=bazbug --none random --col --color --colour
    450 posix/tst-exec.c_ARGS = -- $(OUTDIR)/posix/tst-exec.exe
    451 posix/tst-spawn.c_ARGS = -- $(OUTDIR)/posix/tst-spawn.exe
    452 posix/tst-dir.c_ARGS = `pwd` `cd $(OUTDIR)/$(posix); pwd` `cd $(OUTDIR)/; pwd` $(OUTDIR)/tst-dir.exe
    453 posix/tst-chmod.c_ARGS = `cd posix/; pwd`
     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
    454501posix/tst-rxspencer.c_ARGS = --utf8 posix/rxspencer/tests
    455 posix/tst-pcre.c_ARGS = posix/PCRE.tests
    456 posix/tst-boost.c_ARGS = posix/BOOST.tests
     502posix/tst-pcre.c_ARGS = $(CURDIR)/posix/PCRE.tests
     503posix/tst-boost.c_ARGS = $(CURDIR)/posix/BOOST.tests
    457504posix/bug-glob1.c_ARGS = "."
    458505posix/tst-execvp3.c_ARGS = --test-dir="."
  • trunk/src/libctests/glibc/posix/bug-glob2.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r2134 r2135  
    2323#include <dirent.h>
    2424#include <glob.h>
    25 #ifdef HAVE_MCHECK_H
    2625#include <mcheck.h>
    27 #endif
    2826#include <stdlib.h>
    2927#include <stdio.h>
     
    270268do_test (void)
    271269{
    272 #ifdef HAVE_MCHECK_H
    273270  mtrace ();
    274 #endif
    275271
    276272  glob_t gl;
     
    299295  globfree (&gl);
    300296
    301 #ifdef HAVE_MCHECK_H
    302297  muntrace ();
    303 #endif
    304298
    305299  return 0;
  • trunk/src/libctests/glibc/posix/bug-regex1.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r2134 r2135  
    1818
    1919  setlocale (LC_ALL, "de_DE.ISO-8859-1");
    20 #ifdef HAVE_FWIDE
    2120  fwide (stdout, -1);
    2221
  • trunk/src/libctests/glibc/posix/runptests.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2134 r2135  
    4343  size_t cnt;
    4444  int errors = 0;
     45  int errors_expected = argc > 1 ? atoi(argv[argc - 1]) : 0;
    4546
    4647  for (cnt = 0; cnt < sizeof (tests) / sizeof (tests[0]); ++cnt)
     
    118119      }
    119120
    120   printf ("\n%Zu tests, %d errors\n", cnt, errors);
     121  printf ("\n%Zu tests, %d errors, expected %d\n", cnt, errors, errors_expected);
    121122
    122   return errors != 0;
     123  return errors != errors_expected;
    123124}
  • trunk/src/libctests/glibc/posix/tst-chmod.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2134 r2135  
    2929#include <unistd.h>
    3030#include <sys/stat.h>
     31
     32#ifndef HAVE_64BIT_FILEIO_TYPES
     33#define stat64 stat
     34#define fstat64 fstat
     35#endif
    3136
    3237
  • trunk/src/libctests/glibc/posix/tst-dir.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2134 r2135  
    2828#include <unistd.h>
    2929#include <sys/stat.h>
     30
     31#ifndef HAVE_64BIT_FILEIO_TYPES
     32#define stat64 stat
     33#define fstat64 fstat
     34#define dirent64 dirent
     35#define readdir64_r readdir_r
     36#define readdir64 readdir
     37#endif
     38#ifdef __EMX__
     39#warning fchdir still not implemented?
     40#define fchdir(fd) (-1)
     41#endif
    3042
    3143
  • trunk/src/libctests/glibc/posix/tst-exec.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2134 r2135  
    142142    {
    143143      if (argc != 4)
    144         error (EXIT_FAILURE, 0, "wrong number of arguments (%d)", argc);
     144        error (EXIT_FAILURE, 0, "wrong number of arguments (%d) argv[0]=%s argv[1]=%s argv[2]=%s argv[3]=%s argv[4]=%s argv[5]=%s argv[6]=%s argv[7]=%s argv[8]=%s",
     145               argc, argc > 0 ? argv[0] : "<null>", argc > 1 ? argv[1] : "<null>", argc > 2 ? argv[2] : "<null>", argc > 3 ? argv[3] : "<null>",
     146               argc > 4 ? argv[4] : "<null>", argc > 5 ? argv[5] : "<null>", argc > 6 ? argv[6] : "<null>", argc > 7 ? argv[7] : "<null>",
     147               argc > 8 ? argv[8] : "<null>");
    145148
    146149      return handle_restart (argv[1], argv[2], argv[3]);
     
    148151
    149152  if (argc != 5)
    150     error (EXIT_FAILURE, 0, "wrong number of arguments (%d)", argc);
     153    error (EXIT_FAILURE, 0, "wrong number of arguments (%d) argv[0]=%s argv[1]=%s argv[2]=%s argv[3]=%s argv[4]=%s",
     154           argc, argc > 0 ? argv[0] : "<null>", argc > 1 ? argv[1] : "<null>", argc > 2 ? argv[2] : "<null>",
     155           argc > 3 ? argv[3] : "<null>", argc > 4 ? argv[4] : "<null>");
    151156
    152157  /* Prepare the test.  We are creating two files: one which file descriptor
  • trunk/src/libctests/glibc/posix/tst-execvp3.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2134 r2135  
    2020{
    2121  int fd = create_temp_file ("testscript", &fname);
     22#if 0
    2223  dprintf (fd, "echo foo\n");
    2324  fchmod (fd, 0700);
    2425  close (fd);
     26#else
     27  FILE *pf = fdopen (fd, "w+");
     28  fprintf (pf, "echo foo\n");
     29  fflush (pf);
     30  fchmod (fd, 0700);
     31  fclose (pf);
     32#endif
    2533}
    2634
  • trunk/src/libctests/glibc/posix/tst-fnmatch.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2134 r2135  
    264264          len = 8;
    265265        }
     266#ifdef FNM_EXTMATCH
    266267      else if (strncasecmp (str, "EXTMATCH", 8) == 0
    267268               && (str[8] == '|' || str[8] == '\0'))
     
    270271          len = 8;
    271272        }
     273#else
     274#warning "FNM_EXTMATCH isn't defined!"
     275#endif
    272276      else
    273277        return -1;
     
    322326      first = 0;
    323327    }
     328#ifdef FNM_EXTMATCH
    324329  if (flags & FNM_EXTMATCH)
    325330    {
     
    329334      first = 0;
    330335    }
     336#else
     337#warning "FNM_EXTMATCH isn't defined!"
     338#endif
    331339  if (cp == buf)
    332340    *cp++ = '0';
  • trunk/src/libctests/glibc/resolv/tst-leaks.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r2134 r2135  
    2121#include <arpa/nameser.h>
    2222#include <resolv.h>
    23 #ifdef HAVE_MCHECK_H
    2423#include <mcheck.h>
    25 #endif
    2624
    2725/* Prototype for our test function.  */
     
    3735  unsigned char buf[256];
    3836
    39 #ifdef HAVE_MCHECK_H
    4037  mtrace();
    41 #endif
    4238
    4339  /* This will allocate some memory, which should be automatically
  • trunk/src/libctests/glibc/resolv/tst-leaks2.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r2134 r2135  
    2020#undef gethostbyname
    2121
    22 #ifdef HAVE_MCHECK_H
    2322#include <mcheck.h>
    24 #endif
    2523#include <netdb.h>
    2624#include <resolv.h>
     
    2927do_test (void)
    3028{
    31 #ifdef HAVE_MCHECK_H
    3229  mtrace ();
    33 #endif
    3430  for (int i = 0; i < 20; ++i)
    3531    {
  • trunk/src/libctests/glibc/stdio-common/test-vfprintf.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r2134 r2135  
    2020
    2121#include <locale.h>
    22 #ifdef HAVE_MCHECK_H
    2322#include <mcheck.h>
    24 #endif
    2523#include <stdint.h>
    2624#include <stdio.h>
     
    4846  int fd;
    4947
    50 #ifdef HAVE_MCHECK_H
    5148  mtrace ();
    52 #endif
    5349
    5450  strcpy (buf, "/tmp/test-vfprintfXXXXXX");
  • trunk/src/libctests/glibc/stdio-common/tstgetln.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2134 r2135  
    1919
    2020#include <stdio.h>
     21#ifdef __GLIBC__
    2122#undef ssize_t
    2223#define ssize_t _IO_ssize_t
     24#endif
    2325
    2426int
Note: See TracChangeset for help on using the changeset viewer.