Test Policy
There are required and optional (though highly recommended) tests for libraries.
Required
Boost uses an automatic regression test suite which generates HTML compiler status tables. Boost also uses Continuous Integration to ensure these tests are regularly run. Ensure your library testing includes the following:
-
Every Boost library should supply one or more suitable test programs to be exercised by the Boost regression test suite. In addition to the usual compile-link-run tests expecting successful completion, compile-only or compile-and-link-only tests may be performed, and success for the test may be defined as failure of the steps.
-
Test program execution must report errors by returning a non-zero value. They may also write to
stdout
orstderr
, but that output should be relatively brief. Regardless of other output, a non-zero return value is the only way the regression test framework will recognize an error has occurred. Note that test programs to be included in the status tables must compile, link, and run quickly since the tests are executed many times. -
Libraries with time consuming tests should be divided into a fast-execution basic test program for the status tables, and a separate full-coverage test program for exhaustive test cases. The basic test should concentrate on compilation issues so that the status tables accurately reflect the library’s likelihood of correct compilation on a platform.
-
If for any reason the usual test policies do not apply to a particular library, an alternate test strategy must be described and implemented.
-
Authors should supply a Jamfile to drive the regression tests for the library.
Optional
-
Use Boost.Test to create individual test cases and group them into test suites. Then use the library’s test tools for Controlling outputs to verify the expected behavior.
-
For simple cases, you can use the lightweight_test features of Boost.Core.
Protocol for Fixing Bugs or Adding Features
-
Before fixing the bug, or adding the feature, add regression test cases that detect the bug or tests the feature. Sometimes adding one case suggests similar untested cases, and add those too.
-
For bugs, run the regression test and verify that the bug is detected.
-
Now, fix the bug or add the feature.
-
Rerun the full regression tests, as sometimes the change breaks something else.
Snapshots
Snapshots are used for quality control checks, and are posted to the JFrog platform. Because the snapshots represent work-in-process, they may not be suitable for production use.
The Unix tarballs and Windows zipballs are identical except for the line endings exported from Git.
Version | Download |
---|---|
Master branch |
|
Develop branch |
The Git master branch can be checked out from boostorg/boost.