Make testall test what's in the current folder, not `dirname $0`.

This is so that it can be called directly from masterfiles.
Export variables to tests so we can find the enterprise plugin.
Redmine#1900: test basic template and trailing newline
Merge pull request #1289 from ediosyncratic/promise-fix

Correction to: Record which promise set each variable.
Merge pull request #1300 from tzz/test/readmine1900-cftemplate-newlines

Redmine#1900: test basic template and trailing newline
Merge pull request #1309 from kacfengine/testall_fixes

Testall fixes
Redmine#3184: acceptance test for editing immutable files
Test relative as well as absolute for paths.

This reduces the number of failures on fixing constancy; it also makes
the code more symmetric between relative and absolute paths.  (It
should, however, probably separate windows and !windows variants.)

Technically, if paths_absolute() gets invoked while the effects of
paths_init() haven't yet taken place (as currently happens on the
first convergence pass), filename_absolute isn't set (even when the
filename is absolute) simply becaus it isn't set *yet*; which leads to
input_file getting set *as if* the filename were relative, when it's
actually absolute.  A later pass, naturally, sees it absolute; but we
really shouldn't be allowing input_file to take the wrong value during
the first pass, even if any ill-effects of that shall be purged once
input_file's values has (contentiously) been over-written.  With this
fix, conditioning only positively on classes, input_file doesn't get
set until paths_init() has taken effect, one way or the other.
Regression test for RedMine ticket 1492.

Set a variable twice.  Do this for variables with explicit policy
constant, with default policy (which should be constant) and with
policy free.  Check that the first two retain the first-set value,
the last gets reset.
Implement constant-by-default for variable policy.

If no policy is specified, treat variable as constant.
Only modify variables when their policy permits us to.

If a variable's policy is constant we shouldn't overwrite its prior
value.  Fixes constancy.cf acceptance test, but breaks a few dozen
others.
Enabled constancy test, regression test for RedMine 1492.

Note that further testing is needed (once we can solve the problem
that fixing even this test breaks a few dozen others).  See the
RedMine ticket for further discussion.