[test spec] Fix bugs

There are currently two bugs:
(1) the test spec location is a function of the user-given package name,
not the actual package target name; we must use the latter or else we
cannot reconstruct the test spec from packages.json
(2) the test spec location is a function of the template's target_name,
a test name, which may be a path (e.g., //out/x64/<rebase_path value>);
this means it can be in a variable-depth subdirectory of the
target_out_dir, while we only look for it at depth 1. We take
target_name's basename to fix this.

Change-Id: I68cdb457a2d0a34bb75c850ad9ab19a358047584
2 files changed