Tests
=====

.. mps:prefix:: design.mps.tests


Introduction
------------

:mps:tag:`intro` This document contains a guide to the Memory Pool System
tests.

:mps:tag:`readership` This document is intended for any MPS developer.


Smoke tests
-----------

:mps:tag:`smoke` The "smoke tests" provide quick checks that the MPS is
working. They run quickly enough for it to be practical to run them
every time the MPS is built.

:mps:tag:`randomize` Each time a test case is run, it randomly chooses some
of its parameters (for example, the sizes of objects, or how many
links to create in a graph of references). This allows a fast test
to cover many cases over time.

:mps:tag:`randomize.repeatable` The random numbers are chosen
pseudo-randomly based on a seed initialized from environmental data
(the time and the processor cycle count). The seed is reported at test
startup. Each test can be run with a specified seed. This ensures
that the deterministic tests are repeatable.


Smoke test list
...............

:mps:tag:`test.finalcv` Registers objects for finalization, makes them
unreachable, deregisters them, etc. Churns to provoke minor (nursery)
collection.

:mps:tag:`test.finaltest` Creates a large binary tree, and registers every
node. Drops the top reference, requests collection, and counts the
finalization messages.

:mps:tag:`test.zcoll` Collection scheduling, and collection feedback.

:mps:tag:`test.zmess` Message lifecycle and finalization messages.