summaryrefslogtreecommitdiffstats
path: root/test/CPPDEFINES/pkg-config.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/CPPDEFINES/pkg-config.py')
-rw-r--r--test/CPPDEFINES/pkg-config.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/CPPDEFINES/pkg-config.py b/test/CPPDEFINES/pkg-config.py
index 0656900..1b308d3 100644
--- a/test/CPPDEFINES/pkg-config.py
+++ b/test/CPPDEFINES/pkg-config.py
@@ -32,7 +32,8 @@ import TestSCons
test = TestSCons.TestSCons()
-if not test.where_is('pkg-config'):
+pkg_config_path = test.where_is('pkg-config')
+if not pkg_config_path:
test.skip_test("Could not find 'pkg-config' in system PATH, skipping test.\n")
test.write('bug.pc', """\
@@ -58,7 +59,7 @@ test.write('SConstruct', """\
# http://scons.tigris.org/issues/show_bug.cgi?id=2671
# Passing test cases
env_1 = Environment(CPPDEFINES=[('DEBUG','1'), 'TEST'])
-env_1.ParseConfig('PKG_CONFIG_PATH=. pkg-config --cflags bug')
+env_1.ParseConfig('PKG_CONFIG_PATH=. %(pkg_config_path)s --cflags bug')
print env_1.subst('$_CPPDEFFLAGS')
env_2 = Environment(CPPDEFINES=[('DEBUG','1'), 'TEST'])
@@ -67,7 +68,7 @@ print env_2.subst('$_CPPDEFFLAGS')
# Failing test cases
env_3 = Environment(CPPDEFINES={'DEBUG':1, 'TEST':None})
-env_3.ParseConfig('PKG_CONFIG_PATH=. pkg-config --cflags bug')
+env_3.ParseConfig('PKG_CONFIG_PATH=. %(pkg_config_path)s --cflags bug')
print env_3.subst('$_CPPDEFFLAGS')
env_4 = Environment(CPPDEFINES={'DEBUG':1, 'TEST':None})
@@ -76,10 +77,10 @@ print env_4.subst('$_CPPDEFFLAGS')
# http://scons.tigris.org/issues/show_bug.cgi?id=1738
env_1738_1 = Environment(tools=['default'])
-env_1738_1.ParseConfig('PKG_CONFIG_PATH=. pkg-config --cflags --libs bug')
+env_1738_1.ParseConfig('PKG_CONFIG_PATH=. %(pkg_config_path)s --cflags --libs bug')
env_1738_1.Append(CPPDEFINES={'value' : '1'})
print env_1738_1.subst('$_CPPDEFFLAGS')
-""")
+"""%locals() )
expect_print_output="""\
-DDEBUG=1 -DTEST -DSOMETHING -DVARIABLE=2