summaryrefslogtreecommitdiffstats
path: root/test/CPPDEFINES
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2010-08-16 23:44:36 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2010-08-16 23:44:36 (GMT)
commita72f6d0b8be807fe1aaa5e2663f0bb865b73cd38 (patch)
tree12fcc289c890a1f03caad8bb861271db4aa6c6f5 /test/CPPDEFINES
parent644700cb7ec169e1e6a856c1c05d63d6022132f1 (diff)
downloadSCons-a72f6d0b8be807fe1aaa5e2663f0bb865b73cd38.zip
SCons-a72f6d0b8be807fe1aaa5e2663f0bb865b73cd38.tar.gz
SCons-a72f6d0b8be807fe1aaa5e2663f0bb865b73cd38.tar.bz2
Fix Windows test failures due to previous commit: skip pkg-config test on Windows, and always use -D for CPPDEFPREFIX for simplicity.
Diffstat (limited to 'test/CPPDEFINES')
-rw-r--r--test/CPPDEFINES/append.py15
-rw-r--r--test/CPPDEFINES/pkg-config.py3
2 files changed, 12 insertions, 6 deletions
diff --git a/test/CPPDEFINES/append.py b/test/CPPDEFINES/append.py
index 92b113c..2dacd8a 100644
--- a/test/CPPDEFINES/append.py
+++ b/test/CPPDEFINES/append.py
@@ -33,20 +33,23 @@ import TestSCons
test = TestSCons.TestSCons()
+# Note: we explicitly set CPPDEFPREFIX here to simplify testing on
+# Windows.
+
test.write('SConstruct', """\
-env_1738_2 = Environment()
+env_1738_2 = Environment(CPPDEFPREFIX='-D')
env_1738_2['CPPDEFINES'] = ['FOO']
env_1738_2.Append(CPPDEFINES={'value' : '1'})
print env_1738_2.subst('$_CPPDEFFLAGS')
#env_1738_2.Object('test_1738_2', 'main.c')
# http://scons.tigris.org/issues/show_bug.cgi?id=2300
-env_2300_1 = DefaultEnvironment(CPPDEFINES = 'foo')
+env_2300_1 = Environment(CPPDEFINES = 'foo', CPPDEFPREFIX='-D')
env_2300_1.Append(CPPDEFINES='bar')
print env_2300_1.subst('$_CPPDEFFLAGS')
#env_2300_1.Object('test_2300_1', 'main.c')
-env_2300_2 = DefaultEnvironment(CPPDEFINES = ['foo']) # note the list
+env_2300_2 = Environment(CPPDEFINES = ['foo'], CPPDEFPREFIX='-D') # note the list
env_2300_2.Append(CPPDEFINES='bar')
print env_2300_2.subst('$_CPPDEFFLAGS')
#env_2300_2.Object('test_2300_2', 'main.c')
@@ -62,12 +65,12 @@ for (t1, c1) in cases:
for (t2, c2) in cases:
print "==== Testing CPPDEFINES, appending a %s to a %s"%(t2, t1)
print " orig = %s, append = %s"%(c1, c2)
- env=Environment(CPPDEFINES = c1)
+ env=Environment(CPPDEFINES = c1, CPPDEFPREFIX='-D')
env.Append(CPPDEFINES = c2)
final=env.subst('$_CPPDEFFLAGS',source="src", target="tgt")
print 'Append: \\n\\tresult=%s\\n\\tfinal=%s'%\\
(env['CPPDEFINES'], final)
- env=Environment(CPPDEFINES = c1)
+ env=Environment(CPPDEFINES = c1, CPPDEFPREFIX='-D')
env.AppendUnique(CPPDEFINES = c2)
final=env.subst('$_CPPDEFFLAGS',source="src", target="tgt")
print 'AppendUnique:\\n\\tresult=%s\\n\\tfinal=%s'%\\
@@ -78,7 +81,7 @@ for (t1, c1) in cases:
expect_print_output="""\
-DFOO -Dvalue=1
-Dfoo -Dbar
--Dfoo -Dbar -Dbar
+-Dfoo -Dbar
==== Testing CPPDEFINES, appending a string to a string
orig = FOO, append = FOO
Append:
diff --git a/test/CPPDEFINES/pkg-config.py b/test/CPPDEFINES/pkg-config.py
index f59b3b0..0656900 100644
--- a/test/CPPDEFINES/pkg-config.py
+++ b/test/CPPDEFINES/pkg-config.py
@@ -32,6 +32,9 @@ import TestSCons
test = TestSCons.TestSCons()
+if not test.where_is('pkg-config'):
+ test.skip_test("Could not find 'pkg-config' in system PATH, skipping test.\n")
+
test.write('bug.pc', """\
prefix=/usr
exec_prefix=${prefix}