This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

apply gnulib test suite to glibc


Hi,

In his presentation [1] Carlos O'Donell writes:
  "Current testsuite is very minimal"

GNU gnulib has a growing test suite of POSIX and glibc headers and functions.
Currently it covers ca. 40 header files and ca. 280 functions. (List below.)
These tests are known to pass on glibc platforms with 6 different CPU types,
as well as on major Unix systems (from Mac OS X to Cygwin), modulo platform
specific bugs on these non-glibc systems.

In several cases this test suite has already uncovered glibc bugs or Linux
kernel bugs.

The tests are generally written according to the POSIX standard. Many
tested behaviours are also "common sense". Only few tests could be
characterized as "hairy".

I can recommend the GNU gnulib test suite to anyone who is about to
release a libc (or OS with a libc), as a sanity check.

The procedure to run it is:
  1. On a development machine (a machine with GNU tools), checkout GNU gnulib
     <https://savannah.gnu.org/projects/gnulib>
     and run
     $ ./gnulib-tool --create-testdir --dir=/tmp/testdir \
                     --with-tests --single-configure \
                     `./posix-modules`
  2. Copy the /tmp/testdir directory to the target machine, if it is a
     different machine.
  3. In /tmp/testdir, run
     $ ./configure CPPFLAGS="-Wall"
     $ make
     Verify that Gnulib has built no replacement/workaround code
     (gllib/*.o files) - if so, this indicates problems in the libc.
     $ make check

What do you think of it? Could it become part of the pre-release testing
of Glibc to apply this test suite? Would it make sense for some of the
tests to be copied to Glibc? (The tests are copyright-assigned to the
FSF already.) I am open to suggestions and collaboration.

          Bruno


Header files:
<arpa_inet.h>
<ctype.h>
<dirent.h>
<fcntl.h>
<float.h>
<inttypes.h>
<langinfo.h>
<locale.h>
<math.h>
<netdb.h>
<netinet/in.h>
<poll.h>
<sched.h>
<signal.h>
<spawn.h>
<stdalign.h>
<stdbool.h>
<stddef.h>
<stdint.h>
<stdio.h>
<stdlib.h>
<stdnoreturn.h>
<string.h>
<strings.h>
<sys/resource.h>
<sys/select.h>
<sys/socket.h>
<sys/stat.h>
<sys/time.h>
<sys/times.h>
<sys/types.h>
<sys/uio.h>
<sys/utsname.h>
<sys/wait.h>
<termios.h>
<time.h>
<wchar.h>
<wctype.h>

Functions:
_Exit
accept
acos
acosf
acosl
asin
asinf
asinl
atan
atan2
atan2f
atanf
atanl
atexit
bind
btowc
canonicalize
cbrt
cbrtf
cbrtl
ceil
ceilf
ceill
chown
close
connect
copysign
copysignf
copysignl
cos
cosf
cosh
coshf
cosl
dprintf
dup
dup2
duplocale
environ
erf
erfc
errno
exp
exp2
exp2f
exp2l
expf
expl
expm1
expm1f
expm1l
fabs
fabsf
fabsl
faccessat
fchdir
fchmodat
fchownat
fclose
fcntl
fdatasync
fdopen
fdopendir
fflush
ffs
floor
floorf
floorl
fma
fmaf
fmal
fmod
fmodf
fmodl
fnmatch
fopen
fprintf
freopen
frexp
frexpf
frexpl
fseek
fseeko
fstat
fstatat
fsync
ftell
ftello
ftruncate
futimens
getaddrinfo
getcwd
getdelim
getgroups
gethostname
getline
getlogin
getlogin_r
getopt
getpeername
getrusage
getsockname
getsockopt
gettimeofday
glob
grantpt
hypot
hypotf
hypotl
iconv
iconv_open
ilogb
ilogbf
ilogbl
imaxabs
imaxdiv
inet_ntop
inet_pton
ioctl
isatty
isblank
isfinite
isinf
isnan
iswblank
j0
j1
jn
lchown
ldexp
ldexpf
ldexpl
lgamma
link
linkat
listen
localeconv
log
log10
log10f
log10l
log1p
log1pf
log1pl
log2
log2f
log2l
logb
logbf
logbl
logf
logl
lseek
lstat
mbrtowc
mbsinit
mbsnrtowcs
mbsrtowcs
memchr
memcmp
mkdir
mkdirat
mkfifo
mkfifoat
mknod
modf
modff
modfl
nanosleep
nextafter
nl_langinfo
open
openat
pclose
perror
pipe
poll
popen
posix_openpt
posix_spawn
posix_spawn_file_actions_addclose
posix_spawn_file_actions_adddup2
posix_spawn_file_actions_addopen
posix_spawnp
pow
powf
pread
printf
pthread_sigmask
ptsname
pwrite
raise
random
readlink
readlinkat
recv
recvfrom
remainder
remainderf
remainderl
remove
rename
renameat
rint
rintf
rintl
rmdir
round
roundf
roundl
search
select
send
sendto
setenv
setlocale
setsockopt
shutdown
sigaction
signbit
sigpipe
sigprocmask
sin
sinf
sinh
sinhf
sinl
sleep
snprintf
sprintf
sqrt
sqrtf
sqrtl
stat
strerror
strerror_r
strncat
strnlen
strsignal
strstr
strtod
strtoimax
strtol
strtoll
strtoul
strtoull
strtoumax
symlink
symlinkat
tan
tanf
tanh
tanhf
tanl
times
trunc
truncf
truncl
tsearch
ttyname_r
uname
unistd
unlink
unlinkat
unlockpt
unsetenv
utimensat
vdprintf
vfprintf
vprintf
vsnprintf
vsprintf
wcrtomb
wcsnrtombs
wcsrtombs
wcwidth
write
y0
y1
yn

[1] https://events.linuxfoundation.org/images/stories/pdf/lfcs2012_odonell.pdf?a slide 23


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]