summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-04-14 01:23:54 +0200
committerPetr Mrázek <peterix@gmail.com>2016-05-01 00:02:15 +0200
commit771dd6f9abe29c1d24c5ea8f0e7ca949bc24f84d (patch)
tree52962ddf547b3227f1b637dd1da2b3d0b5a5a766 /cmake
parente8ba5dafc63de65ed8a469353b808e391633f0fc (diff)
downloadMultiMC-771dd6f9abe29c1d24c5ea8f0e7ca949bc24f84d.tar
MultiMC-771dd6f9abe29c1d24c5ea8f0e7ca949bc24f84d.tar.gz
MultiMC-771dd6f9abe29c1d24c5ea8f0e7ca949bc24f84d.tar.lz
MultiMC-771dd6f9abe29c1d24c5ea8f0e7ca949bc24f84d.tar.xz
MultiMC-771dd6f9abe29c1d24c5ea8f0e7ca949bc24f84d.zip
NOISSUE reorganize unit tests to be placed next to the code they test. Nuke more dead tests.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/UnitTest.cmake14
-rw-r--r--cmake/UnitTest/generate_test_data.cmake3
2 files changed, 7 insertions, 10 deletions
diff --git a/cmake/UnitTest.cmake b/cmake/UnitTest.cmake
index 1cbb2b60..d2c99933 100644
--- a/cmake/UnitTest.cmake
+++ b/cmake/UnitTest.cmake
@@ -12,9 +12,9 @@ function(add_unit_test name)
cmake_parse_arguments(OPT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
if(WIN32)
- add_executable(tst_${name} ${OPT_SOURCES} ${TEST_RESOURCE_PATH}/UnitTest/test.rc)
+ add_executable(${name}_test ${OPT_SOURCES} ${TEST_RESOURCE_PATH}/UnitTest/test.rc)
else()
- add_executable(tst_${name} ${OPT_SOURCES})
+ add_executable(${name}_test ${OPT_SOURCES})
endif()
if(NOT "${OPT_DATA}" STREQUAL "")
@@ -31,7 +31,7 @@ function(add_unit_test name)
endif()
if(NOT TARGET "${DATA_TARGET_NAME}")
add_custom_target(${DATA_TARGET_NAME})
- add_dependencies(tst_${name} ${DATA_TARGET_NAME})
+ add_dependencies(${name}_test ${DATA_TARGET_NAME})
add_custom_command(
TARGET ${DATA_TARGET_NAME}
COMMAND ${CMAKE_COMMAND} "-DTEST_DATA_URL=${TEST_DATA_URL}" -DSOURCE=${TEST_DATA_PATH_SRC} -DDESTINATION=${TEST_DATA_PATH} -P ${TEST_RESOURCE_PATH}/UnitTest/generate_test_data.cmake
@@ -40,10 +40,10 @@ function(add_unit_test name)
endif()
endif()
- target_link_libraries(tst_${name} ${OPT_LIBS})
- qt5_use_modules(tst_${name} Test ${OPT_QT})
+ target_link_libraries(${name}_test ${OPT_LIBS})
+ qt5_use_modules(${name}_test Test ${OPT_QT})
- target_include_directories(tst_${name} PRIVATE "${TEST_RESOURCE_PATH}/UnitTest/")
+ target_include_directories(${name}_test PRIVATE "${TEST_RESOURCE_PATH}/UnitTest/")
- add_test(NAME ${name} COMMAND tst_${name})
+ add_test(NAME ${name} COMMAND ${name}_test)
endfunction()
diff --git a/cmake/UnitTest/generate_test_data.cmake b/cmake/UnitTest/generate_test_data.cmake
index 9de7410b..d9250fab 100644
--- a/cmake/UnitTest/generate_test_data.cmake
+++ b/cmake/UnitTest/generate_test_data.cmake
@@ -2,14 +2,12 @@
# variables. Create destination directory if it does not exist.
function(configure_files srcDir destDir)
- message(STATUS "Configuring directory ${destDir} from ${srcDir}")
make_directory(${destDir})
file(GLOB templateFiles RELATIVE ${srcDir} ${srcDir}/*)
foreach(templateFile ${templateFiles})
set(srcTemplatePath ${srcDir}/${templateFile})
if(NOT IS_DIRECTORY ${srcTemplatePath})
- message(STATUS "Configuring file ${templateFile}")
configure_file(
${srcTemplatePath}
${destDir}/${templateFile}
@@ -17,7 +15,6 @@ function(configure_files srcDir destDir)
NEWLINE_STYLE LF
)
else()
- message(STATUS "Recursing? ${srcTemplatePath}")
configure_files("${srcTemplatePath}" "${destDir}/${templateFile}")
endif()
endforeach()