Skip to content

test(log): add GTest cases for unified logging category infrastructure - #428

Draft
pengfeixx wants to merge 1 commit into
linuxdeepin:masterfrom
pengfeixx:ut-supplement/deepin-reader-20261021
Draft

pengfeixx wants to merge 1 commit into
linuxdeepin:masterfrom
pengfeixx:ut-supplement/deepin-reader-20261021

Conversation

@pengfeixx

@pengfeixx pengfeixx commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Add tests/ut_ddlog.cpp to verify the logging category changes from
commit 0d6a90c:

  • ddlog.h is a pure Qt header (compiles without DTK dependencies)
  • appLog, batchprintLog, htmltopdfLog, dpfLog category names match expected
    org.deepin.reader* namespace
  • Filter rules can individually control each category
  • Wildcard rule org.deepin.reader* uniformly controls all module categories

Log: 补充日志分类统一改造的单元测试

Summary by Sourcery

Verify the unified logging category infrastructure and its filtering behavior with focused unit tests.

Enhancements:

  • Add GoogleTest coverage for unified Qt logging categories, including expected names, per-category filter control, and wildcard filtering across reader modules.

Tests:

  • Add unit tests validating logging category names, filter-rule behavior, wildcard controls, and independent category configuration.

Chores:

  • Update ignore rules for the new test artifacts.

Add tests/ut_ddlog.cpp to verify the logging category changes from
commit 0d6a90c:
- ddlog.h is a pure Qt header (compiles without DTK dependencies)
- appLog, batchprintLog, htmltopdfLog, dpfLog category names match expected
  org.deepin.reader* namespace
- Filter rules can individually control each category
- Wildcard rule org.deepin.reader* uniformly controls all module categories

Log: 补充日志分类统一改造的单元测试
@github-actions

Copy link
Copy Markdown
  • 检测到敏感词export变动
详情
    {
    "export": {
        "tests/ut_ddlog.cpp": {
            "b": [
                "// that the library exports the symbol correctly."
            ]
        }
    }
}

@deepin-ci-robot

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pengfeixx

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai

sourcery-ai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Reviewer's Guide

Introduces GTest coverage for the unified Qt logging categories, validating category names, per-category and wildcard filter behavior, and isolation of module-specific overrides; the tests also exercise the Qt-only ddlog header and exported PDFium logging symbol.

File-Level Changes

Change Details Files
Adds a dedicated GTest suite covering the unified Qt logging category infrastructure.
  • Verifies each exported category uses the expected org.deepin.reader namespace.
  • Checks category-specific filter rules for enabling and disabling log levels.
  • Tests wildcard rules that uniformly enable or disable all module categories.
  • Confirms an individual module override does not affect sibling categories.
  • Resets global Qt logging filter rules after each test.
  • Declares the PDFium category locally to validate the exported library symbol without adding private include paths.
tests/ut_ddlog.cpp
Updates repository ignore configuration for the new test/build artifacts.
  • Adds an ignore rule to prevent generated files from being tracked.
.gitignore

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants