feature add test for host
Some checks failed
rpcrypto-build / build (Debug, hisiv500.toolchain.cmake) (push) Successful in 1m6s
rpcrypto-build / build (Debug, hisiv510.toolchain.cmake) (push) Successful in 1m5s
rpcrypto-build / build (Debug, himix200.toolchain.cmake) (push) Successful in 1m19s
rpcrypto-build / build (Debug, mips64el-linux-gnuabi64.toolchain.cmake) (push) Successful in 1m6s
rpcrypto-build / build (Debug, host.toolchain.cmake) (push) Failing after 2m23s
rpcrypto-build / build (Debug, mipsel-openwrt-linux-musl.toolchain.cmake) (push) Successful in 1m6s
rpcrypto-build / build (Debug, mipsel-openwrt-linux.toolchain.cmake) (push) Successful in 1m21s
rpcrypto-build / build (Release, hisiv500.toolchain.cmake) (push) Successful in 1m12s
rpcrypto-build / build (Release, himix200.toolchain.cmake) (push) Successful in 1m17s
rpcrypto-build / build (Release, hisiv510.toolchain.cmake) (push) Successful in 1m27s
rpcrypto-build / build (Debug, host-afl.toolchain.cmake) (push) Successful in 4m30s
rpcrypto-build / build (Release, mips64el-linux-gnuabi64.toolchain.cmake) (push) Successful in 1m12s
rpcrypto-build / build (Release, mipsel-openwrt-linux-musl.toolchain.cmake) (push) Successful in 1m21s
rpcrypto-build / build (Release, host-afl.toolchain.cmake) (push) Successful in 2m56s
rpcrypto-build / build (Release, mipsel-openwrt-linux.toolchain.cmake) (push) Successful in 1m13s
rpcrypto-build / build (Release, host.toolchain.cmake) (push) Has been cancelled

This commit is contained in:
tqcq 2023-12-05 15:46:14 +08:00
parent 908af0858c
commit 2728f2d5e7
8 changed files with 33 additions and 2 deletions

View File

@ -52,7 +52,13 @@ jobs:
run: |
sudo apt-get update -y
sudo apt-get install -y libarchive-dev libssl-dev autoconf libtool pkg-config cmake make gcc g++
${{ env.build_command }}
${{ env.build_command }} -DULIB_BUILD_TESTS=ON
- name: run_gtest
if: matrix.toolchain == 'host.toolchain.cmake'
run: |
cd ${{ github.workspace }}
cmake --build build --config ${{ matrix.build_type }} --target test
- name: build-afl
if: matrix.toolchain == 'host-afl.toolchain.cmake'

3
.gitignore vendored
View File

@ -47,4 +47,5 @@ _deps
# Clion
.idea/
cmake-*
cmake-build-*
build/

4
.gitmodules vendored Normal file
View File

@ -0,0 +1,4 @@
[submodule "3party/googletest"]
path = 3party/googletest
url = https://code.uocat.com/3party/googletest
branch = release-1.8.1

1
3party/googletest Submodule

@ -0,0 +1 @@
Subproject commit b3a9ba2b8e975550799838332803d468797ae2e1

View File

@ -36,3 +36,9 @@ add_executable(ulib_main_test src/main.cpp)
target_link_libraries(ulib_main_test PRIVATE ${PROJECT_NAME})
install(TARGETS ${PROJECT_NAME} DESTINATION lib)
if(ULIB_BUILD_TESTS)
enable_testing()
add_subdirectory(3party/googletest)
add_subdirectory(tests)
endif()

10
tests/CMakeLists.txt Normal file
View File

@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.10)
project(ulib_test)
set(CMAKE_CXX_STANDARD 98)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable(ulib_test src/ulib/sigslot/sigslot_test.cpp)
target_link_libraries(ulib_test gtest gtest_main)
add_test(NAME ulib_test COMMAND ulib_test)

View File

@ -0,0 +1,3 @@
//
// Created by tqcq on 2023/12/5.
//