| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # This file is meant to be included into a target to provide a rule | 5 # This file is meant to be included into a target to provide a rule |
| 6 # to "build" .isolate files into a .isolated file. | 6 # to "build" .isolate files into a .isolated file. |
| 7 # | 7 # |
| 8 # To use this, create a gyp target with the following form: | 8 # To use this, create a gyp target with the following form: |
| 9 # 'conditions': [ | 9 # 'conditions': [ |
| 10 # ['test_isolation_mode != "noop"', { | 10 # ['test_isolation_mode != "noop"', { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 # ], | 26 # ], |
| 27 # }], | 27 # }], |
| 28 # ], | 28 # ], |
| 29 # | 29 # |
| 30 # Note: foo_test.isolate is included and a source file. It is an inherent | 30 # Note: foo_test.isolate is included and a source file. It is an inherent |
| 31 # property of the .isolate format. This permits to define GYP variables but is | 31 # property of the .isolate format. This permits to define GYP variables but is |
| 32 # a stricter format than GYP so isolate.py can read it. | 32 # a stricter format than GYP so isolate.py can read it. |
| 33 # | 33 # |
| 34 # The generated .isolated file will be: | 34 # The generated .isolated file will be: |
| 35 # <(PRODUCT_DIR)/foo_test.isolated | 35 # <(PRODUCT_DIR)/foo_test.isolated |
| 36 # |
| 37 # See http://dev.chromium.org/developers/testing/isolated-testing/for-swes |
| 38 # for more information. |
| 36 | 39 |
| 37 { | 40 { |
| 38 'rules': [ | 41 'rules': [ |
| 39 { | 42 { |
| 40 'rule_name': 'isolate', | 43 'rule_name': 'isolate', |
| 41 'extension': 'isolate', | 44 'extension': 'isolate', |
| 42 'inputs': [ | 45 'inputs': [ |
| 43 # Files that are known to be involved in this step. | 46 # Files that are known to be involved in this step. |
| 44 '<(DEPTH)/tools/swarming_client/isolate.py', | 47 '<(DEPTH)/tools/swarming_client/isolate.py', |
| 45 '<(DEPTH)/tools/swarming_client/run_isolated.py', | 48 '<(DEPTH)/tools/swarming_client/run_isolated.py', |
| 46 '<(DEPTH)/tools/swarming_client/googletest/run_test_cases.py', | |
| 47 | 49 |
| 48 # Disable file tracking by the build driver for now. This means the | 50 # Disable file tracking by the build driver for now. This means the |
| 49 # project must have the proper build-time dependency for their runtime | 51 # project must have the proper build-time dependency for their runtime |
| 50 # dependency. This improves the runtime of the build driver since it | 52 # dependency. This improves the runtime of the build driver since it |
| 51 # doesn't have to stat() all these files. | 53 # doesn't have to stat() all these files. |
| 52 # | 54 # |
| 53 # More importantly, it means that even if a isolate_dependency_tracked | 55 # More importantly, it means that even if a isolate_dependency_tracked |
| 54 # file is missing, for example if a file was deleted and the .isolate | 56 # file is missing, for example if a file was deleted and the .isolate |
| 55 # file was not updated, that won't break the build, especially in the | 57 # file was not updated, that won't break the build, especially in the |
| 56 # case where foo_tests_run is not built! This should be reenabled once | 58 # case where foo_tests_run is not built! This should be reenabled once |
| 57 # the switch-over to running tests on Swarm is completed. | 59 # the switch-over to running tests on Swarm is completed. |
| 58 #'<@(isolate_dependency_tracked)', | 60 #'<@(isolate_dependency_tracked)', |
| 59 ], | 61 ], |
| 60 'outputs': [ | 62 'outputs': [ |
| 61 '<(PRODUCT_DIR)/<(RULE_INPUT_ROOT).isolated', | 63 '<(PRODUCT_DIR)/<(RULE_INPUT_ROOT).isolated', |
| 62 ], | 64 ], |
| 63 'action': [ | 65 'action': [ |
| 64 'python', | 66 'python', |
| 65 '<(DEPTH)/tools/swarming_client/isolate.py', | 67 '<(DEPTH)/tools/swarming_client/isolate.py', |
| 66 '<(test_isolation_mode)', | 68 '<(test_isolation_mode)', |
| 67 # Variables should use the -V FOO=<(FOO) form so frequent values, | 69 # Variables should use the -V FOO=<(FOO) form so frequent values, |
| 68 # like '0' or '1', aren't stripped out by GYP. | 70 # like '0' or '1', aren't stripped out by GYP. |
| 69 '--variable', 'PRODUCT_DIR', '<(PRODUCT_DIR) ', | 71 '--path-variable', 'PRODUCT_DIR', '<(PRODUCT_DIR) ', |
| 70 '--variable', 'OS=<(OS)', | 72 '--config-variable', 'OS=<(OS)', |
| 71 '--result', '<@(_outputs)', | 73 '--result', '<@(_outputs)', |
| 72 '--isolate', '<(RULE_INPUT_PATH)', | 74 '--isolate', '<(RULE_INPUT_PATH)', |
| 73 ], | 75 ], |
| 74 'conditions': [ | 76 'conditions': [ |
| 75 # Note: When gyp merges lists, it appends them to the old value. | 77 # Note: When gyp merges lists, it appends them to the old value. |
| 76 ['OS=="mac"', { | 78 ['OS=="mac"', { |
| 77 # <(mac_product_name) can contain a space, so don't use FOO=<(FOO) | 79 # <(mac_product_name) can contain a space, so don't use FOO=<(FOO) |
| 78 # form. | 80 # form. |
| 79 'action': [ '--variable', 'mac_product_name', '<(mac_product_name)' ], | 81 'action': [ |
| 82 '--extra-variable', 'mac_product_name', '<(mac_product_name)', |
| 83 ], |
| 80 }], | 84 }], |
| 81 ["test_isolation_outdir==''", { | 85 ["test_isolation_outdir==''", { |
| 82 # GYP will eliminate duplicate arguments so '<(PRODUCT_DIR)' cannot | 86 # GYP will eliminate duplicate arguments so '<(PRODUCT_DIR)' cannot |
| 83 # be provided twice. To work around this behavior, append '/'. | 87 # be provided twice. To work around this behavior, append '/'. |
| 84 # | 88 # |
| 85 # Also have a space after <(PRODUCT_DIR) or visual studio will | 89 # Also have a space after <(PRODUCT_DIR) or visual studio will |
| 86 # escape the argument wrappping " with the \ and merge it into | 90 # escape the argument wrappping " with the \ and merge it into |
| 87 # the following arguments. | 91 # the following arguments. |
| 88 'action': [ '--outdir', '<(PRODUCT_DIR)/ ' ], | 92 'action': [ '--outdir', '<(PRODUCT_DIR)/ ' ], |
| 89 }, { | 93 }, { |
| 90 'action': [ '--outdir', '<(test_isolation_outdir)' ], | 94 'action': [ '--outdir', '<(test_isolation_outdir)' ], |
| 91 }], | 95 }], |
| 92 ['test_isolation_fail_on_missing == 0', { | 96 ['test_isolation_fail_on_missing == 0', { |
| 93 'action': ['--ignore_broken_items'], | 97 'action': ['--ignore_broken_items'], |
| 94 }, | 98 }, |
| 95 ], | 99 ], |
| 96 ], | 100 ], |
| 97 | 101 |
| 98 'msvs_cygwin_shell': 0, | 102 'msvs_cygwin_shell': 0, |
| 99 }, | 103 }, |
| 100 ], | 104 ], |
| 101 } | 105 } |
| OLD | NEW |