Skip to content

Commit 6992e9f

Browse files
umar456pradeep
authored andcommitted
Add CTestCustom. Print info after tests. Mark sparse test SERIAL
1 parent a2fad1d commit 6992e9f

5 files changed

Lines changed: 64 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,10 @@ unset(CMAKE_CXX_VISIBILITY_PRESET)
339339

340340
include(CTest)
341341

342+
configure_file(
343+
${CMAKE_MODULE_PATH}/CTestCustom.cmake
344+
${PROJECT_BINARY_DIR}/CTestCustom.cmake)
345+
342346
# Handle depricated BUILD_TEST variable if found.
343347
if(BUILD_TEST)
344348
set(BUILD_TESTING ${BUILD_TEST})

CMakeModules/ASANSuppression.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This is a known leak.
2+
leak:getKernel
3+
#leak:libOpenCL
4+
leak:libnvidia-ptxjitcompile
5+
leak:tbb::internal::task_stream

CMakeModules/CTestCustom.cmake

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
3+
set(CTEST_CUSTOM_ERROR_POST_CONTEXT 20)
4+
set(CTEST_CUSTOM_ERROR_PRE_CONTEXT 20)
5+
set(CTEST_CUSTOM_POST_TEST ./test/print_info)
6+
7+
list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE
8+
"test/gtest/*"
9+
10+
# All external and third_party libraries
11+
"src/backend/cpu/threads/*"
12+
"src/backend/cuda/cub/*"
13+
"cl2.hpp"
14+
15+
# Remove bin2cpp from coverage
16+
"CMakeModules/*")

test/CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ make_test(SRC solve_dense.cpp CXX11)
259259
make_test(SRC sort.cpp)
260260
make_test(SRC sort_by_key.cpp)
261261
make_test(SRC sort_index.cpp)
262-
make_test(SRC sparse.cpp)
262+
make_test(SRC sparse.cpp SERIAL)
263263
make_test(SRC sparse_arith.cpp)
264264
make_test(SRC sparse_convert.cpp)
265265
make_test(SRC stdev.cpp)
@@ -282,3 +282,15 @@ make_test(SRC write.cpp)
282282
make_test(SRC ycbcr_rgb.cpp)
283283
make_test(SRC inverse_deconv.cpp)
284284
make_test(SRC iterative_deconv.cpp)
285+
286+
287+
add_executable(print_info print_info.cpp)
288+
if(AF_BUILD_UNIFIED)
289+
target_link_libraries(print_info ArrayFire::af)
290+
elseif(AF_BUILD_OPENCL)
291+
target_link_libraries(print_info ArrayFire::afopencl)
292+
elseif(AF_BUILD_CUDA)
293+
target_link_libraries(print_info ArrayFire::afcuda)
294+
elseif(AF_BUILD_CPU)
295+
target_link_libraries(print_info ArrayFire::afcpu)
296+
endif()

test/print_info.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*******************************************************
2+
* Copyright (c) 2018, ArrayFire
3+
* All rights reserved.
4+
*
5+
* This file is distributed under 3-clause BSD license.
6+
* The complete license agreement can be obtained at:
7+
* http://arrayfire.com/licenses/BSD-3-Clause
8+
********************************************************/
9+
10+
#include <arrayfire.h>
11+
12+
using namespace af;
13+
14+
int main(int argc, const char** argv) {
15+
int backend = getAvailableBackends();
16+
if (backend & AF_BACKEND_OPENCL) {
17+
setBackend(AF_BACKEND_OPENCL);
18+
} else if (backend & AF_BACKEND_CUDA) {
19+
setBackend(AF_BACKEND_CUDA);
20+
} else if (backend & AF_BACKEND_CPU) {
21+
setBackend(AF_BACKEND_CPU);
22+
}
23+
24+
info();
25+
return 0;
26+
}

0 commit comments

Comments
 (0)