Cleanup options around tests

This commit is contained in:
Don 2018-03-21 11:33:38 -07:00
parent a1c22d93cd
commit 4d753badc0
4 changed files with 7 additions and 23 deletions

View File

@ -29,10 +29,10 @@ string(REGEX REPLACE "\\..*" "" TLS_MAJOR_VERSION ${TLS_VERSION})
option(LIBRESSL_SKIP_INSTALL "Skip installation" ${LIBRESSL_SKIP_INSTALL})
option(LIBRESSL_APPS "Build apps" ON)
option(LIBRESSL_TESTS "Build tests" ON)
option(ENABLE_ASM "Enable assembly" ON)
option(ENABLE_EXTRATESTS "Enable extra tests that may be unreliable on some platforms" OFF)
option(ENABLE_NC "Enable installing TLS-enabled nc(1)" OFF)
option(ENABLE_VSTEST "Enable test on Visual Studio" OFF)
set(OPENSSLDIR ${OPENSSLDIR} CACHE PATH "Set the default openssl directory" FORCE)
if(NOT LIBRESSL_SKIP_INSTALL)
@ -300,7 +300,8 @@ add_subdirectory(include)
if(NOT MSVC)
add_subdirectory(man)
endif()
if(NOT MSVC OR ENABLE_VSTEST)
# Tests require the openssl executable and are unavailable when building shared libraries
if(LIBRESSL_APPS AND LIBRESSL_TESTS AND NOT BUILD_SHARED_LIBS)
add_subdirectory(tests)
endif()

View File

@ -143,9 +143,11 @@ into other projects or build by itself.
| Option Name | Default | Description
| ------------ | -----: | ------
| LIBRESSL_SKIP_INSTALL | OFF | allows skipping install() rules. Can be specified from command line using <br>```-DLIBRESSL_SKIP_INSTALL=ON``` |
| LIBRESSL_APPS | ON | allows skipping application builds. Apps are required to run tests |
| LIBRESSL_TESTS | ON | allows skipping of tests. Tests are only available in static builds |
| BUILD_SHARED_LIBS | OFF | CMake option for building shared libraries. |
| ENABLE_ASM | ON | builds assembly optimized rules. |
| ENABLE_EXTRATESTS | OFF | Enable extra tests that may be unreliable on some platforms |
| ENABLE_NC | OFF | Enable installing TLS-enabled nc(1) |
| ENABLE_VSTEST | OFF | Enable test on Visual Studio |
| OPENSSLDIR | Blank | Set the default openssl directory. Can be specified from command line using <br>```-DOPENSSLDIR=<dirname>``` |

View File

@ -6,37 +6,29 @@ environment:
- GENERATOR: Visual Studio 14 2015
CONFIG: Release
SHARED_LIBS: ON
VSTEST: OFF
- GENERATOR: Visual Studio 14 2015
CONFIG: Release
SHARED_LIBS: OFF
VSTEST: ON
- GENERATOR: Visual Studio 14 2015
CONFIG: Debug
SHARED_LIBS: ON
VSTEST: OFF
- GENERATOR: Visual Studio 14 2015
CONFIG: Debug
SHARED_LIBS: OFF
VSTEST: ON
# x64 builds
- GENERATOR: Visual Studio 14 2015 Win64
CONFIG: Release
SHARED_LIBS: ON
VSTEST: OFF
- GENERATOR: Visual Studio 14 2015 Win64
CONFIG: Release
SHARED_LIBS: OFF
VSTEST: ON
- GENERATOR: Visual Studio 14 2015 Win64
CONFIG: Debug
SHARED_LIBS: ON
VSTEST: OFF
- GENERATOR: Visual Studio 14 2015 Win64
CONFIG: Debug
SHARED_LIBS: OFF
VSTEST: ON
init:
# update mysy2
@ -49,7 +41,7 @@ before_build:
- bash autogen.sh
- mkdir build
- cd build
- cmake .. -G "%GENERATOR%" -DBUILD_SHARED_LIBS=%SHARED_LIBS% -DENABLE_VSTEST=%VSTEST%
- cmake .. -G "%GENERATOR%" -DBUILD_SHARED_LIBS=%SHARED_LIBS%
build_script:
- cmake --build . --config %CONFIG%

View File

@ -427,14 +427,3 @@ add_test(verifytest verifytest)
add_executable(x25519test x25519test.c)
target_link_libraries(x25519test ${OPENSSL_LIBS})
add_test(x25519test x25519test)
if(ENABLE_VSTEST AND BUILD_SHARED_LIBS)
add_custom_command(TARGET x25519test POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE:tls>"
"$<TARGET_FILE:ssl>"
"$<TARGET_FILE:crypto>"
"${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Copying DLLs for regression tests")
endif()