Auto-generate restricted trace .gitignore.

I'm going to add a non-ignored subdirectory so it behooves us to fix
our blanket suppression. This will also allow users to clean up stale
trace files.

Bug: angleproject:4090
Bug: b/168049670
Change-Id: I5b0879eb3eebf3b352bb78e3b927203f9483c89f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2426885
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
This commit is contained in:
Jamie Madill 2020-09-23 13:37:48 -04:00 коммит произвёл Commit Bot
Родитель cd83b608b5
Коммит b6c179960e
3 изменённых файлов: 35 добавлений и 4 удалений

Просмотреть файл

@ -1,4 +1,6 @@
{
"src/tests/restricted_traces/.gitignore":
"0eb7d74b8842c59d8b4692842bf31209",
"src/tests/restricted_traces/angry_birds_2_1500.tar.gz.sha1":
"44fc5437c4a84012e338b3da4b6fc28a",
"src/tests/restricted_traces/candy_crush_500.tar.gz.sha1":
@ -8,7 +10,7 @@
"src/tests/restricted_traces/egypt_1500.tar.gz.sha1":
"1d80caa37b937f83c95cd053b1bdd4ac",
"src/tests/restricted_traces/gen_restricted_traces.py":
"321e6bb9078501db78299c54980f96ac",
"a520ef50175b1b9a20383a884e293b54",
"src/tests/restricted_traces/manhattan_10.tar.gz.sha1":
"752781119592a190cc02b773adf38fc3",
"src/tests/restricted_traces/mobile_legends.tar.gz.sha1":

22
src/tests/restricted_traces/.gitignore поставляемый
Просмотреть файл

@ -1,2 +1,20 @@
*/
*.tar.gz
angry_birds_2_1500.tar.gz
angry_birds_2_1500/
candy_crush_500.tar.gz
candy_crush_500/
cod_mobile.tar.gz
cod_mobile/
egypt_1500.tar.gz
egypt_1500/
manhattan_10.tar.gz
manhattan_10/
mobile_legends.tar.gz
mobile_legends/
nba2k20_800.tar.gz
nba2k20_800/
subway_surfer_500.tar.gz
subway_surfer_500/
temple_run_300.tar.gz
temple_run_300/
trex_200.tar.gz
trex_200/

Просмотреть файл

@ -275,6 +275,13 @@ def gen_source(source_file, format_args):
return True
def gen_git_ignore(traces):
ignores = ['%s/' % trace for trace in traces] + ['%s.tar.gz' % trace for trace in traces]
with open('.gitignore', 'w') as out_file:
out_file.write('\n'.join(sorted(ignores)))
return True
def read_json(json_file):
with open(json_file) as map_file:
return json.loads(map_file.read(), object_pairs_hook=reject_duplicate_keys)
@ -295,7 +302,7 @@ def main():
# auto_script parameters.
if len(sys.argv) > 1:
inputs = [json_file] + [get_sha1_name(trace) for trace in traces]
outputs = [gni_file, header_file, source_file]
outputs = [gni_file, header_file, source_file, '.gitignore']
if sys.argv[1] == 'inputs':
print ','.join(inputs)
@ -339,6 +346,10 @@ def main():
print('.cpp file generation failed.')
return 1
if not gen_git_ignore(traces):
print('.gitignore file generation failed')
return 1
return 0