lshal: add --types=lazy|z
Add a new section to lshal that shows HALs in the manifest
- as hwbinder HALs but not registered
- as passthrough HALs but no impl found
Fixes: 71555570
Test: lshal_test
Test: lshal --types=z
Change-Id: I6947d9e7e08991fa2497f40c81005f885d408931
diff --git a/cmds/lshal/test.cpp b/cmds/lshal/test.cpp
index b05946b..8d7405b 100644
--- a/cmds/lshal/test.cpp
+++ b/cmds/lshal/test.cpp
@@ -805,6 +805,21 @@
EXPECT_EQ("", err.str());
}
+TEST_F(ListVintfTest, Lazy) {
+ optind = 1; // mimic Lshal::parseArg()
+ EXPECT_EQ(0u, mockList->main(createArg({"lshal", "-iStr", "--types=z", "--neat"})));
+ EXPECT_THAT(out.str(), HasSubstr("a.h.bar1@1.0::IBar/1 declared hwbinder ?"));
+ EXPECT_THAT(out.str(), HasSubstr("a.h.bar2@2.0::IBar/2 declared passthrough 32+64"));
+ EXPECT_EQ("", err.str());
+}
+
+TEST_F(ListVintfTest, NoLazy) {
+ optind = 1; // mimic Lshal::parseArg()
+ EXPECT_EQ(0u, mockList->main(createArg({"lshal", "-iStr", "--types=b,c,l", "--neat"})));
+ EXPECT_THAT(out.str(), Not(HasSubstr("IBar")));
+ EXPECT_EQ("", err.str());
+}
+
class HelpTest : public ::testing::Test {
public:
void SetUp() override {