[test spec] Rebase linux/mac test paths with respect to root_build_dir

This cuts off the leading //.

Moreover, we fix a bug in test.gni in which the location was being
recorded with the target_name of the spec instead of that of the test
template.

Change-Id: I691134596f27d38a36dc355c8fa0ee5519ac68d2
diff --git a/test.gni b/test.gni
index 08da507..ffd0f8c 100644
--- a/test.gni
+++ b/test.gni
@@ -12,7 +12,7 @@
   if (is_linux || is_mac) {
     test_spec("${target_name}_spec") {
       name = invoker.target_name
-      location = "$root_out_dir/$target_name"
+      location = "$root_out_dir/${invoker.target_name}"
     }
   }
 
diff --git a/testing/test_spec.gni b/testing/test_spec.gni
index f012adc..96fd781 100644
--- a/testing/test_spec.gni
+++ b/testing/test_spec.gni
@@ -218,6 +218,10 @@
     test = {
       name = get_label_info(":${invoker.name}", "label_no_toolchain")
       location = invoker.location
+      if (is_linux || is_mac) {
+        # Trim leading //.
+        location = rebase_path(location, root_build_dir)
+      }
       os = current_os
       cpu = current_cpu
     }