From 6cd88afe47dd3ac12d46954c015d5a785b8fc033 Mon Sep 17 00:00:00 2001 From: Aster Seker Date: Mon, 15 Sep 2025 02:37:31 +0300 Subject: [PATCH 1/2] ci(workflow): add sanitizer jobs --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 491b5d4..812778b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,6 +103,36 @@ jobs: build/Testing/Temporary/LastTest.log if-no-files-found: ignore + asan-ubsan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - run: git submodule update --init --recursive + - name: Configure + run: cmake -S . -B build -DLOG_IT_CPP_BUILD_TESTS=ON -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS='-fsanitize=address,undefined' -DCMAKE_LINKER_FLAGS='-fsanitize=address,undefined' + - name: Build + run: cmake --build build + - name: Test + run: ctest --test-dir build + + tsan: + runs-on: ubuntu-latest + env: + LOGIT_PROFILE: thread + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - run: git submodule update --init --recursive + - name: Configure + run: cmake -S . -B build -DLOG_IT_CPP_BUILD_TESTS=ON -DLOGIT_FORCE_ASYNC_OFF=OFF -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS='-fsanitize=thread' -DCMAKE_LINKER_FLAGS='-fsanitize=thread' + - name: Build + run: cmake --build build + - name: Test + run: ctest --test-dir build + vcpkg-install: runs-on: ubuntu-latest env: From 26afee6d7f2835cf8b6058287ddc9f0d052a7680 Mon Sep 17 00:00:00 2001 From: Aster Seker Date: Mon, 15 Sep 2025 03:09:20 +0300 Subject: [PATCH 2/2] test(file_logger): shut down logger --- tests/file_logger_test.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/file_logger_test.cpp b/tests/file_logger_test.cpp index f5266e0..e81abd6 100644 --- a/tests/file_logger_test.cpp +++ b/tests/file_logger_test.cpp @@ -11,10 +11,13 @@ int main() { const std::string log_path = LOGIT_GET_LAST_FILE_PATH(0); std::ifstream in(log_path); std::string line; + bool found = false; while (std::getline(in, line)) { if (line.find(message) != std::string::npos) { - return 0; + found = true; + break; } } - return 1; + LOGIT_SHUTDOWN(); + return found ? 0 : 1; }