summaryrefslogtreecommitdiff
path: root/test/ParseConfig.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-01-05 21:26:41 +0000
committerSteven Knight <knight@baldmt.com>2005-01-05 21:26:41 +0000
commit1344c9c2297d5e0931bfcd15a853b13d8e5caf34 (patch)
treecb64e69f33383e176fded537d24649dda29c566c /test/ParseConfig.py
parentafb25b009ee74ade18a9a5b65e62f2ad5b773739 (diff)
downloadscons-1344c9c2297d5e0931bfcd15a853b13d8e5caf34.tar.gz
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.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/test/ParseConfig.py b/test/ParseConfig.py
index c70bc3cc..1ab27c4f 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")