test: Googletest commit #2167
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Integration tests | |
on: | |
push: | |
branches: [ dev, main ] | |
pull_request: | |
branches: [ dev, main ] | |
jobs: | |
# Job: Check clang format | |
# ----------------------- | |
clang: | |
if: true | |
name: Check clang format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jidicula/clang-format-action@v4.11.0 | |
with: | |
clang-format-version: '17' | |
# Job: Configure, build and test Ubuntu | |
# ------------------------------------- | |
# ubuntu-18.04 isn't used for tests because it doesn't support open standard | |
# ISO C++20 that we declared to use for UPnPlib. | |
Build_Ubuntu: | |
if: true | |
name: Test Ubuntu | |
needs: [ clang ] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
buildtype: [ 'Release', 'Debug' ] | |
googletest: [ '-D UPNPLIB_WITH_GOOGLETEST=ON', '-D UPNPLIB_WITH_GOOGLETEST=ON -D UPNPLIB_WITH_OPENSSL=OFF' ] | |
fail-fast: false | |
steps: | |
# Step building upnplib | |
- uses: actions/checkout@v4 | |
- name: Configure | |
run: > | |
cmake | |
-S . | |
-B build | |
--log-level=DEBUG | |
-D CMAKE_C_COMPILER=gcc-13 | |
-D CMAKE_CXX_COMPILER=g++-13 | |
-D CMAKE_BUILD_TYPE=${{matrix.buildtype}} | |
${{matrix.googletest}} | |
- name: Build | |
run: cmake --build build --config ${{matrix.buildtype}} | |
#- if: (matrix.googletest == '-D UPNPLIB_WITH_GOOGLETEST=ON -D UPNPLIB_WITH_OPENSSL=OFF') | |
# name: Check gtest library files, static | |
# run: | | |
# ls ./build/lib/libgtest.a | |
# ls ./build/lib/libgmock.a | |
# ls ./build/lib/libgtest_main.a | |
# ls ./build/lib/libgmock_main.a | |
- if: (matrix.googletest == '-D UPNPLIB_WITH_GOOGLETEST=ON') | |
name: Check gtest library files, shared | |
run: | | |
ls ./build/lib/libgtest.so | |
ls ./build/lib/libgmock.so | |
ls ./build/lib/libgtest_main.so | |
ls ./build/lib/libgmock_main.so | |
- if: matrix.buildtype != 'Debug' | |
name: Verify if NO Debug info | |
# These two libraries are always built | |
run: | | |
objdump -g ./build/lib/libpupnp_shared.so | grep --ignore-case --max-count=1 --invert-match "Contents of the .debug_info section" | |
objdump -g ./build/lib/libcompa_shared.so | grep --ignore-case --max-count=1 --invert-match "Contents of the .debug_info section" | |
objdump -g ./build/lib/libupnplib_shared.so | grep --ignore-case --max-count=1 --invert-match "Contents of the .debug_info section" | |
ls ./build/lib/libpupnp_static.a | |
ls ./build/lib/libcompa_static.a | |
ls ./build/lib/libupnplib_static.a | |
- if: matrix.buildtype == 'Debug' | |
name: Verify if Debug info | |
# These two libraries are always built | |
run: | | |
objdump -g ./build/lib/libpupnp_shared.so | grep --ignore-case --max-count=1 "Contents of the .debug_info section" | |
objdump -g ./build/lib/libcompa_shared.so | grep --ignore-case --max-count=1 "Contents of the .debug_info section" | |
objdump -g ./build/lib/libupnplib_shared.so | grep --ignore-case --max-count=1 "Contents of the .debug_info section" | |
ls ./build/lib/libpupnp_static.a | |
ls ./build/lib/libcompa_static.a | |
ls ./build/lib/libupnplib_static.a | |
#- name: Run upnplib info programs | |
# # This program is always built | |
# run: ./build/bin/upnplib-pst; ./build/bin/upnplib-psh; ./build/bin/upnplib-cst; ./build/bin/upnplib-csh | |
- name: Run gtests | |
run: | | |
cd ./build/Utest | |
ctest --timeout 6 --output-on-failure | |
- name: Run gtests with debug output | |
run: | | |
cd ./build/Utest | |
UPNPLIB_DEBUG=true ctest --timeout 6 --output-on-failure | |
# Job: Configure, build and test MacOS | |
#------------------------------------- | |
Build_MacOS: | |
if: true | |
name: Test MacOS | |
needs: [ clang ] | |
runs-on: macOS-latest | |
strategy: | |
matrix: | |
buildtype: [ 'Release', 'Debug' ] | |
googletest: [ '-D UPNPLIB_WITH_GOOGLETEST=ON', '-D UPNPLIB_WITH_GOOGLETEST=ON -D UPNPLIB_WITH_OPENSSL=OFF' ] | |
fail-fast: false | |
steps: | |
# Steps to build and test upnplib | |
- uses: actions/checkout@v4 | |
- name: Configure | |
run: > | |
cmake | |
-S . | |
-B build | |
--log-level=DEBUG | |
-D CMAKE_BUILD_TYPE=${{matrix.buildtype}} | |
${{matrix.googletest}} | |
- name: Build | |
run: cmake --build build --config ${{matrix.buildtype}} | |
#- if: (matrix.googletest == '-D UPNPLIB_WITH_GOOGLETEST=ON -D UPNPLIB_WITH_OPENSSL=OFF') | |
# name: Check gtest library files, static | |
# run: | | |
# ls ./build/lib/libgtest.a | |
# ls ./build/lib/libgmock.a | |
# ls ./build/lib/libgtest_main.a | |
# ls ./build/lib/libgmock_main.a | |
- if: (matrix.googletest == '-D UPNPLIB_WITH_GOOGLETEST=ON') | |
name: Check gtest library files, shared | |
run: | | |
ls ./build/lib/libgtest.dylib | |
ls ./build/lib/libgmock.dylib | |
ls ./build/lib/libgtest_main.dylib | |
ls ./build/lib/libgmock_main.dylib | |
- if: matrix.buildtype != 'Debug' | |
name: Verify if NO Debug info | |
# These two libraries are always built | |
run: | | |
ls ./build/lib/libpupnp_shared.dylib | |
ls ./build/lib/libcompa_shared.dylib | |
ls ./build/lib/libupnplib_shared.dylib | |
ls ./build/lib/libpupnp_static.a | |
ls ./build/lib/libcompa_static.a | |
ls ./build/lib/libupnplib_static.a | |
- if: matrix.buildtype == 'Debug' | |
name: Verify if Debug info | |
# These two libraries are always built | |
run: | | |
ls ./build/lib/libpupnp_shared.dylib | |
ls ./build/lib/libcompa_shared.dylib | |
ls ./build/lib/libupnplib_shared.dylib | |
ls ./build/lib/libpupnp_static.a | |
ls ./build/lib/libcompa_static.a | |
ls ./build/lib/libupnplib_static.a | |
#- name: Run upnplib info programs | |
# # This program is always built | |
# run: ./build/bin/upnplib-pst; ./build/bin/upnplib-psh; ./build/bin/upnplib-cst; ./build/bin/upnplib-csh | |
- name: Run gtests | |
run: | | |
cd ./build/Utest | |
ctest --timeout 6 --output-on-failure | |
- name: Run gtests with debug output | |
run: | | |
cd ./build/Utest | |
UPNPLIB_DEBUG=true ctest --timeout 6 --output-on-failure | |
# Job: Configure, build and test with Visual Studio | |
#-------------------------------------------------- | |
Build_with_Visual_Studio: | |
if: true | |
name: Test w/ VS | |
needs: [ clang ] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
buildtype: [ 'Release', 'Debug' ] | |
#buildtype: [ 'Release', 'Release', 'Release', 'Debug', 'Debug', 'Debug' ] | |
os: [ windows-2019, windows-2022 ] | |
googletest: [ '-D UPNPLIB_WITH_GOOGLETEST=ON', '-D UPNPLIB_WITH_GOOGLETEST=ON -D UPNPLIB_WITH_OPENSSL=OFF' ] | |
fail-fast: false | |
steps: | |
# Step building upnplib | |
- uses: actions/checkout@v4 | |
- if: matrix.os == 'windows-2019' | |
# need developer command prompt | |
name: Use MS Windows 32 bit | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: win32 | |
- if: matrix.os == 'windows-2022' | |
# need developer command prompt | |
name: Use MS Windows 64 bit | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: amd64 | |
- if: matrix.os == 'windows-2019' | |
name: Configure 32 bit | |
run: > | |
cmake | |
-S . | |
-B build | |
--log-level=DEBUG | |
-A Win32 ${{matrix.googletest}} | |
-D CMAKE_BUILD_TYPE=${{matrix.buildtype}} | |
-D UPNPLIB_WITH_OPENSSL=OFF | |
# We do not have a 32 bit OpenSSL library available. | |
- if: matrix.os == 'windows-2022' | |
name: Configure 64 bit | |
run: > | |
cmake | |
-S . | |
-B build ${{matrix.googletest}} | |
--log-level=DEBUG | |
-D CMAKE_BUILD_TYPE=${{matrix.buildtype}} | |
- name: Build | |
run: cmake --build build --config ${{matrix.buildtype}} | |
- if: (matrix.googletest == '-D UPNPLIB_WITH_GOOGLETEST=ON -D UPNPLIB_WITH_OPENSSL=OFF') | |
name: GTest link libraries build with Visual Studio | |
run: | | |
ls ./build/lib/${{matrix.buildtype}}/gtest.lib | |
ls ./build/lib/${{matrix.buildtype}}/gmock.lib | |
ls ./build/lib/${{matrix.buildtype}}/gtest_main.lib | |
ls ./build/lib/${{matrix.buildtype}}/gmock_main.lib | |
- if: (matrix.googletest == '-D UPNPLIB_WITH_GOOGLETEST=ON') | |
name: GTest .dll libraries build with Visual Studio | |
run: | | |
ls ./build/bin/${{matrix.buildtype}}/gtest.dll | |
ls ./build/bin/${{matrix.buildtype}}/gmock.dll | |
ls ./build/bin/${{matrix.buildtype}}/gtest_main.dll | |
ls ./build/bin/${{matrix.buildtype}}/gmock_main.dll | |
ls $env:SYSTEMROOT/System32/gtest.dll | |
ls $env:SYSTEMROOT/System32/gmock.dll | |
ls $env:SYSTEMROOT/System32/gtest_main.dll | |
ls $env:SYSTEMROOT/System32/gmock_main.dll | |
#- name: Run upnplib info programs | |
# run: ./build/bin/${{matrix.buildtype}}/upnplib-pst.exe; ./build/bin/${{matrix.buildtype}}/upnplib-psh.exe; ./build/bin/${{matrix.buildtype}}/upnplib-cst.exe; ./build/bin/${{matrix.buildtype}}/upnplib-csh.exe | |
- name: Run gtests | |
run: | | |
$env:path += ";./build/bin/${{matrix.buildtype}}" | |
cd ./build/Utest | |
ctest -C ${{matrix.buildtype}} --timeout 9 --output-on-failure | |
- name: Run gtests with debug output | |
run: | | |
$env:UPNPLIB_DEBUG = "set" | |
cd ./build/Utest | |
ctest -C ${{matrix.buildtype}} --timeout 9 --output-on-failure | |
# Job: Configure, build and test with NMake | |
#------------------------------------------ | |
Build_with_NMake: | |
if: false | |
name: Test w/ NMake | |
needs: [ Build_Ubuntu, Build_MacOS ] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
buildtype: [ 'Release', 'Debug' ] | |
#buildtype: [ 'Release', 'Release', 'Release', 'Debug', 'Debug', 'Debug' ] | |
os: [ windows-2019, windows-2022 ] | |
googletest: [ '-D UPNPLIB_WITH_GOOGLETEST=ON', '-D UPNPLIB_WITH_GOOGLETEST=ON -D UPNPLIB_WITH_OPENSSL=OFF' ] | |
fail-fast: false | |
steps: | |
# Step building upnplib | |
- uses: actions/checkout@v4 | |
- if: matrix.os == 'windows-2019' | |
# need developer command prompt | |
name: Use MS Windows 32 bit | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: win32 | |
- if: matrix.os == 'windows-2022' | |
# need developer command prompt | |
name: Use MS Windows 64 bit | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: amd64 | |
- if: matrix.os == 'windows-2019' | |
name: Configure 32 bit | |
run: > | |
cmake | |
-S . | |
-B build | |
--log-level=DEBUG | |
-G "NMake Makefiles" ${{matrix.googletest}} | |
-D CMAKE_BUILD_TYPE=${{matrix.buildtype}} | |
-D UPNPLIB_WITH_OPENSSL=OFF | |
# We do not have a 32 bit OpenSSL library available. | |
- if: matrix.os == 'windows-2022' | |
name: Configure 64 bit | |
run: > | |
cmake | |
-S . | |
-B build | |
--log-level=DEBUG | |
-G "NMake Makefiles" ${{matrix.googletest}} | |
-D CMAKE_BUILD_TYPE=${{matrix.buildtype}} | |
- name: Build | |
run: cmake --build build --config ${{matrix.buildtype}} | |
- if: (matrix.googletest == '-D UPNPLIB_WITH_GOOGLETEST=ON -D UPNPLIB_WITH_OPENSSL=OFF') | |
name: GTest link libraries build with NMake | |
run: | | |
ls ./build/lib/gtest.lib | |
ls ./build/lib/gmock.lib | |
ls ./build/lib/gtest_main.lib | |
ls ./build/lib/gmock_main.lib | |
- if: (matrix.googletest == '-D UPNPLIB_WITH_GOOGLETEST=ON') | |
name: GTest .dll libraries build with NMake | |
run: | | |
ls ./build/bin/gtest.dll | |
ls ./build/bin/gmock.dll | |
ls ./build/bin/gtest_main.dll | |
ls ./build/bin/gmock_main.dll | |
ls $env:SYSTEMROOT/System32/gtest.dll | |
ls $env:SYSTEMROOT/System32/gmock.dll | |
ls $env:SYSTEMROOT/System32/gtest_main.dll | |
ls $env:SYSTEMROOT/System32/gmock_main.dll | |
#- name: Run upnplib info programs | |
# run: ./build/bin/upnplib-pst.exe; ./build/bin/upnplib-psh.exe; ./build/bin/upnplib-cst.exe; ./build/bin/upnplib-csh.exe | |
- name: Run gtests | |
run: | | |
$env:path += ";./build/bin" | |
cd ./build/Utest | |
ctest -C ${{matrix.buildtype}} --timeout 9 --output-on-failure | |
- name: Run gtests with debug output | |
run: | | |
$env:UPNPLIB_DEBUG = "set" | |
cd ./build/Utest | |
ctest -C ${{matrix.buildtype}} --timeout 9 --output-on-failure | |
# Job: Run build tests | |
# -------------------- | |
build_tests: | |
if: true | |
name: "build tests" | |
#needs: [ Build_with_Visual_Studio, Build_with_NMake ] | |
needs: [ Build_Ubuntu, Build_MacOS, Build_with_Visual_Studio ] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macOS-latest, windows-latest ] | |
buildtype: [ 'Release', 'Debug' ] | |
option: [ '', | |
'-DUPNPLIB_WITH_OPENSSL=OFF -DUPNPLIB_WITH_MINISERVER=OFF -DUPNPLIB_WITH_WEBSERVER=OFF -DUPNPLIB_WITH_CTRLPT_SSDP=OFF -DUPNPLIB_WITH_DEVICE_SSDP=OFF -DUPNPLIB_WITH_OPTION_SSDP=OFF -DUPNPLIB_WITH_CTRLPT_DESCRIPTION=OFF -DUPNPLIB_WITH_DEVICE_DESCRIPTION=OFF -DUPNPLIB_WITH_CTRLPT_SOAP=OFF -DUPNPLIB_WITH_DEVICE_SOAP=OFF -DUPNPLIB_WITH_CTRLPT_GENA=OFF -DUPNPLIB_WITH_DEVICE_GENA=OFF -DUPNPLIB_WITH_IXML=OFF -DUPNPLIB_WITH_TOOLS=OFF -DUPNPLIB_WITH_SAMPLES=OFF -DUPNPLIB_WITH_GOOGLETEST=OFF -DUPNPLIB_WITH_TRACE=OFF -DGTESTS_WITH_SHARED_LIBS=OFF', | |
'-DUPNPLIB_WITH_OPENSSL=ON', | |
'-DUPNPLIB_WITH_MINISERVER=ON', | |
'-DUPNPLIB_WITH_WEBSERVER=ON', | |
'-DUPNPLIB_WITH_CTRLPT_SSDP=ON', | |
'-DUPNPLIB_WITH_DEVICE_SSDP=ON', | |
'-DUPNPLIB_WITH_OPTION_SSDP=ON', | |
'-DUPNPLIB_WITH_CTRLPT_DESCRIPTION=ON', | |
'-DUPNPLIB_WITH_DEVICE_DESCRIPTION=ON', | |
'-DUPNPLIB_WITH_CTRLPT_SOAP=ON', | |
'-DUPNPLIB_WITH_DEVICE_SOAP=ON', | |
'-DUPNPLIB_WITH_CTRLPT_GENA=ON', | |
'-DUPNPLIB_WITH_DEVICE_GENA=ON', | |
'-DUPNPLIB_WITH_IXML=ON', | |
'-DUPNPLIB_WITH_TOOLS=ON', | |
'-DUPNPLIB_DEF_SAMPLES=ON -DUPNPLIB_DEF_DEVICE=ON', | |
'-DUPNPLIB_DEF_SAMPLES=ON -DUPNPLIB_DEF_CLIENT=ON', | |
'-DUPNPLIB_DEF_SAMPLES=ON -DUPNPLIB_DEF_COMBO=ON', | |
'-DUPNPLIB_WITH_SAMPLES=ON', | |
'-DUPNPLIB_WITH_TRACE=ON', | |
'-DUPNPLIB_WITH_OPENSSL=ON -DUPNPLIB_WITH_MINISERVER=ON -DUPNPLIB_WITH_WEBSERVER=ON -DUPNPLIB_WITH_CTRLPT_SSDP=ON -DUPNPLIB_WITH_DEVICE_SSDP=ON -DUPNPLIB_WITH_OPTION_SSDP=ON -DUPNPLIB_WITH_CTRLPT_DESCRIPTION=ON -DUPNPLIB_WITH_DEVICE_DESCRIPTION=ON -DUPNPLIB_WITH_CTRLPT_SOAP=ON -DUPNPLIB_WITH_DEVICE_SOAP=ON -DUPNPLIB_WITH_CTRLPT_GENA=ON -DUPNPLIB_WITH_DEVICE_GENA=ON -DUPNPLIB_WITH_IXML=ON -DUPNPLIB_WITH_TOOLS=ON -DUPNPLIB_WITH_SAMPLES=ON -DUPNPLIB_WITH_GOOGLETEST=ON -DUPNPLIB_WITH_TRACE=ON -DGTESTS_WITH_SHARED_LIBS=ON' ] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- if: matrix.os == 'windows-latest' | |
# need developer command prompt | |
name: Use MS Windows 64 bit | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: amd64 | |
- if: runner.os == 'Linux' | |
name: Configure Linux | |
run: > | |
cmake | |
-S . | |
-B build | |
--log-level=DEBUG | |
-D CMAKE_C_COMPILER=gcc-13 | |
-D CMAKE_CXX_COMPILER=g++-13 | |
-D CMAKE_BUILD_TYPE=${{matrix.buildtype}} | |
${{matrix.option}} | |
- if: runner.os == 'macOS' | |
name: Configure macOS | |
run: > | |
cmake | |
-S . | |
-B build | |
--log-level=DEBUG | |
-D CMAKE_BUILD_TYPE=${{matrix.buildtype}} | |
${{matrix.option}} | |
- if: runner.os == 'Windows' | |
name: Configure Windows | |
run: > | |
cmake | |
-S . | |
-B build | |
--log-level=DEBUG | |
-D CMAKE_BUILD_TYPE=${{matrix.buildtype}} ${{matrix.option}} | |
- name: Build | |
run: cmake --build build --config ${{matrix.buildtype}} |