diff options
author | Theo Buehler <tb@openbsd.org> | 2024-01-19 03:01:58 -0700 |
---|---|---|
committer | Theo Buehler <tb@openbsd.org> | 2024-01-19 03:01:58 -0700 |
commit | 267dada70fae48beb1c1e264ea0c9bbdb52dd2e7 (patch) | |
tree | f930f33ae552829bd832ad7bf8dcc5aee1222132 /tests | |
parent | dcd04738c1c9eae80aa655ff38151a028a60f246 (diff) | |
download | portable-267dada70fae48beb1c1e264ea0c9bbdb52dd2e7.tar.gz portable-267dada70fae48beb1c1e264ea0c9bbdb52dd2e7.tar.bz2 portable-267dada70fae48beb1c1e264ea0c9bbdb52dd2e7.zip |
Add shutdowntest to build
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 11 | ||||
-rw-r--r-- | tests/Makefile.am | 6 | ||||
-rw-r--r-- | tests/shutdowntest.bat | 14 | ||||
-rwxr-xr-x | tests/shutdowntest.sh | 13 |
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) | |||
601 | target_link_libraries(sha_test ${OPENSSL_TEST_LIBS}) | 601 | target_link_libraries(sha_test ${OPENSSL_TEST_LIBS}) |
602 | add_test(sha_test sha_test) | 602 | add_test(sha_test sha_test) |
603 | 603 | ||
604 | # shutdowntest | ||
605 | set(SHUTDOWNTEST_SRC shutdowntest.c) | ||
606 | add_executable(shutdowntest ${SHUTDOWNTEST_SRC}) | ||
607 | target_link_libraries(shutdowntest ${OPENSSL_TEST_LIBS}) | ||
608 | if(NOT MSVC) | ||
609 | add_test(NAME shutdowntest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/shutdowntest.sh) | ||
610 | else() | ||
611 | add_test(NAME shutdowntest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/shutdowntest.bat $<TARGET_FILE:shutdowntest>) | ||
612 | endif() | ||
613 | set_tests_properties(shutdowntest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") | ||
614 | |||
604 | # signertest | 615 | # signertest |
605 | if(NOT CMAKE_SYSTEM_NAME MATCHES "WindowsStore") | 616 | if(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 | |||
631 | check_PROGRAMS += sha_test | 631 | check_PROGRAMS += sha_test |
632 | sha_test_SOURCES = sha_test.c | 632 | sha_test_SOURCES = sha_test.c |
633 | 633 | ||
634 | # shutdowntest | ||
635 | TESTS += shutdowntest.sh | ||
636 | check_PROGRAMS += shutdowntest | ||
637 | shutdowntest_SOURCES = shutdowntest.c | ||
638 | EXTRA_DIST += shutdowntest.sh shutdowntest.bat | ||
639 | |||
634 | # signertest | 640 | # signertest |
635 | TESTS += signertest | 641 | TESTS += signertest |
636 | check_PROGRAMS += signertest | 642 | check_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 | ||
2 | setlocal enabledelayedexpansion | ||
3 | REM shutdowntest.bat | ||
4 | |||
5 | set shutdowntest_bin=%1 | ||
6 | set shutdowntest_bin=%shutdowntest_bin:/=\% | ||
7 | if not exist %shutdowntest_bin% exit /b 1 | ||
8 | |||
9 | %shutdowntest_bin% %srcdir%\server.pem %srcdir%\server.pem %srcdir%\ca.pem | ||
10 | if !errorlevel! neq 0 ( | ||
11 | exit /b 1 | ||
12 | ) | ||
13 | |||
14 | endlocal | ||
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 | ||
2 | set -e | ||
3 | |||
4 | shutdowntest_bin=./shutdowntest | ||
5 | if [ -e ./shutdowntest.exe ]; then | ||
6 | shutdowntest_bin=./shutdowntest.exe | ||
7 | fi | ||
8 | |||
9 | if [ -z $srcdir ]; then | ||
10 | srcdir=. | ||
11 | fi | ||
12 | |||
13 | $shutdowntest_bin $srcdir/server.pem $srcdir/server.pem $srcdir/ca.pem | ||