From 33b2c49c9bde6aff3f8c460e46007fd9301e1dbf Mon Sep 17 00:00:00 2001 From: Theo Buehler Date: Mon, 17 Apr 2023 10:55:52 +0200 Subject: link signertest to build --- tests/CMakeLists.txt | 20 +++++++++++++------- tests/Makefile.am | 12 +++++++----- 2 files changed, 20 insertions(+), 12 deletions(-) (limited to 'tests') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 96981ba..1828f0f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -595,14 +595,20 @@ add_executable(sha_test sha_test.c) target_link_libraries(sha_test ${OPENSSL_TEST_LIBS}) add_test(sha_test sha_test) -# XXX HAVE_SOCKETPAIR # signertest -# add_executable(signertest signertest.c) -# target_link_libraries(signertest ${LIBTLS_TEST_LIBS}) -# target_include_directories(signertest BEFORE PUBLIC ../tls) -# set_source_files_properties(signertest.c PROPERTIES COMPILE_FLAGS -# -DCERTSDIR=\\"${CMAKE_CURRENT_SOURCE_DIR}\\") -# add_test(signertest signertest) +if(NOT CMAKE_SYSTEM_NAME MATCHES "WindowsStore") + set(SIGNERTEST_SRC signertest.c) + check_function_exists(pipe2 HAVE_PIPE2) + if(!HAVE_PIPE2) + set(SIGNERTEST_SRC ${SIGNERTEST_SRC} compat/pipe2.c) + endif() + set_source_files_properties(signertest.c PROPERTIES COMPILE_FLAGS + -DCERTSDIR=\\"${CMAKE_CURRENT_SOURCE_DIR}\\") + add_executable(signertest ${SIGNERTEST_SRC}) + target_link_libraries(signertest ${LIBTLS_TEST_LIBS}) + target_include_directories(signertest BEFORE PUBLIC ../tls) + add_test(signertest signertest) +endif() # sm2crypttest # sm2evptest diff --git a/tests/Makefile.am b/tests/Makefile.am index 3e605cf..2353396 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -626,12 +626,14 @@ TESTS += sha_test check_PROGRAMS += sha_test sha_test_SOURCES = sha_test.c -# XXX HAVE_SOCKETPAIR # signertest -# TESTS += signertest -# check_PROGRAMS += signertest -# signertest_CPPFLAGS = -I $(top_srcdir)/tls $(AM_CPPFLAGS) -DCERTSDIR=\"$(srcdir)\" -# signertest_SOURCES = signertest.c +TESTS += signertest +check_PROGRAMS += signertest +signertest_CPPFLAGS = -I $(top_srcdir)/tls $(AM_CPPFLAGS) -DCERTSDIR=\"$(srcdir)\" +signertest_SOURCES = signertest.c +if !HAVE_PIPE2 +signertest_SOURCES += compat/pipe2.c +endif # sm2crypttest # sm2evptest -- cgit v1.2.3-55-g6feb