summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-06-18 21:34:03 +0000
committerSteven Knight <knight@baldmt.com>2003-06-18 21:34:03 +0000
commit227953151fc2db46ac525c94d5ba585cbf838181 (patch)
tree6f0772d1712c28adb1c6fc926c1de0ccde1aa7f2 /test
parent311058e447522c96a320b81bc8beaca41112c006 (diff)
downloadscons-227953151fc2db46ac525c94d5ba585cbf838181.tar.gz
Fix SConf chdir'ing so it works with CPPPATH and LIBPATH. (David Snopek)
Diffstat (limited to 'test')
-rw-r--r--test/Configure.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/test/Configure.py b/test/Configure.py
index 78558fc5..feaea0bb 100644
--- a/test/Configure.py
+++ b/test/Configure.py
@@ -220,7 +220,7 @@ Checking for C header no_std_c_header.h ... failed
# even if BuildDir is set
reset()
- test.subdir( 'sub' )
+ test.subdir( 'sub', ['sub', 'local'] )
test.write( 'SConstruct', """
opts = Options()
opts.Add('chdir')
@@ -232,18 +232,28 @@ else:
BuildDir( 'build', '.' )
SConscript( 'build/SConscript' )
""")
+ test.write( 'sub/local/local_header.h', "/* Hello World */" )
test.write( 'SConscript', """
SConscript( 'sub/SConscript' )
""")
test.write( 'sub/SConscript', """
+def CustomTest(context):
+ context.Message('Executing Custom Test ... ')
+ ret = context.TryCompile('#include "local_header.h"', '.c')
+ context.Result(ret)
+ return ret
+
env = Environment()
+env.Append( CPPPATH='local' )
import os
env['ENV']['PATH'] = os.environ['PATH']
-conf = Configure( env )
+conf = Configure( env, custom_tests = {'CustomTest' : CustomTest} )
if not conf.CheckCHeader( 'math.h' ):
Exit(1)
if conf.CheckCHeader( 'no_std_c_header.h' ):
Exit(1)
+if not conf.CustomTest():
+ Exit(1)
env = conf.Finish()
env.Program( 'TestProgram', 'TestProgram.c' )
""")
@@ -262,6 +272,7 @@ int main() {
read_str=
"""Checking for C header math.h ... ok
Checking for C header no_std_c_header.h ... failed
+Executing Custom Test ... ok
""")
# first with SConscriptChdir(0)
test.run(stdout = required_stdout, arguments='chdir=no')
@@ -270,7 +281,7 @@ Checking for C header no_std_c_header.h ... failed
test.run(stdout = required_stdout, arguments='chdir=no')
checkFiles( test, [".sconf_temp/.cache", "config.log"] )
- checkLog( test, 'config.log', 3, 1 )
+ checkLog( test, 'config.log', 5, 1 )
shutil.rmtree(test.workpath(".sconf_temp"))
@@ -281,7 +292,7 @@ Checking for C header no_std_c_header.h ... failed
test.run(stdout = required_stdout, arguments='chdir=yes')
checkFiles( test, [".sconf_temp/.cache", "config.log"] )
- checkLog( test, 'config.log', 3, 1 )
+ checkLog( test, 'config.log', 5, 1 )
# 3.1 test custom tests
reset()