SCons Developer's Guidelines
- All SCons software (SCons itself, tests, supporting utilities) will be written to work with Python version 2.7.
- SCons will be tested against Python versions 2.7 and all later versions of 2.x. (As of this writing, SCons does not support Python 3.x.)
- The SCons distribution will be generated by the
- SCons will not require installation of any additional Python modules or packages. All modules or packages used by SCons must either be part of the standard Python 2.7 release or be part of the SCons distribution.
- SCons installation will be atomic, and will install all necessary non-standard modules and/or packages.
- At a minimum, SCons will be tested on Linux and Windows. We will add other platforms as they become available. All tests must be written portably.
- SCons software will be written to a separately-defined set of conventions (variable naming, class naming, etc.). We won't be dogmatic about these, and will use discretion when deciding whether a naming violation is significant enough to require a fix.
- SCons is being developed using the following source code control system(s):
- The main source tree is kept in Mercurial at Bitbucket.
- SVN archive of the source tree is still available at Tigris.
- QMTest is the default driver for all tests. Individual tests are written
using the following infrastructure pieces:
- SCons infrastructure module tests are written using PyUnit.
- Tests of SCons packaging are written using subclasses of the TestCmd.py module.
- Tests of full SCons script functionality are written using subclasses of the TestCmd.py module.
- Development philosophy
In a word (x3): Testing, testing, testing.
We're growing a rich set of regression tests incrementally, while SCons is being developed. The goal is to produce an exceptionally stable, reliable tool of known, verifiable quality right from the start.
A strong set of tests allows us to guarantee that everything works properly even when we have to refactor internal subsystems, which we expect to have to do fairly often as SCons grows and develops. It's also great positive feedback in the development cycle to make a change, see the test(s) work, make another change, see the test(s) work...
- Testing methodology
The specific testing rules we're using for SCons are as follows:
- Every functional change must have one or more new tests, or modify one or more existing tests.
- The new or modified test(s) must pass when run against your new code (of course).
- The new code must also pass all unmodified, checked-in tests (regression tests).
- The new or modified test(s) must fail when run against the currently checked-in code. This verifies that your new or modified test does, in fact, test what you intend it to. If it doesn't, then either there's a bug in your test, or you're writing code that duplicates functionality that already exists.
- Changes that don't affect functionality (documentation changes, code cleanup, adding a new test for existing functionality, etc.) can relax these restrictions as appropriate.
The SCons testing infrastructure is largely in place, and is intended to make writing tests as easy and painless as possible. We will change the infrastructure as needed to continue to make testing even easier, so long as it still does the job.
SCons development uses three (!) testing harnesses, one for unit tests, one for end-to-end functional tests, and one for test execution:
- The infrastructure modules (under the
src/sconssubdirectory) all have individual unit tests that use PyUnit. The naming convention is to append
"Tests"to the module name. For example, the unit tests for the
src/scons/Foo.pymodule can be found in the
- The packaging is tested by test scripts that live in the
src/subdirectory and use a prefix of
- The scons utility itself is tested by end-to-end tests that live in the
test/subdirectory and which use the TestCmd.py infrastructure.
- Execution of these tests will be handled by the QMTest infrastructure, as wrapped by an execution script. Note: The transition to using QMTest is still in progress. The wrapper execution script currently executes the test scripts directly.
The end-to-end tests in the
test/subdirectory are not substitutes for module unit tests. If you modify a module under the
src/scons/subdirectory, you generally mustmodify its
*Tests.pyscript to validate your change. This can be (and probably should be) in addition to a
test/*test of how the modification affects the end-to-end workings of SCons.
- General developer requirements
- All project developers must subscribe to the email@example.com mailing list.
- All project developers should register at Tigris.org and be added to the SCons developer list, this allows tagging developers as owning bugs.
- We will accept patches from developers not actually registered on the project, so long as the patches conform to our normal requirements. Preferrably the patches should come as pull requests on bitbucket.
- Using Mercurial for SCons development