Skip to content

Commit

Permalink
Differentiate testing from the release
Browse files Browse the repository at this point in the history
  • Loading branch information
gon1332 committed Jan 23, 2025
1 parent 627bd5a commit a1673f1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Build on Ubuntu
run: |
cmake --preset package
cmake --build --preset package --target ptpd2
cmake --build --preset package
openbsd:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -86,4 +86,4 @@ jobs:
- name: Build on macOS
run: |
cmake --preset package
cmake --build --preset package --target ptpd2
cmake --build --preset package
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config_cmake.h.in ${CMAKE_CURRENT_BIN
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_compile_definitions(HAVE_CONFIG_H)

include(CTest)
add_subdirectory(external/Unity)
if (${TESTING})
include(CTest)
add_subdirectory(external/Unity)
endif ()

add_subdirectory(src)
12 changes: 10 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
}
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_C_COMPILER": "clang",
"TESTING": "ON"
}
},
{
Expand All @@ -31,7 +33,8 @@
}
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_C_COMPILER": "clang"
}
}
],
Expand All @@ -40,6 +43,11 @@
"name": "ut",
"configurePreset": "ut",
"targets": ["test_time_ops"]
},
{
"name": "package",
"configurePreset": "package",
"targets": ["ptpd2"]
}
],
"testPresets": [
Expand Down
4 changes: 3 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,6 @@ target_compile_definitions(ptpd2 PUBLIC
$<$<BOOL:${STATISTICS}>:PTPD_STATISTICS>
)

add_subdirectory(unit_tests)
if (${TESTING})
add_subdirectory(unit_tests)
endif ()

0 comments on commit a1673f1

Please sign in to comment.