aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTheo Buehler <tb@openbsd.org>2024-01-19 03:01:58 -0700
committerTheo Buehler <tb@openbsd.org>2024-01-19 03:01:58 -0700
commit267dada70fae48beb1c1e264ea0c9bbdb52dd2e7 (patch)
treef930f33ae552829bd832ad7bf8dcc5aee1222132 /tests
parentdcd04738c1c9eae80aa655ff38151a028a60f246 (diff)
downloadportable-267dada70fae48beb1c1e264ea0c9bbdb52dd2e7.tar.gz
portable-267dada70fae48beb1c1e264ea0c9bbdb52dd2e7.tar.bz2
portable-267dada70fae48beb1c1e264ea0c9bbdb52dd2e7.zip
Add shutdowntest to build
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt11
-rw-r--r--tests/Makefile.am6
-rw-r--r--tests/shutdowntest.bat14
-rwxr-xr-xtests/shutdowntest.sh13
4 files changed, 44 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 828574e..d77a9f0 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -601,6 +601,17 @@ add_executable(sha_test sha_test.c)
601target_link_libraries(sha_test ${OPENSSL_TEST_LIBS}) 601target_link_libraries(sha_test ${OPENSSL_TEST_LIBS})
602add_test(sha_test sha_test) 602add_test(sha_test sha_test)
603 603
604# shutdowntest
605set(SHUTDOWNTEST_SRC shutdowntest.c)
606add_executable(shutdowntest ${SHUTDOWNTEST_SRC})
607target_link_libraries(shutdowntest ${OPENSSL_TEST_LIBS})
608if(NOT MSVC)
609 add_test(NAME shutdowntest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/shutdowntest.sh)
610else()
611 add_test(NAME shutdowntest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/shutdowntest.bat $<TARGET_FILE:shutdowntest>)
612endif()
613set_tests_properties(shutdowntest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}")
614
604# signertest 615# signertest
605if(NOT CMAKE_SYSTEM_NAME MATCHES "WindowsStore") 616if(NOT CMAKE_SYSTEM_NAME MATCHES "WindowsStore")
606 set(SIGNERTEST_SRC signertest.c) 617 set(SIGNERTEST_SRC signertest.c)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index dc9ccd3..a93e7fc 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -631,6 +631,12 @@ TESTS += sha_test
631check_PROGRAMS += sha_test 631check_PROGRAMS += sha_test
632sha_test_SOURCES = sha_test.c 632sha_test_SOURCES = sha_test.c
633 633
634# shutdowntest
635TESTS += shutdowntest.sh
636check_PROGRAMS += shutdowntest
637shutdowntest_SOURCES = shutdowntest.c
638EXTRA_DIST += shutdowntest.sh shutdowntest.bat
639
634# signertest 640# signertest
635TESTS += signertest 641TESTS += signertest
636check_PROGRAMS += signertest 642check_PROGRAMS += signertest
diff --git a/tests/shutdowntest.bat b/tests/shutdowntest.bat
new file mode 100644
index 0000000..46db6e8
--- /dev/null
+++ b/tests/shutdowntest.bat
@@ -0,0 +1,14 @@
1@echo off
2setlocal enabledelayedexpansion
3REM shutdowntest.bat
4
5set shutdowntest_bin=%1
6set shutdowntest_bin=%shutdowntest_bin:/=\%
7if not exist %shutdowntest_bin% exit /b 1
8
9%shutdowntest_bin% %srcdir%\server.pem %srcdir%\server.pem %srcdir%\ca.pem
10if !errorlevel! neq 0 (
11 exit /b 1
12)
13
14endlocal
diff --git a/tests/shutdowntest.sh b/tests/shutdowntest.sh
new file mode 100755
index 0000000..22e2b1d
--- /dev/null
+++ b/tests/shutdowntest.sh
@@ -0,0 +1,13 @@
1#!/bin/sh
2set -e
3
4shutdowntest_bin=./shutdowntest
5if [ -e ./shutdowntest.exe ]; then
6 shutdowntest_bin=./shutdowntest.exe
7fi
8
9if [ -z $srcdir ]; then
10 srcdir=.
11fi
12
13$shutdowntest_bin $srcdir/server.pem $srcdir/server.pem $srcdir/ca.pem