From 153e222d05d00dbe88940d8afa743f46e1ab1b14 Mon Sep 17 00:00:00 2001 From: wangrong Date: Tue, 17 Nov 2026 16:57:29 +0800 Subject: [PATCH] chore: move stub_linux from 3rdparty to tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Move stub_linux headers from 3rdparty/ to tests/ directory 2. Update include_directories path in src/CMakeLists.txt 3. Update file path in debian/copyright 4. Remove obsolete 3rdparty filter from lcov commands Influence: 1. Verify test build with DOTEST enabled 2. Confirm stub headers are found at new path chore: 将 stub_linux 从 3rdparty 移至 tests 1. 将 stub_linux 头文件从 3rdparty/ 移至 tests/ 目录 2. 更新 src/CMakeLists.txt 中的 include_directories 路径 3. 更新 debian/copyright 中的文件路径 4. 移除 lcov 命令中过时的 3rdparty 过滤规则 Influence: 1. 验证启用 DOTEST 时测试构建正常 2. 确认 stub 头文件在新路径下可被找到 Log: 将 stub_linux 从 3rdparty 移至 tests 目录 PMS: TASK-398525 --- .reuse/dep5 | 6 +++--- debian/copyright | 2 +- src/CMakeLists.txt | 2 +- {3rdparty => tests}/stub_linux/addr_any.h | 0 {3rdparty => tests}/stub_linux/addr_pri.h | 0 {3rdparty => tests}/stub_linux/elfio.hpp | 0 {3rdparty => tests}/stub_linux/stub.h | 0 tests/test-prj-running.sh | 6 +++--- 8 files changed, 8 insertions(+), 8 deletions(-) rename {3rdparty => tests}/stub_linux/addr_any.h (100%) rename {3rdparty => tests}/stub_linux/addr_pri.h (100%) rename {3rdparty => tests}/stub_linux/elfio.hpp (100%) rename {3rdparty => tests}/stub_linux/stub.h (100%) diff --git a/.reuse/dep5 b/.reuse/dep5 index eee2947d..60e92e37 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -54,7 +54,7 @@ Copyright: UnionTech Software Technology Co., Ltd. License: GPL-3.0-or-later # tests -Files: tests/* +Files: tests/test* Copyright: UnionTech Software Technology Co., Ltd. License: GPL-3.0-or-later @@ -68,7 +68,7 @@ Files: deepin-ocr.desktop Copyright: UnionTech Software Technology Co., Ltd. License: CC-BY-4.0 -# 3rdparty/stub_linux -Files: 3rdparty/stub_linux/* +# tests/stub_linux +Files: tests/stub_linux/* Copyright: coolxv 2019 License: MIT diff --git a/debian/copyright b/debian/copyright index 8470a51a..8bb53c47 100644 --- a/debian/copyright +++ b/debian/copyright @@ -11,7 +11,7 @@ Files: debian/* Copyright: 2022 Deepin.Inc License: Expat -Files: 3rdparty/stub_linux/* +Files: tests/stub_linux/* Copyright: 2020 Zhang Yu License: MIT diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d8f2a0a6..022baf1d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -113,7 +113,7 @@ if(DOTEST) SET(PROJECT_NAME_TEST ${PROJECT_NAME}_test) include_directories(./../tests/) - include_directories(./../3rdparty/stub_linux/) + include_directories(./../tests/stub_linux/) aux_source_directory(./../tests/ allTestSource) aux_source_directory(./view allTestSource) diff --git a/3rdparty/stub_linux/addr_any.h b/tests/stub_linux/addr_any.h similarity index 100% rename from 3rdparty/stub_linux/addr_any.h rename to tests/stub_linux/addr_any.h diff --git a/3rdparty/stub_linux/addr_pri.h b/tests/stub_linux/addr_pri.h similarity index 100% rename from 3rdparty/stub_linux/addr_pri.h rename to tests/stub_linux/addr_pri.h diff --git a/3rdparty/stub_linux/elfio.hpp b/tests/stub_linux/elfio.hpp similarity index 100% rename from 3rdparty/stub_linux/elfio.hpp rename to tests/stub_linux/elfio.hpp diff --git a/3rdparty/stub_linux/stub.h b/tests/stub_linux/stub.h similarity index 100% rename from 3rdparty/stub_linux/stub.h rename to tests/stub_linux/stub.h diff --git a/tests/test-prj-running.sh b/tests/test-prj-running.sh index 2440ac75..153f7b33 100755 --- a/tests/test-prj-running.sh +++ b/tests/test-prj-running.sh @@ -1,6 +1,6 @@ #!/bin/bash -# SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +# SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: CC0-1.0 @@ -43,7 +43,7 @@ lcov --directory ./src/CMakeFiles/deepin-ocr_test.dir --zerocounters lcov --directory . --capture --output-file ./coverageResult/deepin-ocr_Coverage.info echo \ ===================\ do\ filter\ begin\ ====================\ -lcov --remove ./coverageResult/deepin-ocr_Coverage.info '*/3rdparty/*' '*/deepin-ocr_test_autogen/*' '*/deepin-ocr_autogen/*' '*/usr/include/*' '*/usr/local/*' '*/tests/*' '*/googletest/*' -o ./coverageResult/deepin-ocr_Coverage.info +lcov --remove ./coverageResult/deepin-ocr_Coverage.info '*/deepin-ocr_test_autogen/*' '*/deepin-ocr_autogen/*' '*/usr/include/*' '*/usr/local/*' '*/tests/*' '*/googletest/*' -o ./coverageResult/deepin-ocr_Coverage.info echo \ ===================\ do\ filter\ end\ ====================\ genhtml -o ./coverageResult/report ./coverageResult/deepin-ocr_Coverage.info @@ -51,7 +51,7 @@ sleep 2 lcov --directory . --capture --output-file ./coverageResult/deepin-ocr_Coverage.info echo \ ===================\ do\ filter\ begin\ ====================\ -lcov --remove ./coverageResult/deepin-ocr_Coverage.info '*/3rdparty/*' '*/deepin-ocr_test_autogen/*' '*/deepin-ocr_autogen/*' '*/usr/include/*' '*/usr/local/*' '*/tests/*' '*/googletest/*' -o ./coverageResult/deepin-ocr_Coverage.info +lcov --remove ./coverageResult/deepin-ocr_Coverage.info '*/deepin-ocr_test_autogen/*' '*/deepin-ocr_autogen/*' '*/usr/include/*' '*/usr/local/*' '*/tests/*' '*/googletest/*' -o ./coverageResult/deepin-ocr_Coverage.info echo \ ===================\ do\ filter\ end\ ====================\ genhtml -o ./coverageResult/report ./coverageResult/deepin-ocr_Coverage.info