Use base::Subprocess in tests and tools

This CL changes the behavior of the cmdline and trigger
e2e tests. Instead of running the "perfetto" and
"trigger_perfetto" commands in a forked environment
(without exec()), exec the real binary.
fork() turns out to be super-fragile because forked
processes inherit the main process pipes that are
used to synchronize the test sequencing. By keeping
one end open, they prevent the main test process to
see the pipe EOF.

Change-Id: Ibc7838ee44fa3a2fa7c4d9fb24066de543a77e19
diff --git a/tools/gen_android_bp b/tools/gen_android_bp
index 95a4c39..7b7b1ee 100755
--- a/tools/gen_android_bp
+++ b/tools/gen_android_bp
@@ -724,6 +724,8 @@
       module.generated_headers.update(dep_module.genrule_headers)
       module.srcs.update(dep_module.genrule_srcs)
       module.shared_libs.update(dep_module.genrule_shared_libs)
+    elif dep_module.type == 'cc_binary':
+      continue  # Ignore executables deps (used by cmdline integration tests).
     else:
       raise Error('Unknown dep %s (%s) for target %s' %
                   (dep_module.name, dep_module.type, module.name))