diff options
author | Steven Knight <knight@baldmt.com> | 2005-01-05 21:26:41 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-01-05 21:26:41 (GMT) |
commit | 7065ee43b7f6828f0f1b91148db074aea759a44d (patch) | |
tree | cb64e69f33383e176fded537d24649dda29c566c /test/ParseConfig.py | |
parent | 0e0a0aeaba0c7f6188370fe08304f807af798a9c (diff) | |
download | SCons-7065ee43b7f6828f0f1b91148db074aea759a44d.zip SCons-7065ee43b7f6828f0f1b91148db074aea759a44d.tar.gz SCons-7065ee43b7f6828f0f1b91148db074aea759a44d.tar.bz2 |
Use AppendUnique() in ParseConfig(). Provide a unique=0 keyword argument in case someone has a reason to need to allow duplicates.
Diffstat (limited to 'test/ParseConfig.py')
-rw-r--r-- | test/ParseConfig.py | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/test/ParseConfig.py b/test/ParseConfig.py index c70bc3c..1ab27c4 100644 --- a/test/ParseConfig.py +++ b/test/ParseConfig.py @@ -30,40 +30,49 @@ import sys import TestCmd import TestSCons +python = TestSCons.python + test = TestSCons.TestSCons() -test_config = test.workpath('test-config') +test_config1 = test.workpath('test-config1') +test_config2 = test.workpath('test-config2') # 'abc' is supposed to be a static lib; it is included in LIBS as a # File node. # It used to be returned as the 'static_libs' output of ParseConfig. -test.write('test-config', """#! /usr/bin/env python +test.write(test_config1, """\ print "-I/usr/include/fum -Ibar -X" print "-L/usr/fax -Lfoo -lxxx abc" """) +test.write(test_config2, """\ +print "-L foo -L lib_dir" +""") + test.write('SConstruct', """ env = Environment(CPPPATH = [], LIBPATH = [], LIBS = [], CCFLAGS = '') -env.ParseConfig([r"%s", r"%s", "--libs --cflags"]) +env.ParseConfig([r"%(python)s", r"%(test_config1)s", "--libs --cflags"]) +env.ParseConfig([r"%(python)s", r"%(test_config2)s", "--libs --cflags"]) print env['CPPPATH'] print env['LIBPATH'] print map(lambda x: str(x), env['LIBS']) print env['CCFLAGS'] -""" % (TestSCons.python, test_config)) +""" % locals()) test.write('SConstruct2', """ env = Environment(CPPPATH = [], LIBPATH = [], LIBS = [], CCFLAGS = '', - PYTHON = '%s') -env.ParseConfig(r"$PYTHON %s --libs --cflags") + PYTHON = '%(python)s') +env.ParseConfig(r"$PYTHON %(test_config1)s --libs --cflags") +env.ParseConfig(r"$PYTHON %(test_config2)s --libs --cflags") print env['CPPPATH'] print env['LIBPATH'] print map(lambda x: str(x), env['LIBS']) print env['CCFLAGS'] -""" % (TestSCons.python, test_config)) +""" % locals()) good_stdout = test.wrap_stdout(read_str = """\ ['/usr/include/fum', 'bar'] -['/usr/fax', 'foo'] +['/usr/fax', 'foo', 'lib_dir'] ['xxx', 'abc'] ['-X'] """, build_str = "scons: `.' is up to date.\n") |