Compare commits

..

2 commits

Author SHA1 Message Date
a4f68c9959 Minor tweaks to actions/workflows files (unittest)
All checks were successful
Run UnitTests / build-and-run-tests (push) Successful in 1m24s
2024-07-13 11:38:52 +09:00
ba2697d0b8 Add example CMake project that uses UDPC 2024-07-13 11:33:37 +09:00
6 changed files with 54 additions and 2 deletions

View file

@ -2,7 +2,7 @@ name: Run UnitTests
on:
push:
branches:
- '*'
- 'conan'
jobs:
build-and-run-tests:

View file

@ -2,7 +2,7 @@ name: Run UnitTests
on:
push:
branches:
- '*'
- 'conan'
jobs:
build-and-run-tests:

View file

@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.7)
project(UDPC_NetworkTest C)
set(UDPC_NetworkTest_SOURCES
src/UDPC_NetworkTest.c
)
add_compile_options(
-Wall -Wextra -Wpedantic -Wno-missing-braces
$<$<COMPILE_LANGUAGE:CXX>:-Weffc++>
$<$<CONFIG:DEBUG>:-Og>
)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug', none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
endif()
find_package(udpc CONFIG REQUIRED)
add_executable(UDPC_NetworkTest
${UDPC_NetworkTest_SOURCES}
)
target_link_libraries(UDPC_NetworkTest udpc::udpc)

View file

@ -0,0 +1,9 @@
[requires]
udpc/1.0
[generators]
CMakeDeps
CMakeToolchain
[options]
udpc*:shared=True

View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
cd "$(dirname "$0")"
set -ve
if ! [[ -e "${HOME}/.conan2/profiles/default" ]]; then
conan profile detect
fi
if ! grep stephens_forgejo "${HOME}/.conan2/remotes.json" >&/dev/null; then
conan remote add stephens_forgejo "https://git.seodisparate.com/api/packages/stephenseo/conan"
fi
conan install . -r stephens_forgejo -r conancenter --output-folder=buildConan --build=missing
cmake -S . -B buildConan -DCMAKE_TOOLCHAIN_FILE=buildConan/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build buildConan

View file

@ -0,0 +1 @@
../../src/test/UDPC_NetworkTest.c