Add regress servertest
This commit is contained in:
parent
ff462f05a2
commit
350170b6ab
@ -292,6 +292,16 @@ add_executable(rsa_test rsa_test.c)
|
|||||||
target_link_libraries(rsa_test ${TESTS_LIBS})
|
target_link_libraries(rsa_test ${TESTS_LIBS})
|
||||||
add_test(rsa_test rsa_test)
|
add_test(rsa_test rsa_test)
|
||||||
|
|
||||||
|
# servertest
|
||||||
|
add_executable(servertest servertest.c)
|
||||||
|
target_link_libraries(servertest ${TESTS_LIBS})
|
||||||
|
if(NOT MSVC)
|
||||||
|
add_test(servertest ${CMAKE_CURRENT_SOURCE_DIR}/servertest.sh)
|
||||||
|
else()
|
||||||
|
add_test(servertest ${CMAKE_CURRENT_SOURCE_DIR}/servertest.bat)
|
||||||
|
endif()
|
||||||
|
set_tests_properties(servertest PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
|
||||||
# sha1test
|
# sha1test
|
||||||
add_executable(sha1test sha1test.c)
|
add_executable(sha1test sha1test.c)
|
||||||
target_link_libraries(sha1test ${TESTS_LIBS})
|
target_link_libraries(sha1test ${TESTS_LIBS})
|
||||||
|
@ -294,6 +294,12 @@ TESTS += rsa_test
|
|||||||
check_PROGRAMS += rsa_test
|
check_PROGRAMS += rsa_test
|
||||||
rsa_test_SOURCES = rsa_test.c
|
rsa_test_SOURCES = rsa_test.c
|
||||||
|
|
||||||
|
# servertest
|
||||||
|
TESTS += servertest.sh
|
||||||
|
check_PROGRAMS += servertest
|
||||||
|
servertest_SOURCES = servertest.c
|
||||||
|
EXTRA_DIST += servertest.sh servertest.bat
|
||||||
|
|
||||||
# sha1test
|
# sha1test
|
||||||
TESTS += sha1test
|
TESTS += sha1test
|
||||||
check_PROGRAMS += sha1test
|
check_PROGRAMS += sha1test
|
||||||
|
17
tests/servertest.bat
Normal file
17
tests/servertest.bat
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal enabledelayedexpansion
|
||||||
|
REM servertest.bat
|
||||||
|
|
||||||
|
set servertest_bin=Debug\servertest.exe
|
||||||
|
if not exist %servertest_bin% exit /b 1
|
||||||
|
|
||||||
|
if "%srcdir%"=="" (
|
||||||
|
set srcdir=.
|
||||||
|
)
|
||||||
|
|
||||||
|
%servertest_bin% %srcdir%\server.pem %srcdir%\server.pem %srcdir%\ca.pem
|
||||||
|
if !errorlevel! neq 0 (
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
endlocal
|
13
tests/servertest.sh
Executable file
13
tests/servertest.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
servertest_bin=./servertest
|
||||||
|
if [ -e ./servertest.exe ]; then
|
||||||
|
servertest_bin=./servertest.exe
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z $srcdir ]; then
|
||||||
|
srcdir=.
|
||||||
|
fi
|
||||||
|
|
||||||
|
$servertest_bin $srcdir/server.pem $srcdir/server.pem $srcdir/ca.pem
|
Loading…
Reference in New Issue
Block a user