xref: /freebsd/contrib/libfido2/regress/CMakeLists.txt (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1# Copyright (c) 2018-2021 Yubico AB. All rights reserved.
2# Use of this source code is governed by a BSD-style
3# license that can be found in the LICENSE file.
4
5add_custom_target(regress ALL)
6
7macro(add_regress_test NAME SOURCES)
8	add_executable(${NAME} ${SOURCES})
9	target_link_libraries(${NAME} fido2_shared)
10	add_test(${NAME} ${NAME})
11	add_dependencies(regress ${NAME})
12endmacro()
13
14add_custom_command(TARGET regress POST_BUILD
15    COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure
16    WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
17
18add_regress_test(regress_cred cred.c)
19add_regress_test(regress_assert assert.c)
20add_regress_test(regress_dev dev.c)
21