chomp($revision = $ARG{version} || `aesub '\$version' 2>/dev/null` || '0.01');
+chomp($change = $ARG{change} || `aesub '\$change' 2>/dev/null`);
+
@arr = split(/\./, $revision);
@arr = ($arr[0], map {length($_) == 1 ? "0$_" : $_} @arr[1 .. $#arr]);
$revision = join('.', @arr);
# that goes into the archive.
#
-foreach (`aegis -list cf 2>/dev/null`) {
- $seen{"$1\n"}++ if /^source\s+remove\s.*\s(\S+)$/;
+foreach (`aegis -list -unf -c $change cf 2>/dev/null`) {
+ $seen{"$1\n"}++ if /^(?:source|test) remove(?:\s.*)+\s(\S+)$/;
}
eval '@src_files = grep(! $seen{$_}++,
* if the file is not in the change. Look in aesub(5) for more information
* about command substitutions.
*/
-build_command = "cons date='${DAte %Y/%m/%d %H:%M:%S}' developer=${DEVeloper} version=${VERsion}";
+build_command = "cons date='${DAte %Y/%m/%d %H:%M:%S}' developer=${DEVeloper} version=${VERsion} change=${Change}";
/*
* The rules used in the User Guide all remove their targets before
*/
test_command = "python runtest.py -v ${VERsion} ${File_Name}";
+new_test_filename = "test/CHANGETHIS.py";
+
/*
*
*/
},
{
pattern = [ "src/scons/*Tests.py" ];
- body = "${read_file ${source template/test.py abs}}";
+ body = "${read_file ${source template/Tests.py abs}}";
},
{
pattern = [ "src/scons/*.py" ];
body = "${read_file ${source template/file.py abs}}";
},
+ {
+ pattern = [ "test/*.py" ];
+ body = "${read_file ${source template/test.py abs}}";
+ },
];
#
$verfile = SourcePath("version.sgml");
unlink($verfile);
+chmod(0664, $verfile);
open(FILE, ">$verfile") || die "Cannot open '$verfile': $!";
print FILE <<_EOF_;
<!--
class BuilderTestCase(unittest.TestCase):
def test_action(self):
- """Test the simple ability to create a Builder
- and retrieve the supplied action attribute.
+ """Test Builder creation
+
+ Verify that we can retrieve the supplied action attribute.
"""
builder = Builder(action = "foo")
assert builder.action == "foo"
def test_cmp(self):
- """Test simple comparisons of Builder objects.
+ """Test simple comparisons of Builder objects
"""
b1 = Builder(input_suffix = '.o')
b2 = Builder(input_suffix = '.o')
assert b2 != b3
def test_execute(self):
- """Test the ability to execute simple Builders, one
- a string that executes an external command, and one an
- internal function.
+ """Test execution of simple Builder objects
+
+ One Builder is a string that executes an external command,
+ and one is an internal Python function.
"""
cmd = "python %s %s xyzzy" % (act_py, outfile)
builder = Builder(action = cmd)
assert test.read(outfile) == "function\n"
def test_insuffix(self):
- """Test the ability to create a Builder with a specified
- input suffix, making sure that the '.' separator is
- appended to the beginning if it isn't already present.
+ """Test Builder creation with a specified input suffix
+
+ Make sure that the '.' separator is appended to the
+ beginning if it isn't already present.
"""
builder = Builder(input_suffix = '.c')
assert builder.insuffix == '.c'
assert builder.insuffix == '.c'
def test_name(self):
- """Test the ability to create a Builder with a specified
- name.
+ """Test Builder creation with a specified name
"""
builder = Builder(name = 'foo')
assert builder.name == 'foo'
def test_node_class(self):
- """Test the ability to create a Builder that creates nodes
- of the specified class.
+ """Test a Builder that creates nodes of a specified class
"""
class Foo:
pass
assert builder.node_class is Foo
def test_outsuffix(self):
- """Test the ability to create a Builder with a specified
- output suffix, making sure that the '.' separator is
- appended to the beginning if it isn't already present.
+ """Test Builder creation with a specified output suffix
+
+ Make sure that the '.' separator is appended to the
+ beginning if it isn't already present.
"""
builder = Builder(input_suffix = '.o')
assert builder.insuffix == '.o'
class EnvironmentTestCase(unittest.TestCase):
def test_Builders(self):
- """Test the ability to execute simple builders through
- different environment, one initialized with a single
+ """Test Builder execution through different environments
+
+ One environment is initialized with a single
Builder object, one with a list of a single Builder
object, and one with a list of two Builder objects.
"""
pass # XXX
def test_Copy(self):
- """Test the ability to copy a construction Environment.
+ """Test construction Environment copying
+
Update the copy independently afterwards and check that
the original remains intact (that is, no dangling
references point to objects in the copied environment).
assert env1 == env1copy
def test_Dictionary(self):
- """Test the simple ability to retrieve known construction
- variables from the Dictionary and check for well-known
+ """Test retrieval of known construction variables
+
+ Fetch them from the Dictionary and check for well-known
defaults that get inserted.
"""
env = Environment(XXX = 'x', YYY = 'y')
assert env.Dictionary.has_key('BUILDERS')
def test_Environment(self):
- """Test the simple ability to create construction
- Environments. Create two with identical arguments
- and check that they compare the same.
+ """Test construction Environments creation
+
+ Create two with identical arguments and check that
+ they compare the same.
"""
env1 = Environment(XXX = 'x', YYY = 'y')
env2 = Environment(XXX = 'x', YYY = 'y')
pass # XXX
def test_Update(self):
- """Test the ability to update a construction Environment
- with new construction variables after it was first created.
+ """Test updating an Environment with new construction variables
+
+ After creation of the Environment, of course.
"""
env1 = Environment(AAA = 'a', BBB = 'b')
env1.Update(BBB = 'bbb', CCC = 'ccc')
assert env1 != env2
def test_subst(self):
- """Test the ability to substitute construction variables
- into a string. Check various combinations, including
- recursive expansion of variables into other variables.
+ """Test substituting construction variables within strings
+
+ Check various combinations, including recursive expansion
+ of variables into other variables.
"""
env = Environment(AAA = 'a', BBB = 'b')
str = env.subst("%AAA %{AAA}A %BBBB %BBB")
class FSTestCase(unittest.TestCase):
def runTest(self):
- """This test case handles all of the file system node
+ """Test FS (file system) Node operations
+
+ This test case handles all of the file system node
tests in one environment, so we don't have to set up a
complicated directory structure for each test individually.
"""
class NodeTestCase(unittest.TestCase):
def test_build(self):
- """Test the ability to build a node.
+ """Test building a node
"""
node = Node()
node.builder_set(Builder())
assert built_it
def test_builder_set(self):
+ """Test setting a Node's Builder
+ """
node = Node()
b = Builder()
node.builder_set(b)
pass # XXX
def test_current(self):
- """Test the ability to decide if an object is up-to-date
- with different signature values.
+ """Test deciding if an object is up-to-date
+
+ Simple comparison of different "signature" values.
"""
o111 = my_obj(value = '111')
assert not o111.current(scons.Sig.MD5.signature('110'))
pass # XXX
def test_collect(self):
- """Test the ability to collect a sequence of object signatures
- into a new signature value.
+ """Test collecting a list of signatures into a new signature value
"""
o1 = my_obj(value = '111')
o2 = my_obj(value = '222')
pass # XXX
def test_current(self):
- """Test the ability to decide if an object is up-to-date
- with different timestamp values.
+ """Test deciding if an object is up-to-date
+
+ Simple comparison of different timestamp values.
"""
o1 = my_obj(value = 111)
assert scons.Sig.TimeStamp.current(o1, 110)
pass # XXX
def test_collect(self):
- """Test the ability to collect a sequence of object timestamps
+ """Test collecting a list of signatures into a new signature value
into a new timestamp value.
"""
o1 = my_obj(value = 111)
--- /dev/null
+__revision__ = "${subst '^src/scons/' '' $filename} __REVISION__ __DATE__ __DEVELOPER__"
+
+import unittest
-__revision__ = "${subst '^src/scons/' '' $filename} __REVISION__ __DATE__ __DEVELOPER__"
+#!/usr/bin/env python
-from TestCmd import TestCmd
+__revision__ = "$filename __REVISION__ __DATE__ __DEVELOPER__"
+
+import TestCmd
#!/usr/bin/env python
-__revision__ = "test/t0002.py __REVISION__ __DATE__ __DEVELOPER__"
+__revision__ = "test/Program-j.py __REVISION__ __DATE__ __DEVELOPER__"
-from TestCmd import TestCmd
+import TestCmd
-test = TestCmd(program = 'scons.py',
- workdir = '',
- interpreter = 'python')
+test = TestCmd.TestCmd(program = 'scons.py',
+ workdir = '',
+ interpreter = 'python')
test.write('SConstruct', """
env = Environment()
#!/usr/bin/env python
-__revision__ = "test/t0001.t __REVISION__ __DATE__ __DEVELOPER__"
+__revision__ = "test/Program.py __REVISION__ __DATE__ __DEVELOPER__"
-from TestCmd import TestCmd
+import TestCmd
-test = TestCmd(program = 'scons.py', workdir = '', interpreter = 'python')
+test = TestCmd.TestCmd(program = 'scons.py',
+ workdir = '',
+ interpreter = 'python')
test.write('SConstruct', """
env = Environment()
--- /dev/null
+#!/usr/bin/env python
+
+__revision__ = "test/SConscript.py __REVISION__ __DATE__ __DEVELOPER__"
+
+import TestCmd
+
+test = TestCmd.TestCmd(program = 'scons.py',
+ workdir = '',
+ interpreter = 'python')
+
+test.write('SConstruct', """
+import os
+print "SConstruct", os.getcwd()
+Conscript('SConscript')
+""")
+
+# XXX I THINK THEY SHOULD HAVE TO RE-IMPORT OS HERE
+test.write('SConscript', """
+import os
+print "SConscript " + os.getcwd()
+""")
+
+wpath = test.workpath()
+
+test.run(chdir = '.')
+test.fail_test(test.stdout() != ("SConstruct %s\nSConscript %s\n" % (wpath, wpath)))
+
+test.pass_test()
--- /dev/null
+#!/usr/bin/env python
+
+__revision__ = "test/option-f.py __REVISION__ __DATE__ __DEVELOPER__"
+
+import TestCmd
+import os.path
+
+test = TestCmd.TestCmd(program = 'scons.py',
+ workdir = '',
+ interpreter = 'python')
+
+test.subdir('subdir')
+
+subdir_BuildThis = os.path.join('subdir', 'Buildthis')
+
+test.write('SConscript', """
+import os
+print "SConscript " + os.getcwd()
+""")
+
+test.write(subdir_BuildThis, """
+import os
+print "subdir/BuildThis", os.getcwd()
+""")
+
+wpath = test.workpath()
+
+test.run(chdir = '.', arguments = '-f SConscript')
+test.fail_test(test.stdout() != ("SConscript %s\n" % wpath))
+
+test.run(chdir = '.', arguments = '-f ' + subdir_BuildThis)
+test.fail_test(test.stdout() != ("subdir/BuildThis %s\n" % wpath))
+
+test.pass_test()
#!/usr/bin/env python
-__revision__ = "test/t0001.py __REVISION__ __DATE__ __DEVELOPER__"
+__revision__ = "test/option-j.py __REVISION__ __DATE__ __DEVELOPER__"
-from TestCmd import TestCmd
+import TestCmd
import string
import sys
except ImportError:
# if threads are not supported, then
# there is nothing to test
- test.pass_test()
+ TestCmd.no_result()
sys.exit()
-test = TestCmd(program = 'scons.py',
- workdir = '',
- interpreter = 'python')
+test = TestCmd.TestCmd(program = 'scons.py',
+ workdir = '',
+ interpreter = 'python')
test.write('build.py', r"""
import time
+++ /dev/null
-#!/usr/bin/env python
-
-__revision__ = "test/t0001.t __REVISION__ __DATE__ __DEVELOPER__"
-
-from TestCmd import TestCmd
-
-test = TestCmd(program = 'scons.py', workdir = '', interpreter = 'python')
-
-test.write('SConstruct', """
-import os
-print "SConstruct", os.getcwd()
-Conscript('SConscript')
-""")
-
-# XXX I THINK THEY SHOULD HAVE TO RE-IMPORT OS HERE,
-# WHICH THEY DO FOR THE SECOND TEST BELOW, BUT NOT THE FIRST...
-test.write('SConscript', """
-import os
-print "SConscript " + os.getcwd()
-""")
-
-wpath = test.workpath()
-
-test.run(chdir = '.')
-test.fail_test(test.stdout() != ("SConstruct %s\nSConscript %s\n" % (wpath, wpath)))
-
-test.run(chdir = '.', arguments = '-f SConscript')
-test.fail_test(test.stdout() != ("SConscript %s\n" % wpath))
-
-test.pass_test()