summaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r--tests/CMakeLists.txt98
1 files changed, 49 insertions, 49 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 74423fbd7..b85cd6ed3 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,73 +1,73 @@
-SET(Python_ADDITIONAL_VERSIONS 3 2.7)
-FIND_PACKAGE(PythonInterp)
+set(Python_ADDITIONAL_VERSIONS 3 2.7)
+find_package(PythonInterp)
-IF(NOT PYTHONINTERP_FOUND)
- MESSAGE(FATAL_ERROR "Could not find a python interpeter, which is needed to build the tests. "
- "Make sure python is available, or pass -DBUILD_TESTS=OFF to skip building the tests")
+if(NOT PYTHONINTERP_FOUND)
+ message(FATAL_ERROR "Could not find a python interpeter, which is needed to build the tests. "
+ "Make sure python is available, or pass -DBUILD_TESTS=OFF to skip building the tests")
ENDIF()
-SET(CLAR_FIXTURES "${CMAKE_CURRENT_SOURCE_DIR}/resources/")
-SET(CLAR_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
-ADD_DEFINITIONS(-DCLAR_FIXTURE_PATH=\"${CLAR_FIXTURES}\")
-ADD_DEFINITIONS(-DCLAR_TMPDIR=\"libgit2_tests\")
-ADD_DEFINITIONS(-DCLAR_WIN32_LONGPATHS)
-ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64)
+set(CLAR_FIXTURES "${CMAKE_CURRENT_SOURCE_DIR}/resources/")
+set(CLAR_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
+add_definitions(-DCLAR_FIXTURE_PATH=\"${CLAR_FIXTURES}\")
+add_definitions(-DCLAR_TMPDIR=\"libgit2_tests\")
+add_definitions(-DCLAR_WIN32_LONGPATHS)
+add_definitions(-D_FILE_OFFSET_BITS=64)
# Ensure that we do not use deprecated functions internally
-ADD_DEFINITIONS(-DGIT_DEPRECATE_HARD)
+add_definitions(-DGIT_DEPRECATE_HARD)
-INCLUDE_DIRECTORIES(${CLAR_PATH} ${libgit2_BINARY_DIR}/src)
-FILE(GLOB_RECURSE SRC_TEST ${CLAR_PATH}/*/*.c ${CLAR_PATH}/*/*.h)
-SET(SRC_CLAR "main.c" "clar_libgit2.c" "clar_libgit2_trace.c" "clar_libgit2_timer.c" "clar.c")
+include_directories(${CLAR_PATH} ${libgit2_BINARY_DIR}/src)
+file(GLOB_RECURSE SRC_TEST ${CLAR_PATH}/*/*.c ${CLAR_PATH}/*/*.h)
+set(SRC_CLAR "main.c" "clar_libgit2.c" "clar_libgit2_trace.c" "clar_libgit2_timer.c" "clar.c")
-IF(MSVC_IDE)
- LIST(APPEND SRC_CLAR "precompiled.c")
-ENDIF()
+if(MSVC_IDE)
+ list(APPEND SRC_CLAR "precompiled.c")
+endif()
-ADD_CUSTOM_COMMAND(
+add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/clar.suite
COMMAND ${PYTHON_EXECUTABLE} generate.py -o "${CMAKE_CURRENT_BINARY_DIR}" -f -xonline -xstress -xperf .
DEPENDS ${SRC_TEST}
WORKING_DIRECTORY ${CLAR_PATH}
)
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
-SET_SOURCE_FILES_PROPERTIES(
+set_source_files_properties(
${CLAR_PATH}/clar.c
PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/clar.suite)
-INCLUDE_DIRECTORIES(${LIBGIT2_INCLUDES})
-INCLUDE_DIRECTORIES(SYSTEM ${LIBGIT2_SYSTEM_INCLUDES})
+include_directories(${LIBGIT2_INCLUDES})
+include_directories(SYSTEM ${LIBGIT2_SYSTEM_INCLUDES})
-ADD_EXECUTABLE(libgit2_tests ${SRC_CLAR} ${SRC_TEST} ${LIBGIT2_OBJECTS})
+add_executable(libgit2_tests ${SRC_CLAR} ${SRC_TEST} ${LIBGIT2_OBJECTS})
-SET_TARGET_PROPERTIES(libgit2_tests PROPERTIES C_STANDARD 90)
-SET_TARGET_PROPERTIES(libgit2_tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${libgit2_BINARY_DIR})
+set_target_properties(libgit2_tests PROPERTIES C_STANDARD 90)
+set_target_properties(libgit2_tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${libgit2_BINARY_DIR})
-TARGET_INCLUDE_DIRECTORIES(libgit2_tests PRIVATE ../src PUBLIC ../include)
-TARGET_LINK_LIBRARIES(libgit2_tests ${LIBGIT2_LIBS})
-IDE_SPLIT_SOURCES(libgit2_tests)
+target_include_directories(libgit2_tests PRIVATE ../src PUBLIC ../include)
+target_link_libraries(libgit2_tests ${LIBGIT2_LIBS})
+ide_split_sources(libgit2_tests)
-IF (MSVC_IDE)
+if(MSVC_IDE)
# Precompiled headers
- SET_TARGET_PROPERTIES(libgit2_tests PROPERTIES COMPILE_FLAGS "/Yuprecompiled.h /FIprecompiled.h")
- SET_SOURCE_FILES_PROPERTIES("precompiled.c" COMPILE_FLAGS "/Ycprecompiled.h")
-ENDIF ()
+ set_target_properties(libgit2_tests PROPERTIES COMPILE_FLAGS "/Yuprecompiled.h /FIprecompiled.h")
+ set_source_files_properties("precompiled.c" COMPILE_FLAGS "/Ycprecompiled.h")
+endif()
-FUNCTION(ADD_CLAR_TEST name)
- IF (NOT USE_LEAK_CHECKER STREQUAL "OFF")
- ADD_TEST(${name} "${libgit2_SOURCE_DIR}/script/${USE_LEAK_CHECKER}.sh" "${libgit2_BINARY_DIR}/libgit2_tests" ${ARGN})
- ELSE()
- ADD_TEST(${name} "${libgit2_BINARY_DIR}/libgit2_tests" ${ARGN})
- ENDIF()
-ENDFUNCTION(ADD_CLAR_TEST)
+function(ADD_CLAR_TEST name)
+ if(NOT USE_LEAK_CHECKER STREQUAL "OFF")
+ add_test(${name} "${libgit2_SOURCE_DIR}/script/${USE_LEAK_CHECKER}.sh" "${libgit2_BINARY_DIR}/libgit2_tests" ${ARGN})
+ else()
+ add_test(${name} "${libgit2_BINARY_DIR}/libgit2_tests" ${ARGN})
+ endif()
+endfunction(ADD_CLAR_TEST)
-ADD_CLAR_TEST(offline -v -xonline)
-ADD_CLAR_TEST(invasive -v -score::ftruncate -sfilter::stream::bigfile -sodb::largefiles -siterator::workdir::filesystem_gunk -srepo::init -srepo::init::at_filesystem_root)
-ADD_CLAR_TEST(online -v -sonline -xonline::customcert)
-ADD_CLAR_TEST(online_customcert -v -sonline::customcert)
-ADD_CLAR_TEST(gitdaemon -v -sonline::push)
-ADD_CLAR_TEST(ssh -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths -sonline::clone::path_whitespace_ssh)
-ADD_CLAR_TEST(proxy -v -sonline::clone::proxy)
-ADD_CLAR_TEST(auth_clone -v -sonline::clone::cred)
-ADD_CLAR_TEST(auth_clone_and_push -v -sonline::clone::push -sonline::push)
+add_clar_test(offline -v -xonline)
+add_clar_test(invasive -v -score::ftruncate -sfilter::stream::bigfile -sodb::largefiles -siterator::workdir::filesystem_gunk -srepo::init -srepo::init::at_filesystem_root)
+add_clar_test(online -v -sonline -xonline::customcert)
+add_clar_test(online_customcert -v -sonline::customcert)
+add_clar_test(gitdaemon -v -sonline::push)
+add_clar_test(ssh -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths -sonline::clone::path_whitespace_ssh)
+add_clar_test(proxy -v -sonline::clone::proxy)
+add_clar_test(auth_clone -v -sonline::clone::cred)
+add_clar_test(auth_clone_and_push -v -sonline::clone::push -sonline::push)