|
Currently, we use the gtest main for both unittests and e2e tests, which
means that we don't have access to tracing or verbose logging for those
binaries. This patch fixes it by adding a custom test main. This, along
with other issues, has resulted in major inconsistencies in the options
provided by each of our binaries (osp_demo, e2e_tests,
openscreen_unittests, especially), even though they all link against the
same platform implementation.
This patch attempts to fix some of the more frustrating issues with the
options these binaries present, by implementing the following list of
fixes:
1. Move to actually honoring trace logging gn arg, and deletion of the
features.h header since it is unnecessary. This means our trace logging
readme is actually right and you can now actually disable trace logging
by setting the gn arg enable_trace_logging = false.
2. Addition of a custom unit test main. If trace logging is enabled,
-t will toggle it on. If the platform impl is linked (we MUST know this,
as when we are embedded we have no way of setting logging, and this
test main should be used both in embedded and not embedded use cases)
then the log level may be set to verbose by passing -v.
3. The cast_sender, cast_receiver, and osp_demo binaries are cleaned up
to match the flags added to the test main binary. Note that additional
cleanup is warranted on the osp_demo to make it more in line with other
binaries.
Change-Id: I500a46cb118c0721c4c59bd367d3c96d1a542720
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2168547
Commit-Queue: Jordan Bayles <jophba@chromium.org>
Reviewed-by: Jordan Bayles <jophba@chromium.org>
Reviewed-by: Ryan Keane <rwkeane@google.com>
|