| 1 | // SPDX-FileCopyrightText: 2022-2026 UnionTech Software Technology Co., Ltd. |
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | |
| 5 | #include <gtest/gtest.h> |
| 6 | #include <QApplication> |
| 7 | #include <QLoggingCategory> |
| 8 | #if defined(CMAKE_SAFETYTEST_ARG_ON) |
| 9 | #include <sanitizer/asan_interface.h> |
| 10 | #endif |
| 11 | |
| 12 | // 定义日志分类(等同于 application/main.cpp 中的定义) |
| 13 | Q_LOGGING_CATEGORY(logApp, "org.deepin.log.viewer.main") |
| 14 | |
| 15 | int main(int argc, char *argv[]) |
| 16 | { |
| 17 | qputenv("QT_QPA_PLATFORM", "offscreen"); |
| 18 | QApplication a(argc, argv); |
| 19 | |
| 20 | testing::InitGoogleTest(&argc, argv); |
| 21 | int ret = RUN_ALL_TESTS(); |
| 22 | |
| 23 | #if defined(CMAKE_SAFETYTEST_ARG_ON) |
| 24 | __sanitizer_set_report_path("asan.log"); |
| 25 | #endif |
| 26 | return ret; |
| 27 | } |