veyron/lib/testutil: Avoid parsing flags in init()

Calling flags.Parse in the init of packages is generally not recommended since
it requires that all flags be defined first, which is impossible to ensure
as the init order of independent packages is not defined.

veyron/lib/testutil had hacks to work around this by introducing dependencies
on all packages that define flags and are used in tests. This was hacky,
fragile and hard to maintain.

In this commit, we change the approach to be an explicit call to flags.Parse
(well, to testutil.Initialize, which calls flags.Parse).  You may notice that
this call is made in the init function of packages in _test.go files, which
seems to be contradicting all that was said above.

Yes, it does. But the thinking is that calling flags.Parse in "package main" or
any _test.go files is okay, since in those cases, necessarily all packages that
the main/test depends on are initialized first.

Change-Id: I005e8223ec7e9ed630bdf563df059decbf827e06
31 files changed
tree: c2f890231cf7056d2261011e242f0a2c0e2a40ae
  1. lib/
  2. profiles/
  3. runtimes/
  4. security/
  5. services/
  6. tools/