Use "formats" parameter to TestGyp to filter the format

BUG=None
R=mark@chromium.org

Review URL: https://codereview.chromium.org/159303003

git-svn-id: http://gyp.googlecode.com/svn/trunk@1851 78cadc50-ecff-11dd-a971-7dbc132099af
Fix generation for ninja of multiarch executable targets

Chromium includes some targets that should only be compiled on
specific platform and end up with an empty 'sources' list. This
works when generating for a single architecture, but fails with
the following callstack when building for multiarch:

Traceback (most recent call last):
  File "./gyp/gyp_main.py", line 18, in <module>
    sys.exit(gyp.script_main())
  File "./gyp/pylib/gyp/__init__.py", line 534, in script_main
    return main(sys.argv[1:])
  File "./gyp/pylib/gyp/__init__.py", line 527, in main
    return gyp_main(args)
  File "./gyp/pylib/gyp/__init__.py", line 512, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "./gyp/pylib/gyp/generator/ninja.py", line 2160, in GenerateOutput
    config_name)
  File "./gyp/pylib/gyp/generator/ninja.py", line 2078, in GenerateOutputForConfig
    target = writer.WriteSpec(spec, config_name, generator_flags)
  File "./gyp/pylib/gyp/generator/ninja.py", line 488, in WriteSpec
    self.target.actions_stamp or actions_depends)
  File "./gyp/pylib/gyp/generator/ninja.py", line 1180, in WriteTarget
    self.target.binary = self.WriteLink(spec, config_name, config, link_deps)
  File "./gyp/pylib/gyp/generator/ninja.py", line 972, in WriteLink
    for arch in self.archs]
TypeError: list indices must be integers, not str

This is because |link_deps| must be a dictionary keying |arch| to
a list of link dependencies when building for multiarch, but if
'sources' is empty, |link_deps| keep its default value (empty list).

BUG=314720
R=justincohen@chromium.org, mark@chromium.org, justincohen, mark

Review URL: https://codereview.chromium.org/157583011

git-svn-id: http://gyp.googlecode.com/svn/trunk@1852 78cadc50-ecff-11dd-a971-7dbc132099af