From: g0dil Date: Mon, 6 Apr 2009 10:59:02 +0000 (+0000) Subject: Adapt to latest scons Version X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=a566e80849946339a19ff5cb3ad9522727cf96b9;p=senf.git Adapt to latest scons Version git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1180 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/SConstruct b/SConstruct index df81fac..fb783ec 100644 --- a/SConstruct +++ b/SConstruct @@ -242,7 +242,7 @@ PhonyTarget(env, 'fixlinks', [ 'python doclib/fix-links.py -v -s .svn -s linklint -s debian linklint/errorX.txt linklint/errorAX.txt', ]) -PhonyTarget(env, 'prepare', []) +PhonyTarget(env, 'prepare', [ 'true' ]) PhonyTarget(env, 'valgrind', [ 'find -name .test.bin | while read test; do echo; echo "Running $$test"; echo; valgrind --tool=memcheck --error-exitcode=99 --suppressions=valgrind.sup $$test $BOOSTTESTARGS; [ $$? -ne 99 ] || exit 1; done' diff --git a/senfscons/CompileCheck.py b/senfscons/CompileCheck.py index f1037f6..95358a1 100644 --- a/senfscons/CompileCheck.py +++ b/senfscons/CompileCheck.py @@ -1,5 +1,5 @@ import os, os.path, sys -from cStringIO import StringIO +import tempfile from SCons.Script import * import SCons.Scanner.C @@ -20,13 +20,14 @@ def CompileCheck(target, source, env): tests = scanTests(file(source[0].abspath)) cenv = env.Clone() cenv.Append( CPPDEFINES = { 'COMPILE_CHECK': '' } ) - out = StringIO() + out = tempfile.TemporaryFile() cenv['SPAWN'] = lambda sh, escape, cmd, args, env, pspawn=cenv['PSPAWN'], out=out: \ pspawn(sh, escape, cmd, args, env, out, out) Action('$CXXCOM').execute(target, source, cenv) passedTests = {} delay_name = None - for error in out.getvalue().splitlines(): + out.seek(0) + for error in out.read().splitlines(): elts = error.split(':',2) if len(elts) != 3 : continue filename, line, message = elts diff --git a/senfscons/SENFSCons.py b/senfscons/SENFSCons.py index 8fd7503..58a9841 100644 --- a/senfscons/SENFSCons.py +++ b/senfscons/SENFSCons.py @@ -367,7 +367,7 @@ def Test(env, sources, LIBS = [], OBJECTS = []): if compileTestSources: test.extend(env.CompileCheck(source = compileTestSources)) env.Alias('all_tests', test) - env.Command(env.File('test'), test, []) + env.Command(env.File('test'), test, [ 'true' ]) #env.Alias(env.File('test'), test) @@ -422,7 +422,7 @@ def Objects(env, sources, testSources = None, OBJECTS = []): # Hmm ... here I'd like to use an Alias instead of a file # however the alias does not seem to live in the subdirectory # which breaks 'scons -u test' - env.Command(env.File('test'), test, []) + env.Command(env.File('test'), test, [ 'true' ]) #env.Alias(env.File('test'), test) return objects