Skip to content

Commit

Permalink
external TlsTest.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
talregev committed Oct 17, 2024
1 parent 4a0298f commit df2eeb8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 29 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/build-reuse-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,18 @@ jobs:
shell: pwsh
run: scripts/prepare-machine.ps1 -ForBuild -Tls ${{ inputs.tls }}
- name: Build For Test
if: inputs.build == '-Test'
shell: pwsh
run: scripts/build.ps1 -Config ${{ inputs.config }} -Platform ${{ inputs.plat }} -Arch ${{ inputs.arch }} -Tls ${{ inputs.tls }} -DisablePerf -DynamicCRT ${{ inputs.sanitize }}
- name: Build External Platform Test
if: inputs.build == '-Test'
shell: pwsh
run: |
scripts/build.ps1 -Config ${{ inputs.config }} -Platform ${{ inputs.plat }} -Arch ${{ inputs.arch }} -Tls ${{ inputs.tls }} -DisablePerf -DynamicCRT ${{ inputs.sanitize }}
echo ================
($pwd).path
dir artifacts\lib
echo ================
cmake src/platform/unittest/external -B build
cmake --build build
cmake --install build
cmake --install build\${{ inputs.plat }}\${{ inputs.arch }}_${{ inputs.tls }} --config ${{ inputs.config }}
copy build\${{ inputs.plat }}\${{ inputs.arch }}_${{ inputs.tls }}\lib\${{ inputs.config }}\* "C:\Program Files\msquic\lib\"
copy submodules\googletest\googletest\include\gtest "C:\Program Files\msquic\include\" -Recurse
cmake src/platform/unittest/external -G "Visual Studio 17 2022" -A ${{ inputs.arch }} -B build_external "-DCMAKE_INSTALL_PREFIX:PATH=C:/Program Files/msquic"
cmake --build build_external --config Releases
- name: Build For Perf
if: inputs.build == '-Perf'
shell: pwsh
Expand Down
39 changes: 18 additions & 21 deletions src/platform/unittest/external/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

cmake_minimum_required(VERSION 3.16)

project(msquic_platform_external)

find_package(msquic REQUIRED)
find_package(GTest REQUIRED)
FIND_LIBRARY(MSPLATFORM_LIBRARIES
find_library(MSPLATFORM_LIBRARIES
NAMES msquic_platform)
find_library(GTEST_LIBRARIES
NAMES gtest
PATHS ${CMAKE_INSTALL_PREFIX}/lib
)
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "MSPLATFORM_LIBRARIES: ${MSPLATFORM_LIBRARIES}")
message(STATUS "GTEST_LIBRARIES: ${GTEST_LIBRARIES}")

set(SOURCES
../main.cpp
../CryptTest.cpp
../DataPathTest.cpp
../PlatformTest.cpp
# ../CryptTest.cpp
# ../DataPathTest.cpp
# ../PlatformTest.cpp
# ../StorageTest.cpp
../TlsTest.cpp
)

add_executable(msquicplatformtest ${SOURCES})

# target_include_directories(msquicplatformtest PRIVATE ${PROJECT_SOURCE_DIR}/src/core)

# set_property(TARGET msquicplatformtest PROPERTY FOLDER "${QUIC_FOLDER_PREFIX}tests")
# set_property(TARGET msquicplatformtest APPEND PROPERTY BUILD_RPATH "$ORIGIN")

target_link_libraries(msquicplatformtest msquic ${MSPLATFORM_LIBRARIES} ncrypt crypt32 GTest::GTest)

# if (BUILD_SHARED_LIBS)
# target_link_libraries(msquicplatformtest ${MSPLATFORM_LIBRARIES} ncrypt crypt32)
# endif()

# target_link_libraries(msquicplatformtest inc gtest warnings logging base_link)

# add_test(NAME msquicplatformtest
# COMMAND msquicplatformtest
# WORKING_DIRECTORY ${QUIC_OUTPUT_DIR})
target_include_directories(msquicplatformtest PRIVATE ${CMAKE_INSTALL_PREFIX}/include)
target_link_libraries(msquicplatformtest msquic ${MSPLATFORM_LIBRARIES} ${GTEST_LIBRARIES} ws2_32 schannel ntdll bcrypt ncrypt crypt32 iphlpapi advapi32 winmm secur32 clang_rt.asan_dbg_dynamic-x86_64 clang_rt.asan_dynamic-x86_64)
target_compile_definitions(msquicplatformtest PRIVATE QUIC_EVENTS_STUB QUIC_LOGS_STUB)

0 comments on commit df2eeb8

Please sign in to comment.