From c2c5482c9b5ffbfa7cd301bdea76574f6e291823 Mon Sep 17 00:00:00 2001 From: "sgjesse@gmail.com" Date: Tue, 2 Sep 2008 12:20:15 +0000 Subject: [PATCH] Add the SCons environment override to the building of the samples and the tests. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@95 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- SConstruct | 1 + test/cctest/SConscript | 1 + tools/test.py | 10 +++++++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/SConstruct b/SConstruct index abd5e90..6bb23ce 100644 --- a/SConstruct +++ b/SConstruct @@ -450,6 +450,7 @@ def BuildSpecific(env, mode, env_overrides): for sample in context.samples: sample_env = Environment(LIBRARY=library_name) sample_env.Replace(**context.flags['sample']) + sample_env['ENV'].update(**context.env_overrides) sample_object = sample_env.SConscript( join('samples', 'SConscript'), build_dir=join('obj', 'sample', sample, target_id), diff --git a/test/cctest/SConscript b/test/cctest/SConscript index 2da4de6..cc59199 100644 --- a/test/cctest/SConscript +++ b/test/cctest/SConscript @@ -53,6 +53,7 @@ def Build(): cctest_files = context.GetRelevantSources(SOURCES) env = Environment() env.Replace(**context.flags['cctest']) + env['ENV'].update(**context.env_overrides) # There seems to be a glitch in the way scons decides where to put # PDB files when compiling using MSVC so we specify it manually. # This should not affect any other platforms. diff --git a/tools/test.py b/tools/test.py index 5a7e331..ef47a38 100755 --- a/tools/test.py +++ b/tools/test.py @@ -490,8 +490,10 @@ def RunTestCases(all_cases, progress): return progress.Run() -def BuildRequirements(context, requirements, mode): - command_line = ['scons', '-Y', context.workspace, 'mode=' + ",".join(mode)] + requirements +def BuildRequirements(context, requirements, mode, scons_flags): + command_line = (['scons', '-Y', context.workspace, 'mode=' + ",".join(mode)] + + requirements + + scons_flags) output = ExecuteNoCapture(command_line, context) return output.exit_code == 0 @@ -921,6 +923,8 @@ def BuildOptions(): default='release') result.add_option("-v", "--verbose", help="Verbose output", default=False, action="store_true") + result.add_option("-S", dest="scons_flags", help="Flag to pass through to scons", + default=[], action="append") result.add_option("-p", "--progress", help="The style of progress indicator (verbose, dots, color, mono)", choices=PROGRESS_INDICATORS.keys(), default="mono") @@ -1026,7 +1030,7 @@ def Main(): reqs += root.GetBuildRequirements(path, context) reqs = list(set(reqs)) if len(reqs) > 0: - if not BuildRequirements(context, reqs, options.mode): + if not BuildRequirements(context, reqs, options.mode, options.scons_flags): return 1 # Get status for tests -- 2.7.4