SCons: several small improvements, e.g. valgrind-suppressionfile
This commit is contained in:
parent
002f024ed8
commit
a29591c299
7 changed files with 60 additions and 45 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# -*- python -*-
|
||||
##
|
||||
## ToolDistCC.py - SCons tool for distributed compilation using DistCC
|
||||
## ToolCCache.py - SCons tool for integrating with CCache compiler cache
|
||||
##
|
||||
|
||||
# Copyright (C) Lumiera.org and FreeOrion.org
|
||||
|
|
@ -33,33 +33,44 @@ from Buildhelper import *
|
|||
|
||||
def generate(env):
|
||||
""" Modify the environment such as to redirect any
|
||||
C/C++ compiler invocations through DistCC. Additionally
|
||||
pull in the environment config variables used by DistCC
|
||||
C/C++ compiler invocations through CCache, while using
|
||||
CCache config variables found in the os.environment.
|
||||
"""
|
||||
if not exists(env): return
|
||||
|
||||
assert env['DISTCC']
|
||||
if not env['DISTCC'] in env['CC']:
|
||||
env['CC'] = env.subst('$DISTCC $CC')
|
||||
if not env['DISTCC'] in env['CXX']:
|
||||
env['CXX'] = env.subst('$DISTCC $CXX')
|
||||
print env.subst("* Build using $DISTCC")
|
||||
assert env['CCACHE']
|
||||
if not env['CCACHE'] in env['CC']:
|
||||
env['CC'] = env.subst('$CCACHE $CC')
|
||||
if not env['CCACHE'] in env['CXX']:
|
||||
env['CXX'] = env.subst('$CCACHE $CXX')
|
||||
print env.subst("* Build using $CCACHE")
|
||||
|
||||
for i in ['HOME'
|
||||
,'DISTCC_HOSTS'
|
||||
,'DISTCC_VERBOSE'
|
||||
,'DISTCC_FALLBACK'
|
||||
,'DISTCC_LOG'
|
||||
,'DISTCC_MMAP'
|
||||
,'DISTCC_SAVE_TEMPS'
|
||||
,'DISTCC_TCP_CORK'
|
||||
,'DISTCC_SSH'
|
||||
,'CCACHE_DIR'
|
||||
,'CCACHE_TEMPDIR'
|
||||
,'CCACHE_LOGFILE'
|
||||
,'CCACHE_PATH'
|
||||
,'CCACHE_CC'
|
||||
,'CCACHE_CPP2'
|
||||
,'CCACHE_PREFIX'
|
||||
,'CCACHE_DISABLE'
|
||||
,'CCACHE_READONLY'
|
||||
,'CCACHE_NOSTATS'
|
||||
,'CCACHE_NLEVELS'
|
||||
,'CCACHE_HARDLINK'
|
||||
,'CCACHE_RECACHE'
|
||||
,'CCACHE_UMASK'
|
||||
,'CCACHE_HASHDIR'
|
||||
,'CCACHE_UNIFY'
|
||||
,'CCACHE_EXTENSION'
|
||||
]:
|
||||
if os.environ.has_key(i) and not env.has_key(i):
|
||||
env['ENV'][i] = os.environ[i]
|
||||
|
||||
|
||||
def exists(env):
|
||||
""" Ensure DistCC exists.
|
||||
"""
|
||||
return checkCommandOption(env, 'DISTCC', cmdName='distcc')
|
||||
|
||||
def exists(env):
|
||||
""" Ensure CCache is available.
|
||||
"""
|
||||
return checkCommandOption(env, 'CCACHE', cmdName='ccache')
|
||||
|
||||
|
|
|
|||
|
|
@ -8,11 +8,10 @@ Import('env','artifacts','core')
|
|||
support_lib = artifacts['support']
|
||||
|
||||
envSvg = env.Clone()
|
||||
envSvg.mergeConf(['librsvg-2.0','gthread-2.0'])
|
||||
envSvg.mergeConf(['librsvg-2.0'])
|
||||
envSvg.Append(LIBS=support_lib)
|
||||
|
||||
|
||||
vgsuppr = env.Program('#$BINDIR/vgsuppression','vgsuppression.c', LIBS=core)## for suppressing false valgrind alarms
|
||||
luidgen = env.Program('#$BINDIR/luidgen', 'luidgen.c', LIBS=support_lib) ## for generating Lumiera-UIDs
|
||||
rsvg = envSvg.Program('#$BINDIR/rsvg-convert','rsvg-convert.c') ## for rendering SVG icons (uses librsvg)
|
||||
|
||||
|
|
@ -20,7 +19,6 @@ rsvg = envSvg.Program('#$BINDIR/rsvg-convert','rsvg-convert.c') ## f
|
|||
artifacts['tools'] = [ env.Program('#$BINDIR/hello-world','hello.c') #### hello world (checks C build)
|
||||
+ env.Program('#$BINDIR/try', 'try.cpp') #### to try out some feature...
|
||||
# + luidgen
|
||||
+ vgsuppr
|
||||
+ rsvg
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -66,6 +66,10 @@ artifacts['testsuite'] = ts = ( [ testExecutable(env, dir) for dir in ['bugs'] ]
|
|||
|
||||
|
||||
|
||||
# for creating a Valgrind-Suppression file
|
||||
vgsuppr = env.Program('#$BINDIR/vgsuppression','tool/vgsuppression.c', LIBS=core) ## for suppressing false valgrind alarms
|
||||
artifacts['tools'] += [vgsuppr]
|
||||
Depends(ts,vgsuppr)
|
||||
|
||||
|
||||
#
|
||||
|
|
|
|||
|
|
@ -1 +1,4 @@
|
|||
LOGSUPPRESS='^\(\*\*[0-9]*\*\* \)\?[0-9]\{10,\}[:!] \(TRACE\|INFO\|NOTICE\|WARNING\|ERR\|TODO\|PLANNED\|FIXME\|DEPRECATED\|UNIMPLEMENTED\|RESOURCE_ANNOUNCE\|RESOURCE_ENTER\|RESOURCE_STATE\|RESOURCE_LEAVE\):'
|
||||
|
||||
LIMIT_VG_CPU=55
|
||||
LIMIT_VG_TIME=60
|
||||
|
|
|
|||
39
tests/test.h
39
tests/test.h
|
|
@ -22,40 +22,39 @@
|
|||
#ifndef TEST_H
|
||||
#define TEST_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <nobug.h>
|
||||
|
||||
#include "lib/error.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
NOBUG_DEFINE_FLAG (TESTS);
|
||||
LUMIERA_ERROR_DEFINE (TEST, "test error");
|
||||
NOBUG_DEFINE_FLAG_LIMIT(TEST, LOG_DEBUG);
|
||||
|
||||
#define TESTS_BEGIN \
|
||||
int \
|
||||
main (int argc, const char** argv) \
|
||||
{ \
|
||||
NOBUG_INIT; \
|
||||
NOBUG_INIT_FLAG (TESTS); \
|
||||
NOBUG_INIT_FLAG (TEST); \
|
||||
unsigned testcnt=0; \
|
||||
int ret = 0; \
|
||||
\
|
||||
if (argc == 1) \
|
||||
{ \
|
||||
fprintf (stderr, "missing argument\n"); \
|
||||
return 1; \
|
||||
}
|
||||
fprintf (stderr, "supported tests:\n");
|
||||
|
||||
#define TEST(name) \
|
||||
else if (!strcmp(argv[1], name))
|
||||
if (argc == 1) \
|
||||
fprintf (stderr, " "#name"\n"); \
|
||||
else if (!strcmp(argv[1], #name) && ++testcnt)
|
||||
|
||||
#define PLANNED_TEST(name) \
|
||||
if (argc == 1) \
|
||||
fprintf (stderr, " "#name" (planned)\n"); \
|
||||
else if (!++testcnt)
|
||||
|
||||
#define TESTS_END \
|
||||
else \
|
||||
{ \
|
||||
fprintf (stderr, "unknown test\n"); \
|
||||
return 1; \
|
||||
} \
|
||||
\
|
||||
return 0; \
|
||||
#define TESTS_END \
|
||||
if (!testcnt && argc !=1) \
|
||||
fprintf (stderr,"no such test: %s\n", argv[1]); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ if [ "$VALGRINDFLAGS" = 'DISABLE' ]; then
|
|||
echo "valgrind explicit disabled"
|
||||
else
|
||||
if [ "$(which valgrind)" ]; then
|
||||
ulimit -S -t ${ULIMIT_VG_CPU:-20} -v ${ULIMIT_VG_VSZ:-524288}
|
||||
ulimit -S -t ${LIMIT_VG_CPU:-20} -v ${LIMIT_VG_VSZ:-524288}
|
||||
LIMIT_TIME_REAL="$LIMIT_VG_TIME"
|
||||
if [[ -x 'vgsuppression' ]]; then
|
||||
if [[ 'vgsuppression' -nt 'vgsuppression.supp' ]]; then
|
||||
|
|
|
|||
Loading…
Reference in a new issue