summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nolan Scobie <nscobie@google.com> 2024-07-25 15:56:46 -0400
committer Nolan Scobie <nscobie@google.com> 2024-07-29 13:55:10 -0400
commitba46cae31800d98dbdd9b8563536586280d4724e (patch)
tree3735522bb60098da495c7b64c52ed3e7f14e70ac
parent0fc4b90b01e40c05d5fa456d37295a17b0f22f0c (diff)
Log chosen RenderPipelineType when running hwui_unit_tests
There are a few ways to run hwui_unit_tests: copy the binary to the device and execute it directly, run with atest, tradefed, etc(?). Some of these approaches have arcane ways of passing arguments down into the executable, such as the `--renderer` flag. Logging what is actually observed/chosen can help confirm that the flag is being passed correctly. Bug: b/338077634 Test: observed logs for `hwui_unit_tests --renderer=skiavk` Flag: TEST_ONLY Change-Id: I1a4e72fb08dedf36f9095b3844e346ffeefac602
-rw-r--r--libs/hwui/tests/unit/main.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/hwui/tests/unit/main.cpp b/libs/hwui/tests/unit/main.cpp
index 76cbc8abc808..3fd15c4c9c51 100644
--- a/libs/hwui/tests/unit/main.cpp
+++ b/libs/hwui/tests/unit/main.cpp
@@ -15,6 +15,7 @@
*/
#include <getopt.h>
+#include <log/log.h>
#include <signal.h>
#include "Properties.h"
@@ -65,6 +66,19 @@ static RenderPipelineType parseRenderer(const char* renderer) {
return RenderPipelineType::SkiaGL;
}
+static constexpr const char* renderPipelineTypeName(const RenderPipelineType renderPipelineType) {
+ switch (renderPipelineType) {
+ case RenderPipelineType::SkiaGL:
+ return "SkiaGL";
+ case RenderPipelineType::SkiaVulkan:
+ return "SkiaVulkan";
+ case RenderPipelineType::SkiaCpu:
+ return "SkiaCpu";
+ case RenderPipelineType::NotInitialized:
+ return "NotInitialized";
+ }
+}
+
struct Options {
RenderPipelineType renderer = RenderPipelineType::SkiaGL;
};
@@ -118,6 +132,7 @@ int main(int argc, char* argv[]) {
auto opts = parseOptions(argc, argv);
Properties::overrideRenderPipelineType(opts.renderer);
+ ALOGI("Starting HWUI unit tests with %s pipeline", renderPipelineTypeName(opts.renderer));
// Run the tests
testing::InitGoogleTest(&argc, argv);