summaryrefslogtreecommitdiffstats
path: root/chrome/js_unittest_rules.gypi
diff options
context:
space:
mode:
authorgarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-30 18:24:29 +0000
committergarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-30 18:24:29 +0000
commit37794d090046c51c8c932376620b1a8406fa5302 (patch)
treea70f44d0be1b1cba8eb9e08ec66f0ad1ec12fa84 /chrome/js_unittest_rules.gypi
parent1b99ff18dd829ee2794f39c71d3671d27c416979 (diff)
downloadchromium_src-37794d090046c51c8c932376620b1a8406fa5302.zip
chromium_src-37794d090046c51c8c932376620b1a8406fa5302.tar.gz
chromium_src-37794d090046c51c8c932376620b1a8406fa5302.tar.bz2
Setup JS unittests for Chromoting
BUG=none TEST=remoting_unittests --gtest_filter=DebugLogUnitTest.* Review URL: http://codereview.chromium.org/8599010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112252 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/js_unittest_rules.gypi')
-rw-r--r--chrome/js_unittest_rules.gypi77
1 files changed, 77 insertions, 0 deletions
diff --git a/chrome/js_unittest_rules.gypi b/chrome/js_unittest_rules.gypi
new file mode 100644
index 0000000..d650f627db
--- /dev/null
+++ b/chrome/js_unittest_rules.gypi
@@ -0,0 +1,77 @@
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This file defines rules that allow you to include JavaScript tests in
+# your unittests target.
+
+# To add JS unittests to an existing unittest target, first include
+# 'js_unittest_vars.gypi' at the top of your GYP file to define the required
+# variables:
+#
+# 'includes': [
+# '<(DEPTH)/chrome/js_unittest_vars.gypi',
+# ],
+#
+# Then include this rule file in each of your unittest targets:
+#
+# {
+# 'target_name': 'my_unittests',
+# ...
+# 'includes': [
+# '<(DEPTH)/chrome/js_unittest_rules.gypi',
+# ],
+# }
+#
+# Note that when you run your TestSuite, you'll need to call
+# chrome::RegisterPathProvider(). These path providers are required by
+# src/chrome/test/base/v8_unit_test.cc to setup and run the tests.
+#
+# See src/chrome/test/base/run_all_remoting_unittests.cc for an example.
+
+{
+ 'rules': [
+ {
+ 'rule_name': 'copyjs',
+ 'extension': 'js',
+ 'msvs_external_rule': 1,
+ 'inputs': [
+ '<(DEPTH)/build/cp.py',
+ ],
+ 'outputs': [
+ '<(PRODUCT_DIR)/test_data/chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).<(_extension)',
+ ],
+ 'action': [
+ 'python',
+ '<@(_inputs)',
+ '<(RULE_INPUT_PATH)',
+ '<@(_outputs)',
+ ],
+ },
+ {
+ 'rule_name': 'js2unit',
+ 'extension': 'gtestjs',
+ 'msvs_external_rule': 1,
+ 'inputs': [
+ '<(gypv8sh)',
+ '<(PRODUCT_DIR)/v8_shell<(EXECUTABLE_SUFFIX)',
+ '<(mock_js)',
+ '<(test_api_js)',
+ '<(js2gtest)',
+ ],
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT)-gen.cc',
+ '<(PRODUCT_DIR)/test_data/chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).<(_extension)',
+ ],
+ 'process_outputs_as_sources': 1,
+ 'action': [
+ 'python',
+ '<@(_inputs)',
+ 'unit',
+ '<(RULE_INPUT_PATH)',
+ 'chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).<(_extension)',
+ '<@(_outputs)',
+ ],
+ },
+ ],
+}