Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 5 additions & 2 deletions tests/file_logger_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Loading