Backed out changeset 1d9301697aa0 (bug 1887752) for causing failures on browser_all_f...
[gecko.git] / docs / nspr / running_nspr_tests.rst
blobd877aecf2d1b97fe9510511ff0b64234a806c0e7
1 Running NSPR tests
2 ==================
4 NSPR has a test suite in the ``mozilla/nsprpub/pr/tests`` directory.
6 By default, we don't build the test programs. Running ``gmake`` in the
7 top-level directory (``mozilla/nsprpub``) only builds the NSPR
8 libraries. To build the test programs, you need to change directory to
9 ``mozilla/nsprpub/pr/tests`` and run ``gmake``. Refer to :ref:`NSPR build
10 instructions` for details.
12 To run the test suite, run the shell script
13 ``mozilla/nsprpub/pr/tests/runtests.sh`` in the directory where the test
14 program binaries reside, for example,
16 .. code::
18     cvs -q co -r NSPR_4_6_6_RTM mozilla/nsprpub
19     mkdir linux.debug
20     cd linux.debug
21     ../mozilla/nsprpub/configure
22     gmake
23     cd pr/tests
24     gmake
25     ../../../mozilla/nsprpub/pr/tests/runtests.sh
27 The output of the test suite looks like this:
29 .. code::
31     NSPR Test Results - tests
33     BEGIN                   Mon Mar 12 11:44:41 PDT 2007
34     NSPR_TEST_LOGFILE       /dev/null
36     Test                    Result
38     accept                  Passed
39     acceptread                      Passed
40     acceptreademu                   Passed
41     affinity                        Passed
42     alarm                   Passed
43     anonfm                  Passed
44     atomic                  Passed
45     attach                  Passed
46     bigfile                 Passed
47     cleanup                 Passed
48     cltsrv                  Passed
49     concur                  Passed
50     cvar                    Passed
51     cvar2                   Passed
52     ...
53     sprintf                 FAILED
54     ...
55     timetest                        Passed
56     tpd                     Passed
57     udpsrv                  Passed
58     vercheck                        Passed
59     version                 Passed
60     writev                  Passed
61     xnotify                 Passed
62     zerolen                 Passed
63     END                     Mon Mar 12 11:55:47 PDT 2007
65 .. _How_to_determine_if_the_test_suite_passed:
67 How to determine if the test suite passed
68 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70 If all the tests reported **Passed** as the results, the test suite
71 passed.
73 What if some of the tests crashed or reported **FAILED** as the results?
74 It doesn't necessarily mean the test suite failed because some of the
75 test programs are known to fail. Until the test failures are fixed, you
76 should run NSPR tests against **a known good version of NSPR on the same
77 platform**, and save the test results as the benchmark. Then you can
78 detect regressions of the new version by comparing its test results with
79 the benchmark.
81 .. _Known_issues:
83 Known issues
84 ~~~~~~~~~~~~
86 Other issues with the NSPR test suite are:
88 #. Some of the test programs test the accuracy of the timeout of NSPR
89    functions. Since none of our operating systems is a real-time OS,
90    such test programs may fail when the test machine is heavily loaded.
91 #. Some tests, such as ``pipepong`` and ``sockpong``, should not be run
92    directly. They will be invoked by their companion test programs
93    (e.g., ``pipeping`` and ``sockping``). This is not an issue if you
94    run ``runtests.sh`` because ``runtests.sh`` knows not to run such
95    test programs directly.