Skip to content

Commit 2c793bd

Browse files
committed
Merge branch 'sanitizer' of https://github.com/danielaparker/jsoncons
2 parents 242cdbc + e960b0c commit 2c793bd

File tree

3 files changed

+54
-3
lines changed

3 files changed

+54
-3
lines changed

.github/workflows/macos.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,48 @@ jobs:
7979
run: cmake --build build --parallel 10
8080
- name: test
8181
run: cd build ; ctest -j 10 --output-on-failure
82+
83+
84+
xcode_26:
85+
strategy:
86+
fail-fast: false
87+
matrix:
88+
xcode: ['26']
89+
build_type: [Debug, Release]
90+
runs-on: macos-latest
91+
92+
steps:
93+
- uses: actions/checkout@v5
94+
with:
95+
submodules: recursive
96+
- uses: maxim-lobanov/setup-xcode@v1
97+
with:
98+
xcode-version: ${{ matrix.xcode }}
99+
- name: cmake
100+
run: cmake -S . -B build -DJSONCONS_SANITIZE=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DJSONCONS_BUILD_TESTS=On
101+
- name: build
102+
working-directory: build/
103+
run: cmake --build .
104+
- name: test
105+
working-directory: build/
106+
run: ctest --output-on-failure
107+
- name: Cache
108+
uses: actions/[email protected]
109+
with:
110+
# A list of files, directories, and wildcard patterns to cache and restore
111+
path:
112+
# An explicit key for restoring and saving the cache
113+
key:
114+
# An ordered multiline string listing the prefix-matched keys, that are used for restoring stale cache if no cache hit occurred for key. Note `cache-hit` returns false in this case.
115+
restore-keys: # optional
116+
# The chunk size used to split up large files during upload, in bytes
117+
upload-chunk-size: # optional
118+
# An optional boolean when enabled, allows windows runners to save or restore caches that can be restored or saved respectively on other platforms
119+
enableCrossOsArchive: # optional, default is false
120+
# Fail the workflow if cache entry is not found
121+
fail-on-cache-miss: # optional, default is false
122+
# Check if a cache entry exists for the given input(s) (key, restore-keys) without downloading the cache
123+
lookup-only: # optional, default is false
124+
# Run the post step to save the cache even if another step before fails
125+
save-always: # optional, default is false
126+

test/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ include (CTest)
3131

3232
# -fsanitize=undefined clang issue
3333
if (JSONCONS_SANITIZE)
34-
if(NOT MSVC)
34+
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
35+
set(CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER ON)
36+
message(STATUS "MACOS SANITIZE ON")
37+
elseif(NOT MSVC)
3538
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fsanitize=address -fno-omit-frame-pointer")
36-
message(STATUS "SANITIZE ON")
39+
message(STATUS "NOT MSVC SANITIZE ON")
3740
endif()
3841
endif()
39-
4042
if(MSVC)
4143
set(CMAKE_EXE_LINKER_FLAGS /MANIFEST:NO)
4244
endif()

test/corelib/src/testmain.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
TEST_CASE("configuration")
99
{
10+
//memory leak test
11+
//char* p = new char [10];
12+
//p[0] = 0;
13+
1014
#if defined(__clang__)
1115
std::cout << "clang" << "\n";
1216
#elif defined(__GNUC__)

0 commit comments

Comments
 (0)