feat: harden logger lifecycle and add tests

This commit is contained in:
2026-07-13 13:22:10 +08:00
parent 95a8067342
commit 62ed176bdd
8 changed files with 799 additions and 190 deletions
+13
View File
@@ -0,0 +1,13 @@
QT += core testlib
TEMPLATE = app
TARGET = MyLoggerTests
# 测试直接编译被测源码,并显式开启测试访问宏;不会链接或改写正式 MyLogger 动态库
CONFIG += testcase console c++17
DEFINES += MYLOGGER_STATIC MYLOGGER_TESTING QT_MESSAGELOGCONTEXT
INCLUDEPATH += $$PWD/..
HEADERS += $$PWD/../loghandler.h
SOURCES += \
$$PWD/tst_loghandler.cpp \
$$PWD/../loghandler.cpp