Skip to content
Snippets Groups Projects
Commit 355e80dd authored by g0dil's avatar g0dil
Browse files

Adapt to latest scons Version

parent 1485aeb2
No related branches found
No related tags found
No related merge requests found
...@@ -242,7 +242,7 @@ PhonyTarget(env, 'fixlinks', [ ...@@ -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', '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', [ 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' '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'
......
import os, os.path, sys import os, os.path, sys
from cStringIO import StringIO import tempfile
from SCons.Script import * from SCons.Script import *
import SCons.Scanner.C import SCons.Scanner.C
...@@ -20,13 +20,14 @@ def CompileCheck(target, source, env): ...@@ -20,13 +20,14 @@ def CompileCheck(target, source, env):
tests = scanTests(file(source[0].abspath)) tests = scanTests(file(source[0].abspath))
cenv = env.Clone() cenv = env.Clone()
cenv.Append( CPPDEFINES = { 'COMPILE_CHECK': '' } ) cenv.Append( CPPDEFINES = { 'COMPILE_CHECK': '' } )
out = StringIO() out = tempfile.TemporaryFile()
cenv['SPAWN'] = lambda sh, escape, cmd, args, env, pspawn=cenv['PSPAWN'], out=out: \ cenv['SPAWN'] = lambda sh, escape, cmd, args, env, pspawn=cenv['PSPAWN'], out=out: \
pspawn(sh, escape, cmd, args, env, out, out) pspawn(sh, escape, cmd, args, env, out, out)
Action('$CXXCOM').execute(target, source, cenv) Action('$CXXCOM').execute(target, source, cenv)
passedTests = {} passedTests = {}
delay_name = None delay_name = None
for error in out.getvalue().splitlines(): out.seek(0)
for error in out.read().splitlines():
elts = error.split(':',2) elts = error.split(':',2)
if len(elts) != 3 : continue if len(elts) != 3 : continue
filename, line, message = elts filename, line, message = elts
......
...@@ -367,7 +367,7 @@ def Test(env, sources, LIBS = [], OBJECTS = []): ...@@ -367,7 +367,7 @@ def Test(env, sources, LIBS = [], OBJECTS = []):
if compileTestSources: if compileTestSources:
test.extend(env.CompileCheck(source = compileTestSources)) test.extend(env.CompileCheck(source = compileTestSources))
env.Alias('all_tests', test) env.Alias('all_tests', test)
env.Command(env.File('test'), test, []) env.Command(env.File('test'), test, [ 'true' ])
#env.Alias(env.File('test'), test) #env.Alias(env.File('test'), test)
...@@ -422,7 +422,7 @@ def Objects(env, sources, testSources = None, OBJECTS = []): ...@@ -422,7 +422,7 @@ def Objects(env, sources, testSources = None, OBJECTS = []):
# Hmm ... here I'd like to use an Alias instead of a file # Hmm ... here I'd like to use an Alias instead of a file
# however the alias does not seem to live in the subdirectory # however the alias does not seem to live in the subdirectory
# which breaks 'scons -u test' # which breaks 'scons -u test'
env.Command(env.File('test'), test, []) env.Command(env.File('test'), test, [ 'true' ])
#env.Alias(env.File('test'), test) #env.Alias(env.File('test'), test)
return objects return objects
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment