summaryrefslogtreecommitdiff
path: root/chromium/v8/tools/testrunner
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/v8/tools/testrunner')
-rw-r--r--chromium/v8/tools/testrunner/testrunner.isolate8
-rw-r--r--chromium/v8/tools/testrunner/utils/dump_build_config.py4
-rw-r--r--chromium/v8/tools/testrunner/utils/dump_build_config_gyp.py54
3 files changed, 57 insertions, 9 deletions
diff --git a/chromium/v8/tools/testrunner/testrunner.isolate b/chromium/v8/tools/testrunner/testrunner.isolate
index e29f1df98df..56667c20215 100644
--- a/chromium/v8/tools/testrunner/testrunner.isolate
+++ b/chromium/v8/tools/testrunner/testrunner.isolate
@@ -7,6 +7,7 @@
'../run-tests.py',
],
'files': [
+ '<(PRODUCT_DIR)/v8_build_config.json',
'../run-tests.py',
'./'
],
@@ -20,12 +21,5 @@
],
},
}],
- ['is_gn==1', {
- 'variables': {
- 'files': [
- '<(PRODUCT_DIR)/v8_build_config.json',
- ],
- },
- }],
],
}
diff --git a/chromium/v8/tools/testrunner/utils/dump_build_config.py b/chromium/v8/tools/testrunner/utils/dump_build_config.py
index bd57b5f34e2..b691bb3dc8d 100644
--- a/chromium/v8/tools/testrunner/utils/dump_build_config.py
+++ b/chromium/v8/tools/testrunner/utils/dump_build_config.py
@@ -15,7 +15,7 @@ import json
import os
import sys
-assert len(sys.argv) > 1
+assert len(sys.argv) > 2
def as_json(kv):
assert '=' in kv
@@ -23,4 +23,4 @@ def as_json(kv):
return k, json.loads(v)
with open(sys.argv[1], 'w') as f:
- json.dump(dict(as_json(kv) for kv in sys.argv[2:]), f)
+ json.dump(dict(map(as_json, sys.argv[2:])), f)
diff --git a/chromium/v8/tools/testrunner/utils/dump_build_config_gyp.py b/chromium/v8/tools/testrunner/utils/dump_build_config_gyp.py
new file mode 100644
index 00000000000..7f726271314
--- /dev/null
+++ b/chromium/v8/tools/testrunner/utils/dump_build_config_gyp.py
@@ -0,0 +1,54 @@
+# Copyright 2017 the V8 project authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""The same as dump_build_config.py but for gyp legacy.
+
+Expected to be called like:
+dump_build_config.py path/to/file.json [key1=value1 ...]
+
+Raw gyp values are supported - they will be tranformed into valid json.
+"""
+# TODO(machenbach): Remove this when gyp is deprecated.
+
+import json
+import os
+import sys
+
+assert len(sys.argv) > 2
+
+
+GYP_GN_CONVERSION = {
+ 'is_component_build': {
+ 'shared_library': 'true',
+ 'static_library': 'false',
+ },
+ 'is_debug': {
+ 'Debug': 'true',
+ 'Release': 'false',
+ },
+}
+
+DEFAULT_CONVERSION ={
+ '0': 'false',
+ '1': 'true',
+ 'ia32': 'x86',
+}
+
+def gyp_to_gn(key, value):
+ value = GYP_GN_CONVERSION.get(key, DEFAULT_CONVERSION).get(value, value)
+ value = value if value in ['true', 'false'] else '"{0}"'.format(value)
+ return value
+
+def as_json(kv):
+ assert '=' in kv
+ k, v = kv.split('=', 1)
+ v2 = gyp_to_gn(k, v)
+ try:
+ return k, json.loads(v2)
+ except ValueError as e:
+ print(k, v, v2)
+ raise e
+
+with open(sys.argv[1], 'w') as f:
+ json.dump(dict(map(as_json, sys.argv[2:])), f)