aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Belevich <tra@google.com>2018-09-04 23:43:34 +0000
committerArtem Belevich <tra@google.com>2018-09-04 23:43:34 +0000
commit75acfc14c04d4d95c42b7f6dcd44d3e4ac6b5270 (patch)
tree46093f15ee49bf7d038f2add87bf9aa3d271ecc0
parenta4db9a28b162837fa33aa75334092d58d929c862 (diff)
[test-suite, CUDA] Update CUDA cmake files.
This should unbreak CUDA buildbots. The problem is that CUDA test suite is generating multiple test executables that all use the same reference output file and that resulted in multiple compilation jobs attempting to create the same symlink at the same time. This patch adds a SUFFIX parameter to make it possible to append a suffix to the target file name and that allows us to avoid name clashes. Differential Revision: https://reviews.llvm.org/D51663 git-svn-id: https://llvm.org/svn/llvm-project/test-suite/trunk@341430 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--External/CUDA/CMakeLists.txt15
-rw-r--r--cmake/modules/TestSuite.cmake10
2 files changed, 17 insertions, 8 deletions
diff --git a/External/CUDA/CMakeLists.txt b/External/CUDA/CMakeLists.txt
index 071ffbc9..f7c5dbd5 100644
--- a/External/CUDA/CMakeLists.txt
+++ b/External/CUDA/CMakeLists.txt
@@ -57,14 +57,21 @@ macro(create_one_local_test_f Name FileGlob FilterRegex)
cuda_glob(_sources ${FileGlob})
set(_executable ${Name}-${VariantSuffix})
set(_executable_path ${CMAKE_CURRENT_BINARY_DIR}/${_executable})
+ llvm_test_run()
+ set(REFERENCE_OUTPUT)
# Verify reference output if it exists.
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${Name}.reference_output)
- llvm_test_traditional(${Name})
+ set(REFERENCE_OUTPUT ${Name}.reference_output)
+ llvm_test_verify(WORKDIR ${CMAKE_CURRENT_BINARY_DIR}
+ ${FPCMP} %o ${REFERENCE_OUTPUT}-${VariantSuffix}
+ )
+ llvm_test_executable(${_executable} ${_sources})
+ llvm_test_data(${_executable}
+ DEST_SUFFIX "-${VariantSuffix}"
+ ${REFERENCE_OUTPUT})
else()
- # otherwise just run the executable.
- llvm_test_run()
+ llvm_test_executable(${_executable} ${_sources})
endif()
- llvm_test_executable(${_executable} ${_sources})
target_compile_options(${_executable} PUBLIC ${VariantCPPFLAGS})
if(VariantLibs)
target_link_libraries(${_executable} ${VariantLibs})
diff --git a/cmake/modules/TestSuite.cmake b/cmake/modules/TestSuite.cmake
index de678820..194e57ac 100644
--- a/cmake/modules/TestSuite.cmake
+++ b/cmake/modules/TestSuite.cmake
@@ -18,26 +18,28 @@ mark_as_advanced(TEST_SUITE_COPY_DATA)
# directory of the benchmark executable.
# Paths are interepreted relative to CMAKE_CURRENT_SOURCE_DIR by default but
# this can be changed with the SOURCE_DIR argument.
+# If DEST_SUFFIX is specified, it's appended to the destination file names.
function(llvm_test_data target)
- cmake_parse_arguments(_LTDARGS "MUST_COPY" "SOURCE_DIR" "" ${ARGN})
+ cmake_parse_arguments(_LTDARGS "MUST_COPY" "SOURCE_DIR;DEST_SUFFIX" "" ${ARGN})
set(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
if(_LTDARGS_SOURCE_DIR)
set(SOURCE_DIR ${_LTDARGS_SOURCE_DIR})
endif()
+ set(SUFFIX ${_LTDARGS_DEST_SUFFIX})
foreach(file ${_LTDARGS_UNPARSED_ARGUMENTS})
set(full_path ${SOURCE_DIR}/${file})
if(_LTDARGS_MUST_COPY OR TEST_SUITE_COPY_DATA)
if(IS_DIRECTORY ${full_path})
- llvm_copy_dir(${target} $<TARGET_FILE_DIR:${target}>/${file} ${full_path})
+ llvm_copy_dir(${target} $<TARGET_FILE_DIR:${target}>/${file}${SUFFIX} ${full_path})
else()
- llvm_copy(${target} $<TARGET_FILE_DIR:${target}>/${file} ${full_path})
+ llvm_copy(${target} $<TARGET_FILE_DIR:${target}>/${file}${SUFFIX} ${full_path})
endif()
else()
get_filename_component(file_subdir ${file} DIRECTORY)
if(file_subdir)
llvm_make_directory(${target} ${file_subdir})
endif()
- llvm_create_symlink(${target} $<TARGET_FILE_DIR:${target}>/${file} ${full_path})
+ llvm_create_symlink(${target} $<TARGET_FILE_DIR:${target}>/${file}${SUFFIX} ${full_path})
endif()
endforeach()
endfunction()