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,
18 cvs -q co -r NSPR_4_6_6_RTM mozilla/nsprpub
21 ../mozilla/nsprpub/configure
25 ../../../mozilla/nsprpub/pr/tests/runtests.sh
27 The output of the test suite looks like this:
31 NSPR Test Results - tests
33 BEGIN Mon Mar 12 11:44:41 PDT 2007
34 NSPR_TEST_LOGFILE /dev/null
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
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
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.