-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test] Cherry-pick changes for test-flag auto-detect
This cherry-picks: https://chromium-review.googlesource.com/c/v8/v8/+/725706 https://chromium-review.googlesource.com/c/v8/v8/+/727800 https://chromium-review.googlesource.com/c/v8/v8/+/728023 NOTRY=true NOPRESUBMIT=true Bug: v8:6917 Change-Id: Iebb7f0cba504e46d78e5f5131561a5d201d5ee60 Reviewed-on: https://chromium-review.googlesource.com/727884 Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org> Commit-Queue: Michael Achenbach <machenbach@chromium.org> Cr-Commit-Position: refs/branch-heads/6.2@{#68} Cr-Branched-From: efa2ac4-refs/heads/6.2.414@{#1} Cr-Branched-From: a861ebb-refs/heads/master@{#47693}
- Loading branch information
Showing
9 changed files
with
97 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# 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): | ||
return GYP_GN_CONVERSION.get(key, DEFAULT_CONVERSION).get(value, value) | ||
|
||
def as_json(kv): | ||
assert '=' in kv | ||
k, v = kv.split('=', 1) | ||
return k, json.loads(gyp_to_gn(k, v)) | ||
|
||
with open(sys.argv[1], 'w') as f: | ||
json.dump(dict(map(as_json, sys.argv[2:])), f) |