Test coverage

Inside NPTL source tree


Revision Date Changes
A Apr 05, 2004 Initial release
B Apr 06, 2004 Added new paragraphs for the following items:
  • Added 3 performance tests
  • Added 4 tests from signal subdirectory
  • Added 2 tests from posix subdirectory
C Apr 19, 2004 Added HTML anchors for each test

Go back to Coverage Analysis

Introduction

This analysis is based on a Feb 23, 2004 cvs checkout of the glibc source tree.

The tests are ordered in alphabetical order in each section.

Table of contents

nptl directory tests.

  1. tst-align.c

    CONFORMANCE

    Tests for stack alignment in a pthread_create()'d function.

  2. tst-atfork1.c

    CONFORMANCE

    Tests for functions calls order (prepare, parent, child).

  3. tst-atfork2.c, tst-atfork2mod.c

    CONFORMANCE

    Same as previous, but with a shared object loading inside.

  4. tst-attr1.c

    CONFORMANCE

    Tests for invalid (random) set call parameters with attributes:
        pthread_           : cancelstate - canceltype 
        pthread_attr_      : detachstate - inheritsched - schedpolicy - scope 
        pthread_mutexattr_ : pshared 
        pthread_rwlockattr_: pshared

  5. tst-attr2.c

    CONFORMANCE

    Tests for default values and normal use cases for attributes: 
        pthread_attr_ : detachstate - guardsize - inheritsched - schedpolicy - scope
        
    Tests for invalid parameter for attributes: 
        pthread_attr_ : stack - stacksize

  6. tst-attr3.c

    CONFORMANCE

    Tests the function pthread_getattr_np(). 
    Compares the attribute passed to create and those obtained in the new thread for : 
        pthread_attr_ : (get)affinity_np - (get)detachstate - (get)stack - 
                        (get/set)guardsize - (get)scope - (get)inheritsched. 
        pthread_      : (get)affinity_np

  7. tst-backtrace1.c

    other

    backtrace() of a thread creation.

  8. tst-barrier1.c

    CONFORMANCE

    Light tests for pthread_barrier_init(), pthread_barrier_wait() and 
    pthread_barrier_destroy().

  9. tst-barrier2.c

    CONFORMANCE

    Tests for pthread_barrierattr_(get/set)pshared() (uses a barrier shared between two processes). 
    Check that 1 and only 1 thread gets PTHREAD_BARRIER_SERIAL_THREAD on wait.

  10. tst-barrier3.c

    STRESS

    Tests for multiple threads using the same barrier. 
    Verify whether only one thread returns the serial value. 
    Verify also whether no thread passes the barrier before it should.

  11. tst-barrier4.c

    other

    Tests for pthread_barrier_destroy while some threads are still inside pthread_barrier_wait() 
    (it is not POSIX* mandatory).

  12. tst-basic1.c, tst-oddstacklimit.c

    CONFORMANCE

    Tests for thread creation basics: 
       whether thread pid is the same as parent. 
       whether thread return code is received by parent in join.

  13. tst-basic2.c

    CONFORMANCE

    Tests pthread_equal() and pthread_self().

  14. tst-basic3.c

    CONFORMANCE

    Tests for atexit() 
     (the threads are exiting in same order they were created, parent returns first).

  15. tst-basic4.c

    CONFORMANCE

    Tests for atexit() and signals with waitpid().

  16. tst-basic5.c

    CONFORMANCE

    Tests for pthread_getconcurrency()

  17. tst-basic6.c

    CONFORMANCE

    Tests for environment sharing between threads (working directory).

  18. tst-cancel1.c

    other

    Tests for thread cancelation in pthread_mutex_lock(). This test uses cleanup handlers. 
    Uses non POSIX* extensions.

  19. tst-cancel2.c

    CONFORMANCE

    Tests for cancelation with write() call.

  20. tst-cancel3.c

    CONFORMANCE

    Tests for cancelation with read() call.

  21. tst-cancel4.c

    CONFORMANCE & other

    Tests for cancelation with: 
        read readv write writev sleep usleep nanosleep select pselect poll 
        wait waitpid waitid sigpause sigsuspend sigwait sigwaitinfo sigtimedwait 
        pause accept send recv recvfrom recvmsg open close pread pwrite fsync 
        msync sendto sendmsg creat connect tcdrain msgrcv msgsend

  22. tst-cancel5.c

    Same as tst-cancel4.c

  23. tst-cancel6.c

    other

    Tests for cancelation in fgets().

  24. tst-cancel7.c

    other

    Tests for cancelation in file locking operations and shell commands.

  25. tst-cancel8.c

    CONFORMANCE

    Tests for pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED).

  26. tst-cancel9.c

    other

    Tests for cancelation in printf() (aka. in write()).

  27. tst-cancel10.c

    STRESS - light

    Tests multiple cancelations.

  28. tst-cancel11.c

    CONFORMANCE

    Check whether cleanup handler is called only once. Uses cancelation in read()

  29. tst-cancel12.c, tst-cancel13.c

    CONFORMANCE

    Check cancelation in sem_wait() (before entering and while sleeping).

  30. tst-cancel14.c, tst-cancel15.c

    CONFORMANCE

    Check cancelation in sem_timedwait() (before entering and while sleeping).

  31. tst-cancel16.c

    CONFORMANCE & other

    Tests for cancelation in lockf().

  32. tst-cancel17.c

    CONFORMANCE

    Tests cancelation with asynchonous I/O functions.

  33. tst-cancel18.c

    CONFORMANCE

    Tests cancelation in clock_nanosleep() function.
  34. tst-cancel19.c

    STRESS

    Stresses pthread_setcanceltype().

  35. tst-cancel20.c

    STRESS

    Tests for cancelation in signal handlers.

  36. tst-cancel21.c

    STRESS

    Same as previous with additional fork().

  37. tst-cancel22.c

    CONFORMANCE

    Tests for PTHREAD_CANCEL_DISABLED with nanosleep() call.

  38. tst-cancel23.c

    Same code as previous.

  39. tst-cleanup0.c

    CONFORMANCE

    Tests if cleanup handlers are call in the right order. 
    Also tests the atexit() function.

  40. tst-cleanup1.c

    CONFORMANCE

    Same as previous but inside a thread.

  41. tst-cleanup2.c

    CONFORMANCE

    Tests the signal handling system.

  42. tst-cleanup3.c

    CONFORMANCE

    Tests if the cleanup handlers are called in the right order
        (almost same as tst-cleanup1.c)

  43. tst-cleanup4aux.c, tst-cleanup4.c

    other

    Tests for mixing Linuxthreads and NPTL pthread_cleanup_{push,pop}().

  44. tst-clock1.c

    other

    Tests that symbols definitions are correct.

  45. tst-clock2.c

    CONFORMANCE

    Tests for thread clocks features (pthread_getclockid()...).

  46. tst-cond1.c

    CONFORMANCE

    Basic test of pthread_cond_wait() and pthread_cond_signal().

  47. tst-cond2.c

    CONFORMANCE

    Basic test of pthread_cond_broadcast().

  48. tst-cond3.c

    CONFORMANCE

    Tests whether pthread_cond_wait() returns when not awaken.

  49. tst-cond4.c

    CONFORMANCE

    Tests for PTHREAD_PROCESS_SHARED attribute in conditionnal variable.
    Also tests for correct mutex/conditional variables interactions.

  50. tst-cond5.c

    CONFORMANCE

    Tests for timeout in pthread_cont_timedwait().

  51. tst-cond6.c

    CONFORMANCE

    Same as tst-cond4.c but uses pthread_cond_timedwait() instead of pthread_cond_wait().

  52. tst-cond7.c

    STRESS

    Tests for cancelation in pthread_cond_wait() a hundred times.

  53. tst-cond8.c

    CONFORMANCE

    Tests for ERRORCHECK mutex return value when recursively locked in cleanup handler 
    while cancelation occurs in pthread_cond_wait() and in pthread_cond_timedwait().

  54. tst-cond9.c

    CONFORMANCE

    Tests for return value of pthread_cond_wait() and pthread_cond_timedwait() 
    when called without ownership of the associated mutex.

  55. tst-cond10.c

    STRESS

    Tests for multiple signaling (with multiple waiters) without mutex ownership.

  56. tst-cond11.c

    CONFORMANCE

    Tests for pthread_cond_timedwait() timeout with CLOCK_REALTIME and CLOCK_MONOTONIC.

  57. tst-cond12.c

    CONFORMANCE

    Tests for process shared mutex & conditional variable (pthread_cond_broadcast()). 
    Uses two different calls to mmap().

  58. tst-cond13.c

    CONFORMANCE

    Same as previous but uses pthread_cond_signal().

  59. tst-context1.c

    other

    Tests for getcontext() setcontext() makecontext() and swapcontext() routines.

  60. tst-detach1.c

    CONFORMANCE

    Call of pthread_detach() with an already terminated joinable thread.

  61. tst-dlsym1.c

    STRESS

    Plenty of calls to dlsym(NULL, "invalid").

  62. tst-eintr1.c

    CONFORMANCE & STRESS

    A thread delivers SIGUSR1 continuously, and four other threads
    spend their time creating threads and joining them (one has a handler for SIGUSR1).
    Also checks that pthread_create() does not return EINTR.

  63. tst-eintr2.c

    CONFORMANCE & STRESS

    Same as previous but deals with phread_mutex_{lock,unlock,timedlock}()

  64. tst-eintr3.c

    CONFORMANCE & STRESS

    Three threads are created. The first one is blocked in pthread_mutex_lock(), 
    the second one is blocked in pthread_join() waiting for the first and it has a 
    handler for SIGUSR1, which is sent continuously by the third thread 
    with the pthread_kill() routine.

  65. tst-eintr4.c

    CONFORMANCE

    Checks that pthread_barrier_wait() does not return EINTR.

  66. tst-eintr5.c

    CONFORMANCE & STRESS

    Same as tst-eintr2.c but checks for pthread_cond_{wait,timedwait}().

  67. tst-exec1.c

    CONFORMANCE

    Tests whether a process created with posix_spawn() inherits the correct parent pid.
    This is a simple exec test with only one thread in the parent.

  68. tst-exec2.c

    CONFORMANCE

    Same as previous but with fork() / execl()  calls.
    In the child process, a child threads tries to join the parent thread which exec().

  69. tst-exec3.c

    CONFORMANCE

    Same as previous but exec is called from the child thread.

  70. tst-exec4.c

    CONFORMANCE

    Creates a thread which ignores SIGUSR1 and blocks SIGUSR2.
    This thread then execv() and checks that the signals are still ignored and blocked.

  71. tst-execstack.c, tst-execstack-mod.c

    CONFORMANCE

    Test program for making nonexecutable stacks executable
    on load of a DSO that requires executable stacks.

  72. tst-exit1.c

    CONFORMANCE

    Checks that calling exit() in a thread terminates the whole process (not required by POSIX*).

  73. tst-flock1.c

    CONFORMANCE

    Checks that a thread can lock a file for reading while another thread
    locked it for writting.

  74. tst-flock2.c

    CONFORMANCE

    Checks that file locks are not released on thread exit 
    but are released when the process exits.

  75. tst-fork1.c

    CONFORMANCE

    Creates N threads, each thread calls fork(). The pid information is checked.

  76. tst-fork2.c

    CONFORMANCE

    Checks that a thread inherits correctly his parent's ppid.

  77. tst-fork3.c

    CONFORMANCE

    Very similar to the previous test but with one additional thread 
     (for ppid inheritance testing).

  78. tst-fork4.c

    other

    Test of fork() updating child universe's pthread structures.

  79. tst-join1.c

    CONFORMANCE

    Tests that a child thread can join his parent thread.

  80. tst-join2.c

    CONFORMANCE

    Tests the pthread_tryjoin_np() function, 
    when it shall return an error and when it shall not.
    Tests also that the thread return value is retrieved.

  81. tst-join3.c

    CONFORMANCE

    Tests the pthread_timedjoin_np() function, 
    when it shall return an error and when it shall not.
    Tests also that the thread return value is retrieved.

  82. tst-join4.c

    CONFORMANCE

    Tests for pthread_attr_setdetachstate() and pthread_detach() functions 
    return values.

  83. tst-join5.c

    CONFORMANCE & Stress

    Tests a few times that joining a canceled thread and thread joining itself
    return the correct information.

  84. tst-key1.c

    CONFORMANCE

    Basic testing of pthread_key_create(), pthread_setspecific(), 
    pthread_getspecific() and pthread_key_delete().
    It also tests that pthread_key_delete allows creation of more TSD keys.

  85. tst-key2.c

    CONFORMANCE

    Simple test of TSD keys destructors. 
    It verifies that the destructor is called when needed.

  86. tst-key3.c

    CONFORMANCE

    This tests a feature not required by POSIX*. 
    It checks that the TSD key destructor is called when the thread is cancelled.

  87. tst-key4.c

    STRESS

    This test verifies that a new thread has empty keys values. 
    It creates and destroys some threads. Half of the threads sets the key values and
    the other half reads the key values and check it was initialized with NULL.

  88. tst-kill1.c

    CONFORMANCE

    Sends an uncatched SIGUSR1 to a thread 
    blocked in a pthread_cond_wait() call.

  89. tst-kill2.c

    CONFORMANCE

    It sends SIGUSR1 to a thread for which this signal is masked
    and then it checks that the thread does not terminate due to the signal.

  90. tst-kill3.c

    CONFORMANCE

    Checks that pthread_kill() sends the signal only to the target thread.

  91. tst-kill4.c

    CONFORMANCE

    This test uses some implementation-specific features.
    It sends a signal to a non-existent thread and checks that ESRCH is returned.

  92. tst-kill5.c

    CONFORMANCE

    Sends an inexistant signal to a thread and checks that EINVAL is returned.

  93. tst-kill6.c

    CONFORMANCE & STRESS

    Checks that a thread inherits signal handlers from his parent.
    It also sends a signal to several threads several times.

  94. tst-locale1.c

    other

    Tests that loading the pthread library does not interfere 
    with locale features.

  95. tst-locale2.c

    other

    Tests that loading the pthread library does not interfere 
    with argument parsing features.

  96. tst-mutex1.c

    CONFORMANCE

    This basic test calls pthread_mutex_init(), pthread_mutex_lock(),
    pthread_mutex_unlock(), pthread_mutex_destroy() and checks their return values.

  97. tst-mutex2.c

    CONFORMANCE

    This checks for MUTEX_ERRORCHECK mutexes operations
    detecting the required error cases.

  98. tst-mutex3.c

    CONFORMANCE

    This checks for MUTEX_RECURSIVE mutexes operations
    detecting the required error cases.

  99. tst-mutex4.c

    CONFORMANCE

    This test uses a feature not required by POSIX* (unlocking not done by the owner process).
    Checks that a PROCESS_SHARED mutex is really shared between processes.

  100. tst-mutex5.c

    CONFORMANCE

    Tests the pthread_mutex_timedlock() function.

  101. tst-mutex6.c

    other

    Tests that a normal mutex can deadlock when pthread_mutex_lock() 
    is called twice, and that a signal is caught when the thread is inside a deadlock.

  102. tst-mutex7.c

    STRESS

    Creates 100 threads, then each thread locks and unlocks the mutex 1000 times.

  103. tst-mutex8.c

    CONFORMANCE

    This tests checks some behaviors not required by POSIX*.
    Tests destroying a mutex in several situations with several mutex types.

  104. tst-mutex9.c

    CONFORMANCE

    Tests on a recursive process-shared mutex owned at the time of fork().

  105. tst-once1.c

    CONFORMANCE

    Tests that calling pthread_once() twice in a single thread
    lets the routine execute only once.

  106. tst-once2.c

    STRESS

    100 threads execute a call to pthread_once(), 
    and then check that the routine was called once and only once.

  107. tst-once3.c

    CONFORMANCE

    Tests that canceling a thread which is inside a pthread_once() call 
    acts as if the function had not been called.

  108. tst-once4.c

    STRESS

    Same as previous test, but an additionnal thread 
    calls pthread_once() the second time.

  109. tst-popen1.c

    other

    Tests that a call to popen() does not break 
    the pthread creation features.

  110. tst-raise1.c

    CONFORMANCE

    Tests that raise() returns when the signal handler
    has terminated.

  111. tst-rwlock1.c

    CONFORMANCE

    Tests calling pthread_rwlock_rdlock() twice and
    pthread_rwlock_wrlock() once - from a single thread.

  112. tst-rwlock2.c

    CONFORMANCE

    Tests calling pthread_rwlock_trywrlock() and
    pthread_rwlock_tryrdlock() with read lock and then with write lock taken.

  113. tst-rwlock3.c

    CONFORMANCE

    Tests that calling pthread_rwlock_rdlock() or
    pthread_rwlock_wrlock() after a call to pthread_rwlock_wrlock() 
    returns EDEADLK.

  114. tst-rwlock4.c

    CONFORMANCE

    This test uses a feature not required by POSIX* (unlocking not done by the owner process).
    Checks that a process-shared read-write lock is 
    really shared between processes.

  115. tst-rwlock5.c

    CONFORMANCE

    Checks that threads hung in pthread_mutex_lock() or
    pthread_rwlock_wrlock() are interruptible with signals.

  116. tst-rwlock6.c

    CONFORMANCE

    Tests pthread_rwlock_timedrdlock() with all kinds of locks 
    in situation when it shall return EINVAL, EDEADLK or ETIMEDOUT.

  117. tst-rwlock7.c

    CONFORMANCE

    Same as previous but the rwlocks are locked for reading.

  118. tst-rwlock8.c

    STRESS

    Several threads try to call either pthread_rwlock_rdlock() or 
    pthread_rwlock_wrlock() on a prefer-writer-nonrecursive read-write lock.

  119. tst-rwlock10.c

    STRESS

    Same as previous but with a prefer-reader lock.

  120. tst-rwlock9.c

    STRESS

    Same as tst-rwlock8.c but with
    pthread_rwlock_timedrdlock() and pthread_rwlock_timedwrlock()
    calls (loops when a timeout occurs).

  121. tst-rwlock11.c

    STRESS

    Same as previous but with a prefer-reader lock.

  122. tst-rwlock12.c

    CONFORMANCE

    A process calls pthread_rwlock_wrlock() on a 
    process-shared rwlock, then another process checks that the  
    pthread_rwlock_tryrdlock(), pthread_rwlock_timedrdlock(), 
    pthread_rwlock_trywrlock() and pthread_rwlock_timedwrlock() functions
    fail and return correct error codes.

  123. tst-rwlock13.c

    CONFORMANCE

    Checks that pthread_rwlock_init() prepares the memory for the rwlock.

  124. tst-sched1.c

    CONFORMANCE

    Checks that a thread with PTHREAD_EXPLICIT_SCHED attribute will run.

  125. tst-sem1.c

    CONFORMANCE

    Simple calls to sem_wait(), sem_post() and sem_trywait(),
    with an unamed semaphore.

  126. tst-sem2.c

    CONFORMANCE

    Tests that while blocking in a sem_wait() call, 
    a signal can interrupt the thread (unamed semaphore).

  127. tst-sem3.c

    CONFORMANCE

    Tests the process-shared unamed semaphore feature.

  128. tst-sem4.c

    CONFORMANCE

    Checks that a named semaphore is shared between processes.

  129. tst-sem5.c

    CONFORMANCE

    Tests for timeout in sem_timedwait() with an unamed semaphore.

  130. tst-sem6.c

    CONFORMANCE

    Checks that when a signal occurs, sem_wait() fails
    and errno is set to EINTR.

  131. tst-sem7.c

    CONFORMANCE

    Checks that calling sem_open() with the same name
    and with different flags results in the same address for the semaphore. 
    It also checks that sem_close() can be called more than once.

  132. tst-sem8.c

    CONFORMANCE

    Checks that we can sem_open() and sem_close()
    several times a named semaphore.

  133. tst-sem9.c

    CONFORMANCE

    Same as previous but sem_unlink after each close.

  134. tst-signal1.c

    CONFORMANCE

    Tests sending a SIGINT signal to a process. 
    In this process, the parent thread has a mask on this signal and the child thread has
    registered a handler.
    It also checks that pthread_barrier_initialize() initializes the memory.

  135. tst-signal2.c

    CONFORMANCE

    Same as previous but the child thread calls sigwait()
    to catch the signal.

  136. tst-signal3.c

    STRESS

    Different signals are sent to a process containing different threads.
    Each thread receives a different signal. On completion, it checks that no signal 
    was lost or misdelivered.

  137. tst-signal4.c

    CONFORMANCE

    Tests for calling pthread_sigmask() with a bad first parameter.

  138. tst-signal5.c

    CONFORMANCE

    Checks that a child thread inherits the signal mask from his parent.

  139. tst-signal6.c

    CONFORMANCE

    Checks that an alternative stack specified with
     sigaltstack() is used.

  140. tst-spin1.c

    CONFORMANCE

    Simply calls the spin functions pthread_spin_init(), 
    pthread_spin_lock(), pthread_spin_unlock() and pthread_spin_destroy().

  141. tst-spin2.c

    CONFORMANCE

    This test uses a feature not required by POSIX* (unlocking not done by the owner process).
    Basical test of pthread_spin_trylock() and of process-shared spinlock.

  142. tst-spin3.c

    CONFORMANCE

    Checks that a thread looping on pthread_spin_lock() can catch signals.

  143. tst-stack1.c

    CONFORMANCE

    Tests the feature which allows to specify the stack for a new thread.

  144. tst-stack2.c

    CONFORMANCE

    Tests if it is possible to create a thread with 
    a PTHREAD_STACK_MIN stack size.

  145. tst-stack3.c

    Other

    Tests if pthread_create() and pthread_join() 
    with a user-defined stack do not leak memory.

  146. tst-stdio1.c

    CONFORMANCE

    Tests that flockfile() blocks 
    when another thread previously got the lock.

  147. tst-stdio2.c

    CONFORMANCE

    Tests that a FILE * can be locked with flockfile()
    several times (implicitely or not) within a thread.

  148. tst-sysconf.c

    CONFORMANCE

    Checks that the system does not report a thread number limitation
    through PTHREAD_THREADS_MAX or sysconf(_SC_THREAD_THREADS_MAX).

  149. tst-tls1.c

    other

    Checks that a structure declared with __thread  attribute
    is correctly initialized for each thread and that the values 
    do not interfere from a thread to another.

  150. tst-tls2.c

    CONFORMANCE & STRESS

    Checks the behavior of a function pointer declared 
    with __thread attribute.

  151. tst-tls3.c, tst-tls3mod.c

    CONFORMANCE & STRESS

    Same as previous but a part of the code is in a 
    module dynamicly loaded.

  152. tst-tls4.c, tst-tls4moda.c, tst-tls4modb.c

    CONFORMANCE & STRESS

    More sophisticated test dealing with shared objects 
    dynamicly loaded and variables with __thread attribute.

  153. tst-tls5.c, tst-tls5.h, tst-tls5mod{a,b,c,d,e,f}.c, tst-tls6.sh

    CONFORMANCE

    Checks alignment, overlapping and layout of TLS variables.

  154. tst-tsd1.c

    CONFORMANCE

    Creates a thread specific data key and tests setting and
    getting its value.

  155. tst-tsd2.c

    CONFORMANCE

    Checks that a destructor associated with a key is called 
    on thread termination.

  156. tst-tsd3.c

    CONFORMANCE

    Checks that the destructors are called again until the key value
    is null.

  157. tst-tsd4.c

    other

    Checks that the destructors are called at least
    PTHREAD_DESTRUCTOR_ITERATIONS times and that they are not looping forever 
    (POSIX* says it can loop forever).

  158. tst-umask1.c

    CONFORMANCE

    Checks that the umask() is set for every thread in the process.

  159. tst-unload.c

    other

    Tests for non-unloading of libpthread.

Performance tests.

  1. cond-perf.c

    PERFORMANCE

    This sample allows measurements on conditionnal variables operations.

  2. perf.c

    PERFORMANCE

    Complex benchmark allowing to measure thread creation time and to stress
     some features..

  3. sockperf.c

    PERFORMANCE

    Complex benchmark using sockets and gd (graphics) library.

signal directory tests.

  1. tst-raise.c

    CONFORMANCE

    Basical test of the raise() function.

  2. tst-signal.c

    CONFORMANCE

    Very simple test using raise() and signal().

  3. tst-sigset.c

    CONFORMANCE

    Tests the functions sigemptyset(), sigismember(), sigaddset() 
     and sigdelset().

  4. tst-sigsimple.c

    CONFORMANCE

    Tests for bad parameters in calls to sighold()
     and sigrelse().

posix directory tests.

  1. test-vfork.c

    CONFORMANCE

    Child process created with vfork() calls
    a function then returns. The tests checks the child's return code.

  2. tst-fork.c

    CONFORMANCE

    Tests for features such as PID and files operations after a fork().


* POSIX (R) is a registered trademark of the IEEE