README for nathanw_sa tests (rev 2, Mon Nov 19 18:36:37 EST 2001)

These tests are the tests I wrote while developing the nathanw_sa
branch; as such, many of them simply exercise the existence of a
feature, without pounding it exhaustively. It also means that they
don't all have an obvious "success/failure" criteria. If there is
specific, exact output that should be generated, it is in a file
called CORRECT. A file called OUTPUT gives a particular output from a
working run; it should help determine whether output is correct.

The Makefile is mostly useful for "make clean".

Cotext tests:

context: Exercises kernel set/getcontext() to implement a loop from 1 to 20.

cu1: Exercises libpthread _set/_getcontext_u to implement a long
     loop. Marginally useful for performance-testing of
     _setcontext_u().
cu2: Exercises libpthread _getcontext_u() vs. kernel setcontext().
cu3: Exercises kernel getcontext() vs. libpthread _setcontext_u().
cu4: Exercises kernel getcontext() vs. kernel setcontext().
cu5: Exercises libc makecontext() and swapcontext().
cu6: Exercixes libc makecontext and libpthread _swapcontext_u().


LWP infrastructure tests

The exact output from these tests depends on how the LWPs get
scheduled, which is not particularly deterministic. Hence, exact
correct output is hard to come by. The OUTPUT files with these tests
should be taken as guides; reordering of lines is usually not a
problem. "Not dumping core or crashing the system" is also important.

lwp0: Test of creating and waiting for a second LWP.
lwp1: Test of creating and waiting for 40 LWPs.
lwp2: Test of creating several LWPs and handling a signal (SIGALRM).
      In addition, pressing control-Z while this test is running
      should generate a line like:
      "Signal being handled in LWP 2. Signal: 18    Code: 0"
lwp3: (Avoid. Tests too many things, unclearly.)      
lwp-exit1: Tests that _lwp_exit() from a single-LWP program works.
lwp-exit2: (Avoid) Tests the behavior of the system when one LWP is
	   suspended and another one exits. There is a MI bug here to
	   this, which is that the resulting process can not be
	   killed.
lwp-exit3: Tests that the first LWP can exit while another one is running.
lwp-suspend1: Tests that a lone LWP can not suspend itself.
	      (For fun, try this on Solaris....)
lwp-suspend2: Tests creating a LWP that starts suspended.


Misc. kernel tests:

timer1: Tests BSD setitimer() interface (one-shot).
timer2: Tests BSD setitimer() interface (repeating).
itimer1: Tests POSIX timer_create() interface (one-shot).
itimer2: Tests POSIX timer_create() interface (repeating).


Scheduler activation infrastructure tests

sa1: (Avoid) I forget what this is supposed to do.
sa2: Tests a single activation upcall (SA_UPCALL_NEWPROC.
sa3: Tests a sequence of upcalls (SA_UPCALL_NEWPROC, SA_UPCALL_BLOCKED)


Thread tests

cond[1-5]: Test condition variable wait and wakeup.

errno1: tests thread-specific errno in libc.
exit1: Test "last pthread out" atexit() handling.
isthreaded1: test of __isthreaded variable in libc being set
	     properly when libpthread is linked in.	   
isthreaded2: test of __isthreaded variable in libc being set
	     properly, and presence of weak mutex functions,
	     when libpthread is *not* linked in.	   
mutex[123]: Test of mutexes.
thread1: Test of creating/running a single thread. Thread ID will vary
	 by platform (at least).
thread2: Test of creating two threads (a sleeper and a spinner)
	 and having them compete with each other for timeslices. Tests
	 thread queue, wakeup, bunch of other stuff. Number of spins
	 (and lines printed) will vary a great deal depending on
	 system speed.
thread3: Test of creating several threads (a sleeper and several
	 spinners) and having them all compete. A more stressful
	 version of thread2. Output is not even consistent from run to
	 run on one machine, based on exact scheduling and timing.

thread4: Test of creating two threads (like thread2) and having a
	 signal interrupt them.  In addition, pressing control-Z while
	 this test is running should generate a output like:

	 Signal handler 1.
	 Signal: 18    Code: 0
	 Signal being handled in thread 0x48270000
