OLD | NEW |
(Empty) | |
| 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 # This file defines rules that allow you to include JavaScript tests in |
| 6 # your unittests target. |
| 7 |
| 8 # To add JS unittests to an existing unittest target, first include |
| 9 # 'js_unittest_vars.gypi' at the top of your GYP file to define the required |
| 10 # variables: |
| 11 # |
| 12 # 'includes': [ |
| 13 # '<(DEPTH)/chrome/js_unittest_vars.gypi', |
| 14 # ], |
| 15 # |
| 16 # Then include this rule file in each of your unittest targets: |
| 17 # |
| 18 # { |
| 19 # 'target_name': 'my_unittests', |
| 20 # ... |
| 21 # 'includes': [ |
| 22 # '<(DEPTH)/chrome/js_unittest_rules.gypi', |
| 23 # ], |
| 24 # } |
| 25 # |
| 26 # Note that when you run your TestSuite, you'll need to call |
| 27 # chrome::RegisterPathProvider(). These path providers are required by |
| 28 # src/chrome/test/base/v8_unit_test.cc to setup and run the tests. |
| 29 # |
| 30 # See src/chrome/test/base/run_all_remoting_unittests.cc for an example. |
| 31 |
| 32 { |
| 33 'rules': [ |
| 34 { |
| 35 'rule_name': 'copyjs', |
| 36 'extension': 'js', |
| 37 'msvs_external_rule': 1, |
| 38 'inputs': [ |
| 39 '<(DEPTH)/build/cp.py', |
| 40 ], |
| 41 'outputs': [ |
| 42 '<(PRODUCT_DIR)/test_data/chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT
).<(_extension)', |
| 43 ], |
| 44 'action': [ |
| 45 'python', |
| 46 '<@(_inputs)', |
| 47 '<(RULE_INPUT_PATH)', |
| 48 '<@(_outputs)', |
| 49 ], |
| 50 }, |
| 51 { |
| 52 'rule_name': 'js2unit', |
| 53 'extension': 'gtestjs', |
| 54 'msvs_external_rule': 1, |
| 55 'inputs': [ |
| 56 '<(gypv8sh)', |
| 57 '<(PRODUCT_DIR)/v8_shell<(EXECUTABLE_SUFFIX)', |
| 58 '<(mock_js)', |
| 59 '<(test_api_js)', |
| 60 '<(js2gtest)', |
| 61 ], |
| 62 'outputs': [ |
| 63 '<(INTERMEDIATE_DIR)/chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT)-gen
.cc', |
| 64 '<(PRODUCT_DIR)/test_data/chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT
).<(_extension)', |
| 65 ], |
| 66 'process_outputs_as_sources': 1, |
| 67 'action': [ |
| 68 'python', |
| 69 '<@(_inputs)', |
| 70 'unit', |
| 71 '<(RULE_INPUT_PATH)', |
| 72 'chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).<(_extension)', |
| 73 '<@(_outputs)', |
| 74 ], |
| 75 }, |
| 76 ], |
| 77 } |
OLD | NEW |