Skip to content

Commit 7c6e20d

Browse files
DEV: CI job for build and run dpnp backend clib tests (#559)
* DEV: CI job for build and run dpnp backend clib tests
1 parent 299667d commit 7c6e20d

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

dpnp/backend/tests/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,22 @@ if(NOT Threads_FOUND)
3737
endif()
3838

3939
# Emulate autotools like make check target to build tests
40-
# set(CMAKE_CTEST_COMMAND ctest --progress --output-on-failure -j 4)
41-
40+
set(CMAKE_CTEST_COMMAND ctest --progress --output-on-failure)
41+
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
4242
enable_testing()
4343

4444
include_directories(${GTEST_INCLUDE_DIR})
4545
link_directories(${GTEST_LIB_DIR})
4646

47+
# TODO split
4748
add_executable(dpnpc_tests
4849
test_main.cpp
4950
test_random.cpp
5051
test_utils.cpp
5152
test_utils_iterator.cpp)
5253
target_link_libraries(dpnpc_tests GTest::GTest GTest::Main pthread dpnp_backend_c)
54+
55+
# TODO split
56+
add_test(dpnpc_tests dpnpc_tests)
57+
gtest_discover_tests(dpnpc_tests)
58+
add_dependencies(check dpnpc_tests)

scripts/azure-pipelines.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,5 +311,25 @@ jobs:
311311
./scripts/install_system_deps.sh # no intel python
312312
./scripts/install_python_deps.sh # numpy, conda-build and etc.
313313
echo ========================= build DPNP package ===============================
314-
export DPNP_BACKEND_TESTS_ENABLE=1
315314
./0.build.sh
315+
316+
# DPNP backend clib tests building and running
317+
- job: test_dpnp_backend_clib_lin
318+
displayName: test_dpnp_backend_clib_lin
319+
pool:
320+
vmImage: 'ubuntu-20.04'
321+
steps:
322+
- bash: |
323+
. ./scripts/install_cmake_lin.sh
324+
./scripts/install_system_deps.sh # no intel python
325+
echo ========================= build DPNP package ===============================
326+
. /opt/intel/oneapi/setvars.sh
327+
THEDIR=$(pwd)
328+
cmake -S$THEDIR/dpnp/backend -B$THEDIR/build/ \
329+
-DDPNP_INSTALL_PREFIX=$THEDIR/dpnp -DDPNP_INSTALL_STRUCTURED=OFF \
330+
-DDPNP_BACKEND_TESTS:BOOL=ON $THEDIR/dpnp/backend
331+
cmake --build $THEDIR/build
332+
cmake --install $THEDIR/build
333+
echo ======================= run DPNP backend tests =============================
334+
cd $THEDIR/build/tests/
335+
make check

0 commit comments

Comments
 (0)