directed tests no longer run in an subdirectory

- target "make test" will no longer build and run tests. It will only run the tests.
- added new target "make check" which will build and run the tests.
- target "make check" will build tests serially. Use -j<N> to build tests in parallel.

Change-Id: I24c7932bf9798364a59f44631fbabcf9a5da5e17


[ROCm/clr commit: fe01dd74a2]
This commit is contained in:
Maneesh Gupta
2017-02-27 13:14:08 +05:30
förälder f109c9e6da
incheckning 045c76a97d
2 ändrade filer med 31 tillägg och 22 borttagningar
+15 -5
Visa fil
@@ -131,7 +131,7 @@ endmacro()
# Macro: HIT_ADD_FILES used to scan+add multiple files for testing.
file(GLOB HIP_LIB_FILES ${HIP_PATH}/lib/*)
macro(HIT_ADD_FILES _dir _label)
macro(HIT_ADD_FILES _dir _label _parent)
foreach (file ${ARGN})
# Build tests
execute_process(COMMAND ${HIP_SRC_PATH}/tests/hit/parser --buildCMDs ${file}
@@ -148,8 +148,10 @@ macro(HIT_ADD_FILES _dir _label)
if(_exclude_platforms STREQUAL "all" OR _exclude_platforms STREQUAL ${HIP_PLATFORM})
else()
set_source_files_properties(${_sources} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)
hip_add_executable(${target} ${_sources} HIPCC_OPTIONS ${_hipcc_options} HCC_OPTIONS ${_hcc_options} NVCC_OPTIONS ${_nvcc_options})
hip_reset_flags()
hip_add_executable(${target} ${_sources} HIPCC_OPTIONS ${_hipcc_options} HCC_OPTIONS ${_hcc_options} NVCC_OPTIONS ${_nvcc_options} EXCLUDE_FROM_ALL)
set_target_properties(${target} PROPERTIES OUTPUT_NAME ${_target} RUNTIME_OUTPUT_DIRECTORY ${_label} LINK_DEPENDS "${HIP_LIB_FILES}")
add_dependencies(${_parent} ${target})
endif()
endforeach()
@@ -196,24 +198,32 @@ endmacro()
# Macro: HIT_ADD_DIRECTORY to scan+add all files in a directory for testing
macro(HIT_ADD_DIRECTORY _dir _label)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${_label} WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
string(REGEX REPLACE "/" "." _parent ${_label})
add_custom_target(${_parent})
file(GLOB files "${_dir}/*.c*")
hit_add_files(${_dir} ${_label} ${files})
hit_add_files(${_dir} ${_label} ${parent} ${files})
endmacro()
# Macro: HIT_ADD_DIRECTORY_RECURSIVE to scan+add all files in a directory+subdirectories for testing
macro(HIT_ADD_DIRECTORY_RECURSIVE _dir _label)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${_label} WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
string(REGEX REPLACE "/" "." _parent ${_label})
add_custom_target(${_parent})
if(${ARGC} EQUAL 3)
add_dependencies(${ARGV2} ${_parent})
endif()
file(GLOB children RELATIVE ${_dir} ${_dir}/*)
set(dirlist "")
foreach(child ${children})
if(IS_DIRECTORY ${_dir}/${child})
list(APPEND dirlist ${child})
else()
hit_add_files(${_dir} ${_label} ${child})
hit_add_files(${_dir} ${_label} ${_parent} ${child})
endif()
endforeach()
foreach(child ${dirlist})
hit_add_directory_recursive(${_dir}/${child} ${_label}/${child})
string(REGEX REPLACE "/" "." _parent ${_label})
hit_add_directory_recursive(${_dir}/${child} ${_label}/${child} ${_parent})
endforeach()
endmacro()