drm_hwcomposer: CI: Increase coverage
Add the following files to the build:
backend/BackendClient.cpp
backend/Backend.cpp
backend/BackendManager.cpp
backend/BackendRCarDu.cpp
bufferinfo/legacy/BufferInfoImagination.cpp
bufferinfo/legacy/BufferInfoLibdrm.cpp
bufferinfo/legacy/BufferInfoMaliHisi.cpp
bufferinfo/legacy/BufferInfoMaliMediatek.cpp
bufferinfo/legacy/BufferInfoMaliMeson.cpp
bufferinfo/legacy/BufferInfoMinigbm.cpp
compositor/DrmDisplayComposition.cpp
compositor/DrmDisplayCompositor.cpp
compositor/Planner.cpp
drm/DrmGenericImporter.cpp
DrmHwcTwo.cpp
drm/ResourceManager.cpp
drm/VSyncWorker.cpp
tests/worker_test.cpp
utils/autolock.cpp
Files 'bufferinfo/BufferInfoMapperMetadata.cpp' and 'utils/hwcutils.cpp' require
a lot of additional headers, therefore move them out of the scope of this commit.
'utils/gralloc.h' isn't planned to use in pure-linux builds, therefore remove
it from 'utils' and put it into '.ci/android_headers/hardware/'
Fix minor tidy fails.
Fix linux build fails (missing includes) due to differences between libc and
bionic.
Comment-out some sections in 'tests/test_include' which aren't used by drm_hwc
but causing build failures for CI due to missing dependencies.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Matvii Zorin <matvii.zorin@globallogic.com>
diff --git a/tests/worker_test.cpp b/tests/worker_test.cpp
index cb6275e..d1eb2b3 100644
--- a/tests/worker_test.cpp
+++ b/tests/worker_test.cpp
@@ -8,17 +8,13 @@
using android::Worker;
struct TestWorker : public Worker {
- TestWorker()
- : Worker("test-worker", HAL_PRIORITY_URGENT_DISPLAY),
- value(0),
- enabled_(false) {
- }
+ TestWorker() : Worker("test-worker", HAL_PRIORITY_URGENT_DISPLAY){};
int Init() {
return InitWorker();
}
- void Routine() {
+ void Routine() override {
Lock();
if (!enabled_) {
int ret = WaitForSignalOrExitLocked();
@@ -47,16 +43,17 @@
Signal();
}
- int value;
+ // NOLINTNEXTLINE: should not be public
+ int value{};
private:
- bool enabled_;
+ bool enabled_{};
};
struct WorkerTest : public testing::Test {
TestWorker worker;
- virtual void SetUp() {
+ void SetUp() override {
worker.Init();
}
@@ -65,7 +62,8 @@
}
};
-TEST_F(WorkerTest, test_worker) {
+// NOLINTNEXTLINE: required by gtest macros
+TEST_F(WorkerTest, TestWorker) {
// already isInitialized so should succeed
ASSERT_TRUE(worker.initialized());
@@ -102,7 +100,8 @@
ASSERT_FALSE(worker.initialized());
}
-TEST_F(WorkerTest, exit_while_running) {
+// NOLINTNEXTLINE: required by gtest macros
+TEST_F(WorkerTest, ExitWhileRunning) {
worker.Control(true);
std::this_thread::sleep_for(std::chrono::milliseconds(50));