summaryrefslogtreecommitdiffstats
path: root/site_scons
diff options
context:
space:
mode:
authorbradnelson@chromium.org <bradnelson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-08 00:12:34 +0000
committerbradnelson@chromium.org <bradnelson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-08 00:12:34 +0000
commit4a28e0bc86f6c42eeb4c3686b3f29493354701c7 (patch)
tree722c61e207b5a315d75fea6165d43534e8ea181e /site_scons
parent86aa36bfc4155eb70453e303d0c6b351860b84a3 (diff)
downloadchromium_src-4a28e0bc86f6c42eeb4c3686b3f29493354701c7.zip
chromium_src-4a28e0bc86f6c42eeb4c3686b3f29493354701c7.tar.gz
chromium_src-4a28e0bc86f6c42eeb4c3686b3f29493354701c7.tar.bz2
Adding in new solution builder pattern.
Review URL: http://codereview.chromium.org/10231 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5047 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'site_scons')
-rw-r--r--site_scons/site_tools/component_builders.py36
1 files changed, 21 insertions, 15 deletions
diff --git a/site_scons/site_tools/component_builders.py b/site_scons/site_tools/component_builders.py
index 9580d7e..1fe638c 100644
--- a/site_scons/site_tools/component_builders.py
+++ b/site_scons/site_tools/component_builders.py
@@ -317,11 +317,19 @@ def ComponentTestProgramDeferred(env):
# Add installed program and resources to the alias
env.Alias(prog_name, all_outputs)
- # Add an alias for running the test in the test directory, if there's a test
- # command line.
- if env.get('COMPONENT_TEST_CMDLINE'):
- # Test program is the first run resource we replicated.
- test_program = env.ReplicatePublished('$TESTS_DIR', prog_name, 'run')
+ # Add target properties
+ env.SetTargetProperty(
+ prog_name,
+ # The copy of the program we care about is the one in the tests dir
+ EXE='$TESTS_DIR/$PROGRAM_NAME',
+ RUN_CMDLINE='$COMPONENT_TEST_CMDLINE',
+ RUN_DIR='$TESTS_DIR',
+ TARGET_PATH='$TESTS_DIR/$PROGRAM_NAME',
+ )
+
+ # Add an alias for running the test in the test directory, if the test is
+ # runnable and has a test command line.
+ if env.get('COMPONENT_TEST_RUNNABLE') and env.get('COMPONENT_TEST_CMDLINE'):
env.Replace(
COMMAND_OUTPUT_CMDLINE=env['COMPONENT_TEST_CMDLINE'],
COMMAND_OUTPUT_RUN_DIR='$TESTS_DIR',
@@ -339,6 +347,11 @@ def ComponentTestProgramDeferred(env):
if timeout:
env['COMMAND_OUTPUT_TIMEOUT'] = timeout
+ # Test program is the first run resource we replicated. (Duplicate
+ # replicate is not harmful, and is a handy way to pick out the correct
+ # file from all those we replicated above.)
+ test_program = env.ReplicatePublished('$TESTS_DIR', prog_name, 'run')
+
# Run the test. Note that we need to refer to the file by name, so that
# SCons will recreate the file node after we've deleted it; if we used the
# env.File() we created in the if statement above, SCons would still think
@@ -350,16 +363,7 @@ def ComponentTestProgramDeferred(env):
env.ComponentTestOutput('run_' + prog_name, test_out)
# Add target properties
- env.SetTargetProperty(
- prog_name,
- # The copy of the program we care about is the one in the tests dir
- EXE='$TESTS_DIR/$PROGRAM_NAME',
- RUN_TARGET='run_' + prog_name,
- RUN_CMDLINE='$COMPONENT_TEST_CMDLINE',
- RUN_DIR='$TESTS_DIR',
- TARGET_PATH='$TESTS_DIR/$PROGRAM_NAME',
- )
-
+ env.SetTargetProperty(prog_name, RUN_TARGET='run_' + prog_name)
def ComponentTestProgram(self, prog_name, *args, **kwargs):
"""Pseudo-builder for test program to handle platform-dependent type.
@@ -534,6 +538,8 @@ def generate(env):
# COMPONENT_TEST_CMDLINE='${SOURCE.abspath}',
# (it generates a SCons error)
COMPONENT_TEST_CMDLINE='${PROGRAM_NAME}',
+ # Component tests are runnable by default.
+ COMPONENT_TEST_RUNNABLE=True,
# Default test size is large
COMPONENT_TEST_SIZE='large',
# Default timeouts for component tests