diff options
author | Steven Knight <knight@baldmt.com> | 2003-06-11 10:30:52 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-06-11 10:30:52 (GMT) |
commit | a4c2fbc5c38a747636544213bd42bdf9b1eada32 (patch) | |
tree | a4f76fb422ec39bb1fbb0f42b1f6f39564c0865c | |
parent | c6f1c79f88056176cc2d1567521177744f79b569 (diff) | |
download | SCons-a4c2fbc5c38a747636544213bd42bdf9b1eada32.zip SCons-a4c2fbc5c38a747636544213bd42bdf9b1eada32.tar.gz SCons-a4c2fbc5c38a747636544213bd42bdf9b1eada32.tar.bz2 |
Fix _concat() documentation, add a test. (Chad Austin)
-rw-r--r-- | doc/man/scons.1 | 21 | ||||
-rw-r--r-- | src/CHANGES.txt | 4 | ||||
-rw-r--r-- | src/engine/SCons/EnvironmentTests.py | 27 |
3 files changed, 45 insertions, 7 deletions
diff --git a/doc/man/scons.1 b/doc/man/scons.1 index eb7594b..d2dd89b 100644 --- a/doc/man/scons.1 +++ b/doc/man/scons.1 @@ -1831,6 +1831,14 @@ and USERNAME. .TP +.RI AlwaysBuild( target ", ...)" +Marks each given +.I target +so that it will always be rebuilt. +Multiple targets can be passed in to a single call to +.BR AlwaysBuild (). + +.TP .RI Precious( target ", ...)" Marks each given .I target @@ -2176,15 +2184,14 @@ SCons also treats as C files. .IP _concat -A function used to produce variables like $_CPPINCFLAGS. It takes six -arguments: a prefix to concatenate onto each element, a list of elements, a -suffix to concatenate onto each element, a dictionary of global variables -for variable interpolation, a list of local variables for variable -interpolation, and an optional function that will be called to transform the list -before concatenation. +A function used to produce variables like $_CPPINCFLAGS. It takes five +arguments: a prefix to concatenate onto each element, a list of +elements, a suffix to concatenate onto each element, an environment +for variable interpolation, and an optional function that will be +called to transform the list before concatenation. .ES -env['_CPPINCFLAGS'] = '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, locals(), globals(), RDirs)} $)', +env['_CPPINCFLAGS'] = '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDirs)} $)', .EE .IP CPPFLAGS diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 0971f96..5ea21d3 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -10,6 +10,10 @@ RELEASE 0.15 - XXX + From Chad Austin: + + - Fix the _concat() documentation, and add a test for it. + From Matt Balvin: - Fix handling of library prefixes when the subdirectory matches diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index d8b4f9d..3da8334 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -544,6 +544,23 @@ class EnvironmentTestCase(unittest.TestCase): assert i.__class__.__name__ == 'File' assert i.path == 'dep.py' + def test_AlwaysBuild(self): + """Test the AlwaysBuild() method""" + env = Environment() + t = env.AlwaysBuild('a', 'b', ['c', 'd']) + assert t[0].__class__.__name__ == 'File' + assert t[0].path == 'a' + assert t[0].always_build + assert t[1].__class__.__name__ == 'File' + assert t[1].path == 'b' + assert t[1].always_build + assert t[2].__class__.__name__ == 'File' + assert t[2].path == 'c' + assert t[2].always_build + assert t[3].__class__.__name__ == 'File' + assert t[3].path == 'd' + assert t[3].always_build + def test_Precious(self): """Test the Precious() method.""" env = Environment() @@ -878,6 +895,16 @@ class EnvironmentTestCase(unittest.TestCase): x = env.get('bbb', 'XXX') assert x == 'XXX', x + def test_concat(self): + "Test _concat()" + e1 = Environment(PRE='pre', SUF='suf', STR='a b', LIST=['a', 'b']) + s = e1.subst + assert s("${_concat('', '', '', __env__)}") == '' + assert s("${_concat('', [], '', __env__)}") == '' + assert s("${_concat(PRE, '', SUF, __env__)}") == '' + assert s("${_concat(PRE, STR, SUF, __env__)}") == 'prea bsuf' + assert s("${_concat(PRE, LIST, SUF, __env__)}") == 'preasuf prebsuf' + def test_FindIxes(self): "Test FindIxes()" env = Environment(LIBPREFIX='lib', |