diff options
author | Steven Knight <knight@baldmt.com> | 2001-08-14 11:17:14 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2001-08-14 11:17:14 (GMT) |
commit | 7884cffaf3380a66a999ae8db12e0418f96993c0 (patch) | |
tree | 98d0b177f9b53719dc070c00f52332f653b65049 /src | |
parent | 062cbfc18a81e3b0c4147c4ead7cebff5e18063f (diff) | |
download | SCons-7884cffaf3380a66a999ae8db12e0418f96993c0.zip SCons-7884cffaf3380a66a999ae8db12e0418f96993c0.tar.gz SCons-7884cffaf3380a66a999ae8db12e0418f96993c0.tar.bz2 |
Clean up tests.
Diffstat (limited to 'src')
-rw-r--r-- | src/scons/BuilderTests.py | 34 | ||||
-rw-r--r-- | src/scons/EnvironmentTests.py | 32 | ||||
-rw-r--r-- | src/scons/Node/FSTests.py | 4 | ||||
-rw-r--r-- | src/scons/Node/NodeTests.py | 4 | ||||
-rw-r--r-- | src/scons/Sig/MD5Tests.py | 8 | ||||
-rw-r--r-- | src/scons/Sig/TimeStampTests.py | 7 |
6 files changed, 51 insertions, 38 deletions
diff --git a/src/scons/BuilderTests.py b/src/scons/BuilderTests.py index a749bf2..df585df 100644 --- a/src/scons/BuilderTests.py +++ b/src/scons/BuilderTests.py @@ -30,14 +30,15 @@ outfile = test.workpath('outfile') 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') @@ -47,9 +48,10 @@ class BuilderTestCase(unittest.TestCase): 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) @@ -68,9 +70,10 @@ class BuilderTestCase(unittest.TestCase): 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' @@ -78,15 +81,13 @@ class BuilderTestCase(unittest.TestCase): 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 @@ -94,9 +95,10 @@ class BuilderTestCase(unittest.TestCase): 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' diff --git a/src/scons/EnvironmentTests.py b/src/scons/EnvironmentTests.py index 5d3e1ea..2f13c81 100644 --- a/src/scons/EnvironmentTests.py +++ b/src/scons/EnvironmentTests.py @@ -24,8 +24,9 @@ class Builder: 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. """ @@ -57,7 +58,8 @@ class EnvironmentTestCase(unittest.TestCase): 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). @@ -79,8 +81,9 @@ class EnvironmentTestCase(unittest.TestCase): 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') @@ -89,9 +92,10 @@ class EnvironmentTestCase(unittest.TestCase): 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') @@ -107,8 +111,9 @@ class EnvironmentTestCase(unittest.TestCase): 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') @@ -116,9 +121,10 @@ class EnvironmentTestCase(unittest.TestCase): 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") diff --git a/src/scons/Node/FSTests.py b/src/scons/Node/FSTests.py index afa4340..14b62c2 100644 --- a/src/scons/Node/FSTests.py +++ b/src/scons/Node/FSTests.py @@ -19,7 +19,9 @@ class Builder: 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. """ diff --git a/src/scons/Node/NodeTests.py b/src/scons/Node/NodeTests.py index 92bc195..46292bc 100644 --- a/src/scons/Node/NodeTests.py +++ b/src/scons/Node/NodeTests.py @@ -20,7 +20,7 @@ class Builder: 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()) @@ -30,6 +30,8 @@ class NodeTestCase(unittest.TestCase): assert built_it def test_builder_set(self): + """Test setting a Node's Builder + """ node = Node() b = Builder() node.builder_set(b) diff --git a/src/scons/Sig/MD5Tests.py b/src/scons/Sig/MD5Tests.py index ac43f1b..efcec7f 100644 --- a/src/scons/Sig/MD5Tests.py +++ b/src/scons/Sig/MD5Tests.py @@ -35,8 +35,9 @@ class MD5TestCase(unittest.TestCase): 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')) @@ -50,8 +51,7 @@ class MD5TestCase(unittest.TestCase): 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') diff --git a/src/scons/Sig/TimeStampTests.py b/src/scons/Sig/TimeStampTests.py index aa61af8..4fb1920 100644 --- a/src/scons/Sig/TimeStampTests.py +++ b/src/scons/Sig/TimeStampTests.py @@ -32,8 +32,9 @@ class TimeStampTestCase(unittest.TestCase): 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) @@ -47,7 +48,7 @@ class TimeStampTestCase(unittest.TestCase): 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) |