Skip to content

Commit

Permalink
added temporary print message in CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdcvlsc committed May 30, 2024
1 parent f7cc534 commit 795e817
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/ctests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
fail-fast: false
matrix:
platform:
- { name: Windows VS2019, ls: dir, os: windows-2019}
- { name: Windows VS2022, ls: dir, os: windows-2022}
- { name: Windows Clang, ls: dir, os: windows-2022, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++}
- { name: Windows GCC, ls: dir, os: windows-2022, flags: -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++}
- { name: Linux Clang, ls: ls, os: ubuntu-latest, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
- { name: Linux, ls: ls, os: ubuntu-latest}
- { name: MacOS XCode, ls: ls, os: macos-latest}
- { name: Windows VS2019, ls: dir, os: windows-2019, flags: -DCMAKE_BUILD_TYPE=Debug }
- { name: Windows VS2022, ls: dir, os: windows-2022, flags: -DCMAKE_BUILD_TYPE=Debug }
- { name: Windows Clang, ls: dir, os: windows-2022, flags: -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
- { name: Windows GCC, ls: dir, os: windows-2022, flags: -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ }
- { name: Linux Clang, ls: ls, os: ubuntu-latest, flags: -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
- { name: Linux, ls: ls, os: ubuntu-latest, flags: -DCMAKE_BUILD_TYPE=Debug }
- { name: MacOS XCode, ls: ls, os: macos-latest, flags: -DCMAKE_BUILD_TYPE=Debug }
config:
- { cxx_version: 20 }
- { cxx_version: 23 }
Expand All @@ -35,5 +35,8 @@ jobs:
- name: Build
run: cmake --build tests --config Debug

- name: View Test Executables
run: cd tests && ${{matrix.platform.ls}} && cd ..

- name: Tests
run: ${{matrix.platform.ls}} tests && ctest --test-dir tests
run: ctest --test-dir tests
18 changes: 16 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,28 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)

# add_compile_definitions(USER_DEFINITION)

# if(WIN32)
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fsanitize=address")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fsanitize=address")
# else()
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
# endif()

enable_testing()

foreach(test_src_code ${SOURCES})
message(==================)
message(test_src_code=${test_src_code})
message(test_exec_name=${test_exec_name})
message(CMAKE_C_FLAGS=${CMAKE_C_FLAGS})
message(CMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS})
message(==================)
get_filename_component(test_exec_name ${test_src_code} NAME_WE)
add_executable(${test_exec_name} ${test_src_code})
# target_compile_features(${test_exec_name} PRIVATE cxx_std_11)
target_compile_options(${test_exec_name} PRIVATE -fsanitize=address)
target_link_options(${test_exec_name} PRIVATE -fsanitize=address)
# target_compile_options(${test_exec_name} PRIVATE -fsanitize=address)
# target_link_options(${test_exec_name} PRIVATE -fsanitize=address)
add_test(
NAME ${test_exec_name}
COMMAND $<TARGET_FILE:${test_exec_name}>
Expand Down

0 comments on commit 795e817

Please sign in to comment.