home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cvs1107.zip / TESTS < prev    next >
Text File  |  1999-07-12  |  6KB  |  153 lines

  1. To run the tests:
  2.  
  3.     $ make check
  4.  
  5. Note that if your /bin/sh doesn't support shell functions, you'll
  6. have to try something like this, where "/bin/sh5" is replaced by the
  7. pathname of a shell which handles normal shell functions:
  8.  
  9.     $ make SHELL=/bin/sh5 check
  10.  
  11. WARNING:  This test can take quite a while to run, esp. if your
  12. disks are slow or over-loaded.
  13.  
  14. The tests work in /tmp/cvs-sanity (which the tests create) by default.
  15. If for some reason you want them to work in a different directory, you
  16. can set the TESTDIR environment variable to the desired location
  17. before running them.
  18.  
  19. You will probably need GNU expr, which is part of the GNU sh-utils
  20. package.  This is just for running the tests; CVS itself doesn't
  21. require expr.
  22.  
  23. With CVS 1.10 people also had trouble with the Solaris sort program
  24. not behaving the way that the testsuite expects (with Solaris, lines
  25. starting with tabs sort before blank lines).
  26.  
  27. If there is some unexpected output, that is a failure which can be
  28. somewhat hard to track down.  Finding out which test is producing the
  29. output is not always easy.  The newer tests (that is, ones using
  30. dotest*) will not have this problem, but there are many old tests
  31. which have not been converted.
  32.  
  33. If running the tests produces the output "FAIL:" followed by the name
  34. of the test that failed, then the details on the failure are in the
  35. file check.log.  If it says "exit status is " followed by a number,
  36. then the exit status of the command under test was not what the test
  37. expected.  If it says "** expected:" followed by a regular expression
  38. followed by "** got:" followed by some text, then the regular
  39. expression is the output which the test expected, and the text is the
  40. output which the command under test actually produced.  In some cases
  41. you'll have to look closely to see how they differ.
  42.  
  43. If output from "make remotecheck" is out of order compared to what is
  44. expected (for example,
  45.  
  46.    a
  47.    b
  48.    cvs foo: this is a demo
  49.  
  50. is expected and
  51.  
  52.    a
  53.    cvs foo: this is a demo
  54.    b
  55.  
  56. is output), this is probably a well-known bug in the CVS server
  57. (search for "out-of-order" in src/server.c for a comment explaining
  58. the cause).  It is a real pain in running the testsuite, but if you
  59. are lucky and/or your machine is fast and/or lightly loaded, you won't
  60. run into it.  Running the tests again might succeed if the first run
  61. failed in this manner.
  62.  
  63. For more information on what goes in check.log, and how the tests are
  64. run in general, you'll have to read sanity.sh.  Depending on just what
  65. you are looking for, and how familiar you are with the Bourne shell
  66. and regular expressions, it will range from relatively straightforward
  67. to obscure.
  68.  
  69. If you choose to submit a bug report based on tests failing, be
  70. aware that, as with all bug reports, you may or may not get a
  71. response, and your odds might be better if you include enough
  72. information to reproduce the bug, an analysis of what is going
  73. wrong (if you have the time to provide one), etc.  The check.log
  74. file is the first place to look.
  75.  
  76. ABOUT STDOUT AND STDERR
  77. ***********************
  78.  
  79. The sanity.sh test framework combines stdout and stderr and for tests
  80. to pass requires that output appear in the given order.  Some people
  81. suggest that ordering between stdout and stderr should not be
  82. required, or to put it another way, that the out-of-order bug referred
  83. to above, and similar behaviors, should be considered features, or at
  84. least tolerable.  The reasoning behind the current behavior is that
  85. having the output appear in a certain order is the correct behavior
  86. for users using CVS interactively--that users get confused if the
  87. order is unpredictable.
  88.  
  89. ABOUT TEST FRAMEWORKS
  90. *********************
  91.  
  92. People periodically suggest using dejagnu or some other test
  93. framework.  A quick look at sanity.sh should make it clear that there
  94. are indeed reasons to be dissatisfied with the status quo.  Ideally a
  95. replacement framework would achieve the following:
  96.  
  97. 1.  Widely portable, including to a wide variety of unices, NT, Win95,
  98. OS/2, VMS, probably DOS and Win3, etc.
  99.  
  100. 2.  Nicely match extended regular expressions of unlimited length.
  101.  
  102. 3.  Be freely redistributable, and if possible already the kind of
  103. thing people might have already installed.  The harder it is to get
  104. and install the framework, the less people will run the tests.
  105.  
  106. The various contenders are:
  107.  
  108. * Bourne shell and GNU expr (the status quo).  Falls short on #1
  109. (we've only tried unix and NT, although MKS might help with other DOS
  110. mutants).  #3 is pretty good (the main dependency is GNU expr which is
  111. fairly widely available).
  112.  
  113. * Bourne shell with a new regexp matcher we would distribute with
  114. CVS.  This means maintaining a regexp matcher and the makefiles which
  115. go with it.  Not clearly a win over Bourne shell and GNU expr.
  116.  
  117. * Bourne shell, and use sed to remove variable portions of output, and
  118. thus produce a form that can be compared with cmp or diff (this
  119. sidesteps the need for a full regular expression matcher as mentioned
  120. in #2 above).  The C News tests are said to work this way.  This would
  121. appear to rely on variable portions of output having a certain syntax
  122. and might spuriously recognize them out of context (this issue needs
  123. more investigation; it isn't clear how big a problem it is in
  124. practice).  Same portability issues as the other choices based on the
  125. Bourne shell.
  126.  
  127. * Dejagnu.  This is overkill; most of dejagnu is either unnecessary
  128. (e.g. libraries for communicating with target boards) or undesirable
  129. (e.g. the code which stats every file in sight to find the tests).  On
  130. the plus side, dejagnu is probably closer than any of the other
  131. choices to having everything which is needed already there.
  132.  
  133. * Write our own small framework directly in tcl and distribute with
  134. CVS.  The tests would look much like dejagnu tests, but we'd avoid the
  135. unnecessary baggage.  The only dependency would be on tcl (that is,
  136. wish).
  137.  
  138. * perl or python or <any other serious contenders here?>
  139.  
  140. It is worth thinking about how to:
  141.  
  142. a.  include spaces in arguments which we pass to the program under
  143. test (sanity.sh dotest cannot do this; see test rcs-9 for a
  144. workaround).
  145.  
  146. b.  pass stdin to the program under test (sanity.sh, again, handles
  147. this by bypassing dotest).
  148.  
  149. c.  have a send-expect type dialog with the program under test
  150.     (e.g. see server-7 or pserver-4 which want to talk the CVS
  151.     protocol, or the many tests which need to answer the prompt of "cvs
  152.     release", e.g. deep-5).
  153.