diff options
Diffstat (limited to 'tests/SConstruct')
-rw-r--r-- | tests/SConstruct | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/SConstruct b/tests/SConstruct index f998024..d2dfeec 100644 --- a/tests/SConstruct +++ b/tests/SConstruct @@ -16,6 +16,14 @@ scons CC=clang CXX=clang++ import os env = Environment(ENV = os.environ, tools = ['default', 'nanopb']) +# Limit memory usage. This is to catch problems like issue #338 +try: + import resource + soft, hard = resource.getrlimit(resourse.RLIMIT_AS) + resource.setrlimit(resource.RLIMIT_AS, (100*1024*1024, hard)) +except: + pass + # Allow overriding the compiler with scons CC=??? if 'CC' in ARGUMENTS: env.Replace(CC = ARGUMENTS['CC']) if 'CXX' in ARGUMENTS: env.Replace(CXX = ARGUMENTS['CXX']) @@ -128,6 +136,12 @@ elif 'cl' in env['CC']: # More strict checks on the nanopb core env.Append(CORECFLAGS = '/W4') + + # Disable warning about sizeof(union{}) construct that is used in + # message size macros, in e.g. multiple_files testcase. The C construct + # itself is valid, but quite rare, which causes Visual C++ to give a warning + # about it. + env.Append(CFLAGS = '/wd4116') elif 'tcc' in env['CC']: # Tiny C Compiler env.Append(CFLAGS = '-Wall -Werror -g') @@ -139,7 +153,7 @@ if 'clang' in env['CXX']: elif 'g++' in env['CXX'] or 'gcc' in env['CXX']: env.Append(CXXFLAGS = '-g -Wall -Werror -Wextra -Wno-missing-field-initializers') elif 'cl' in env['CXX']: - env.Append(CXXFLAGS = '/Zi /W2 /WX') + env.Append(CXXFLAGS = '/Zi /W2 /WX /wd4116') # Now include the SConscript files from all subdirectories import os.path |