Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/reusable_dax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ env:
INSTL_DIR : "${{github.workspace}}/../install-dir"
COVERAGE_DIR : "${{github.workspace}}/coverage"
COVERAGE_NAME : "exports-coverage-dax"
DAX_TESTS: "./test/umf_test-provider_file_memory ./test/umf_test-provider_devdax_memory"
DAX_TESTS: "./test/test_provider_file_memory ./test/test_provider_devdax_memory"

jobs:
dax:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/reusable_multi_numa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
BUILD_DIR : "${{github.workspace}}/build"
COVERAGE_DIR : "${{github.workspace}}/coverage"
COVERAGE_NAME : "exports-coverage-multinuma"
NUMA_TESTS: "./test/umf_test-memspace_numa ./test/umf_test-provider_os_memory_multiple_numa_nodes"
NUMA_TESTS: "./test/test_memspace_numa ./test/test_provider_os_memory_multiple_numa_nodes"

jobs:
multi_numa:
Expand Down Expand Up @@ -60,13 +60,13 @@ jobs:
# On RHEL, hwloc version is just a little too low.
# Skip some tests until we upgrade hwloc and update CMake to properly handle local hwloc installation.
# TODO: fix issue #560
# TODO: add issue for -E umf-init_teardown - it is not clear why it fails
# TODO: add issue for -E test_init_teardown - it is not clear why it fails
- name: Run tests (on RHEL)
if: matrix.os == 'rhel-9.1'
working-directory: ${{github.workspace}}/build
run: |
ctest --output-on-failure --test-dir test -E "umf-provider_os_memory_multiple_numa_nodes|umf-init_teardown"
./test/umf_test-provider_os_memory_multiple_numa_nodes \
ctest --output-on-failure --test-dir test -E "test_provider_os_memory_multiple_numa_nodes|test_init_teardown"
./test/test_provider_os_memory_multiple_numa_nodes \
--gtest_filter="-*checkModeLocal/*:*checkModePreferredEmptyNodeset/*:testNuma.checkModeInterleave"

- name: Run NUMA tests under valgrind
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable_proxy_lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ jobs:
working-directory: ${{env.BUILD_DIR}}
run: LD_PRELOAD=./lib/libumf_proxy.so ctest --output-on-failure

- name: Run "./test/umf_test-memoryPool" with proxy library
- name: Run "./test/test_memoryPool" with proxy library
working-directory: ${{env.BUILD_DIR}}
run: LD_PRELOAD=./lib/libumf_proxy.so ./test/umf_test-memoryPool
run: LD_PRELOAD=./lib/libumf_proxy.so ./test/test_memoryPool

- name: Run "/usr/bin/ls" with proxy library
working-directory: ${{env.BUILD_DIR}}
Expand Down
24 changes: 12 additions & 12 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ function(build_umf_test)
"${multiValueArgs}"
${ARGN})

set(TEST_NAME umf-${ARG_NAME})
set(TEST_TARGET_NAME umf_test-${ARG_NAME})
set(TEST_NAME test_${ARG_NAME})
set(TEST_TARGET_NAME test_${ARG_NAME})

set(LIB_DIRS ${LIB_DIRS} ${LIBHWLOC_LIBRARY_DIRS})

Expand Down Expand Up @@ -130,8 +130,8 @@ function(add_umf_test)
SRCS ${ARG_SRCS}
LIBS ${ARG_LIBS})

set(TEST_NAME umf-${ARG_NAME})
set(TEST_TARGET_NAME umf_test-${ARG_NAME})
set(TEST_NAME test_${ARG_NAME})
set(TEST_TARGET_NAME test_${ARG_NAME})

add_test(
NAME ${TEST_NAME}
Expand Down Expand Up @@ -408,15 +408,15 @@ if(UMF_BUILD_GPU_TESTS AND UMF_BUILD_LEVEL_ZERO_PROVIDER)
SRCS providers/provider_level_zero.cpp
${UMF_UTILS_DIR}/utils_level_zero.cpp ${BA_SOURCES_FOR_TEST}
LIBS ${UMF_UTILS_FOR_TEST})
target_compile_definitions(umf_test-provider_level_zero_dlopen_global
target_compile_definitions(test_provider_level_zero_dlopen_global
PUBLIC USE_DLOPEN=1 OPEN_ZE_LIBRARY_GLOBAL=1)

add_umf_test(
NAME provider_level_zero_dlopen_local
SRCS providers/provider_level_zero.cpp
${UMF_UTILS_DIR}/utils_level_zero.cpp ${BA_SOURCES_FOR_TEST}
LIBS ${UMF_UTILS_FOR_TEST})
target_compile_definitions(umf_test-provider_level_zero_dlopen_local
target_compile_definitions(test_provider_level_zero_dlopen_local
PUBLIC USE_DLOPEN=1 OPEN_ZE_LIBRARY_GLOBAL=0)
endif()

Expand All @@ -443,15 +443,15 @@ if(UMF_BUILD_GPU_TESTS AND UMF_BUILD_CUDA_PROVIDER)
SRCS providers/provider_cuda.cpp providers/cuda_helpers.cpp
${BA_SOURCES_FOR_TEST}
LIBS ${UMF_UTILS_FOR_TEST})
target_compile_definitions(umf_test-provider_cuda_dlopen_global
target_compile_definitions(test_provider_cuda_dlopen_global
PUBLIC USE_DLOPEN=1 OPEN_CU_LIBRARY_GLOBAL=1)

add_umf_test(
NAME provider_cuda_dlopen_local
SRCS providers/provider_cuda.cpp providers/cuda_helpers.cpp
${BA_SOURCES_FOR_TEST}
LIBS ${UMF_UTILS_FOR_TEST})
target_compile_definitions(umf_test-provider_cuda_dlopen_local
target_compile_definitions(test_provider_cuda_dlopen_local
PUBLIC USE_DLOPEN=1 OPEN_CU_LIBRARY_GLOBAL=0)
else()
message(
Expand Down Expand Up @@ -496,7 +496,7 @@ if(UMF_PROXY_LIB_ENABLED AND UMF_BUILD_SHARED_LIBRARY)
NAME proxy_lib_size_threshold
SRCS ${BA_SOURCES_FOR_TEST} test_proxy_lib_size_threshold.cpp
LIBS ${UMF_UTILS_FOR_TEST} umf_proxy)
set_property(TEST umf-proxy_lib_size_threshold
set_property(TEST test_proxy_lib_size_threshold
PROPERTY ENVIRONMENT UMF_PROXY="size.threshold=64")
endif()

Expand All @@ -506,7 +506,7 @@ if(UMF_PROXY_LIB_ENABLED AND UMF_BUILD_SHARED_LIBRARY)
SRCS ${BA_SOURCES_FOR_TEST} memoryPoolAPI.cpp
malloc_compliance_tests.cpp
LIBS ${UMF_UTILS_FOR_TEST} umf_proxy)
target_compile_definitions(umf_test-proxy_lib_memoryPool
target_compile_definitions(test_proxy_lib_memoryPool
PUBLIC UMF_PROXY_LIB_ENABLED=1)
endif()

Expand All @@ -530,7 +530,7 @@ function(add_umf_ipc_test)
""
${ARGN})

set(TEST_NAME umf-${ARG_TEST})
set(TEST_NAME test_${ARG_TEST})

if(DEFINED ARG_SRC_DIR)
set(SRC_DIR ${ARG_SRC_DIR})
Expand Down Expand Up @@ -650,7 +650,7 @@ if(LINUX
LIBS dl)
# append LD_LIBRARY_PATH to the libumf
set_property(
TEST umf-init_teardown
TEST test_init_teardown
PROPERTY ENVIRONMENT_MODIFICATION
"LD_LIBRARY_PATH=path_list_append:${CMAKE_BINARY_DIR}/lib")
endif()
Expand Down
6 changes: 3 additions & 3 deletions test/ipc_devdax_prov.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2024 Intel Corporation
# Copyright (C) 2024-2025 Intel Corporation
#
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Expand All @@ -25,10 +25,10 @@ PORT=$(( 1024 + ( $$ % ( 65535 - 1024 ))))
UMF_LOG_VAL="level:debug;flush:debug;output:stderr;pid:yes"

echo "Starting ipc_devdax_prov CONSUMER on port $PORT ..."
UMF_LOG=$UMF_LOG_VAL ./umf_test-ipc_devdax_prov_consumer $PORT &
UMF_LOG=$UMF_LOG_VAL ./test_ipc_devdax_prov_consumer $PORT &

echo "Waiting 1 sec ..."
sleep 1

echo "Starting ipc_devdax_prov PRODUCER on port $PORT ..."
UMF_LOG=$UMF_LOG_VAL ./umf_test-ipc_devdax_prov_producer $PORT
UMF_LOG=$UMF_LOG_VAL ./test_ipc_devdax_prov_producer $PORT
6 changes: 3 additions & 3 deletions test/ipc_file_prov.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2024 Intel Corporation
# Copyright (C) 2024-2025 Intel Corporation
#
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Expand All @@ -20,13 +20,13 @@ UMF_LOG_VAL="level:debug;flush:debug;output:stderr;pid:yes"
rm -f ${FILE_NAME}

echo "Starting ipc_file_prov CONSUMER on port $PORT ..."
UMF_LOG=$UMF_LOG_VAL ./umf_test-ipc_file_prov_consumer $PORT ${FILE_NAME}_consumer &
UMF_LOG=$UMF_LOG_VAL ./test_ipc_file_prov_consumer $PORT ${FILE_NAME}_consumer &

echo "Waiting 1 sec ..."
sleep 1

echo "Starting ipc_file_prov PRODUCER on port $PORT ..."
UMF_LOG=$UMF_LOG_VAL ./umf_test-ipc_file_prov_producer $PORT ${FILE_NAME}_producer
UMF_LOG=$UMF_LOG_VAL ./test_ipc_file_prov_producer $PORT ${FILE_NAME}_producer

# remove the SHM file
rm -f ${FILE_NAME}
6 changes: 3 additions & 3 deletions test/ipc_file_prov_fsdax.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2024 Intel Corporation
# Copyright (C) 2024-2025 Intel Corporation
#
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Expand Down Expand Up @@ -31,13 +31,13 @@ UMF_LOG_VAL="level:debug;flush:debug;output:stderr;pid:yes"
rm -f ${FILE_NAME}

echo "Starting ipc_file_prov_fsdax CONSUMER on port $PORT ..."
UMF_LOG=$UMF_LOG_VAL ./umf_test-ipc_file_prov_consumer $PORT $FILE_NAME &
UMF_LOG=$UMF_LOG_VAL ./test_ipc_file_prov_consumer $PORT $FILE_NAME &

echo "Waiting 1 sec ..."
sleep 1

echo "Starting ipc_file_prov_fsdax PRODUCER on port $PORT ..."
UMF_LOG=$UMF_LOG_VAL ./umf_test-ipc_file_prov_producer $PORT $FILE_NAME_2
UMF_LOG=$UMF_LOG_VAL ./test_ipc_file_prov_producer $PORT $FILE_NAME_2

# remove the SHM file
rm -f ${FILE_NAME}
4 changes: 2 additions & 2 deletions test/ipc_os_prov_anon_fd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ PORT=$(( 1024 + ( $$ % ( 65535 - 1024 ))))
UMF_LOG_VAL="level:debug;flush:debug;output:stderr;pid:yes"

echo "Starting ipc_os_prov_anon_fd CONSUMER on port $PORT ..."
UMF_LOG=$UMF_LOG_VAL ./umf_test-ipc_os_prov_consumer $PORT &
UMF_LOG=$UMF_LOG_VAL ./test_ipc_os_prov_consumer $PORT &

echo "Waiting 1 sec ..."
sleep 1

echo "Starting ipc_os_prov_anon_fd PRODUCER on port $PORT ..."
UMF_LOG=$UMF_LOG_VAL ./umf_test-ipc_os_prov_producer $PORT
UMF_LOG=$UMF_LOG_VAL ./test_ipc_os_prov_producer $PORT
6 changes: 3 additions & 3 deletions test/ipc_os_prov_proxy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2024 Intel Corporation
# Copyright (C) 2024-2025 Intel Corporation
#
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Expand All @@ -17,10 +17,10 @@ LD_PRELOAD_VAL="../lib/libumf_proxy.so"
PORT=$(( 1024 + ( $$ % ( 65535 - 1024 ))))

echo "Starting CONSUMER on port $PORT ..."
UMF_LOG=$UMF_LOG_VAL ./umf_test-ipc_os_prov_consumer $PORT &
UMF_LOG=$UMF_LOG_VAL ./test_ipc_os_prov_consumer $PORT &

echo "Waiting 1 sec ..."
sleep 1

echo "Starting ipc_os_prov_proxy PRODUCER on port $PORT ..."
LD_PRELOAD=$LD_PRELOAD_VAL UMF_LOG=$UMF_LOG_VAL UMF_PROXY=$UMF_PROXY_VAL ./umf_test-ipc_os_prov_proxy $PORT
LD_PRELOAD=$LD_PRELOAD_VAL UMF_LOG=$UMF_LOG_VAL UMF_PROXY=$UMF_PROXY_VAL ./test_ipc_os_prov_proxy $PORT
6 changes: 3 additions & 3 deletions test/ipc_os_prov_shm.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2024 Intel Corporation
# Copyright (C) 2024-2025 Intel Corporation
#
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Expand All @@ -20,13 +20,13 @@ UMF_LOG_VAL="level:debug;flush:debug;output:stderr;pid:yes"
rm -f /dev/shm/${SHM_NAME}

echo "Starting ipc_os_prov_shm CONSUMER on port $PORT ..."
UMF_LOG=$UMF_LOG_VAL ./umf_test-ipc_os_prov_consumer $PORT &
UMF_LOG=$UMF_LOG_VAL ./test_ipc_os_prov_consumer $PORT &

echo "Waiting 1 sec ..."
sleep 1

echo "Starting ipc_os_prov_shm PRODUCER on port $PORT ..."
UMF_LOG=$UMF_LOG_VAL ./umf_test-ipc_os_prov_producer $PORT $SHM_NAME
UMF_LOG=$UMF_LOG_VAL ./test_ipc_os_prov_producer $PORT $SHM_NAME

# remove the SHM file
rm -f /dev/shm/${SHM_NAME}
6 changes: 3 additions & 3 deletions test/providers/ipc_cuda_prov.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2024 Intel Corporation
# Copyright (C) 2024-2025 Intel Corporation
#
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Expand All @@ -15,10 +15,10 @@ PORT=$(( 1024 + ( $$ % ( 65535 - 1024 ))))
UMF_LOG_VAL="level:debug;flush:debug;output:stderr;pid:yes"

echo "Starting ipc_cuda_prov CONSUMER on port $PORT ..."
UMF_LOG=$UMF_LOG_VAL ./umf_test-ipc_cuda_prov_consumer $PORT &
UMF_LOG=$UMF_LOG_VAL ./test_ipc_cuda_prov_consumer $PORT &

echo "Waiting 1 sec ..."
sleep 1

echo "Starting ipc_cuda_prov PRODUCER on port $PORT ..."
UMF_LOG=$UMF_LOG_VAL ./umf_test-ipc_cuda_prov_producer $PORT
UMF_LOG=$UMF_LOG_VAL ./test_ipc_cuda_prov_producer $PORT
4 changes: 2 additions & 2 deletions test/providers/ipc_level_zero_prov.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ PORT=$(( 1024 + ( $$ % ( 65535 - 1024 ))))
UMF_LOG_VAL="level:debug;flush:debug;output:stderr;pid:yes"

echo "Starting ipc_level_zero_prov CONSUMER on port $PORT ..."
UMF_LOG=$UMF_LOG_VAL ./umf_test-ipc_level_zero_prov_consumer $PORT &
UMF_LOG=$UMF_LOG_VAL ./test_ipc_level_zero_prov_consumer $PORT &

echo "Waiting 1 sec ..."
sleep 1

echo "Starting ipc_level_zero_prov PRODUCER on port $PORT ..."
UMF_LOG=$UMF_LOG_VAL ./umf_test-ipc_level_zero_prov_producer $PORT
UMF_LOG=$UMF_LOG_VAL ./test_ipc_level_zero_prov_producer $PORT
File renamed without changes.
34 changes: 17 additions & 17 deletions test/test_valgrind.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (C) 2024 Intel Corporation
# Copyright (C) 2024-2025 Intel Corporation
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

Expand All @@ -16,7 +16,7 @@ function print_usage() {
echo "Where:"
echo
echo "tests_examples - (optional) list of tests or examples to be run (paths relative to the <build_dir> build directory)."
echo " If it is empty, all tests (./test/umf_test-*) and examples (./examples/umf_example_*)"
echo " If it is empty, all tests (./test/test_*) and examples (./examples/umf_example_*)"
echo " found in <build_dir> will be run."
}

Expand All @@ -37,8 +37,8 @@ if [ ! -f $WORKSPACE/README.md ]; then
exit 1
fi

if [ $(ls -1 ${BUILD_DIR}/test/umf_test-* 2>/dev/null | wc -l) -eq 0 ]; then
echo -e "error: UMF tests ./test/umf_test-* not found in the build directory: ${BUILD_DIR}\n"
if [ $(ls -1 ${BUILD_DIR}/test/test_* 2>/dev/null | wc -l) -eq 0 ]; then
echo -e "error: UMF tests ./test/test_* not found in the build directory: ${BUILD_DIR}\n"
print_usage
exit 1
fi
Expand Down Expand Up @@ -74,7 +74,7 @@ echo "Working directory: $(pwd)"
echo "Running: \"valgrind $OPTION\" for the following tests:"

ANY_TEST_FAILED=0
PATH_TESTS="./test/umf_test-*"
PATH_TESTS="./test/test_*"
PATH_EXAMPLES="./examples/umf_example_*"

rm -f ${PATH_TESTS}.log ${PATH_TESTS}.err ${PATH_EXAMPLES}.log ${PATH_EXAMPLES}.err
Expand All @@ -100,48 +100,48 @@ for test in $TESTS; do
# skip tests incompatible with valgrind
FILTER=""
case $test in
./test/umf_test-disjointPool)
./test/test_disjointPool)
if [ "$TOOL" = "helgrind" ]; then
# skip because of the assert in helgrind:
# Helgrind: hg_main.c:308 (lockN_acquire_reader): Assertion 'lk->kind == LK_rdwr' failed.
echo "- SKIPPED (helgrind only)"
continue;
fi
;;
./test/umf_test-ipc_os_prov_*)
./test/test_ipc_os_prov_*)
echo "- SKIPPED"
continue; # skip testing helper binaries used by the ipc_os_prov_* tests
;;
./test/umf_test-ipc_devdax_prov_*)
./test/test_ipc_devdax_prov_*)
echo "- SKIPPED"
continue; # skip testing helper binaries used by the ipc_devdax_prov_* tests
;;
./test/umf_test-ipc_file_prov_*)
./test/test_ipc_file_prov_*)
echo "- SKIPPED"
continue; # skip testing helper binaries used by the ipc_file_prov_* tests
;;
./test/umf_test-memspace_host_all)
./test/test_memspace_host_all)
FILTER='--gtest_filter="-*allocsSpreadAcrossAllNumaNodes"'
;;
./test/umf_test-provider_os_memory)
./test/test_provider_os_memory)
FILTER='--gtest_filter="-osProviderTest/umfIpcTest*"'
;;
./test/umf_test-provider_os_memory_config)
./test/test_provider_os_memory_config)
FILTER='--gtest_filter="-*protection_flag_none:*protection_flag_read:*providerConfigTestNumaMode*"'
;;
./test/umf_test-memspace_highest_capacity)
./test/test_memspace_highest_capacity)
FILTER='--gtest_filter="-*highestCapacityVerify*"'
;;
./test/umf_test-provider_os_memory_multiple_numa_nodes)
./test/test_provider_os_memory_multiple_numa_nodes)
FILTER='--gtest_filter="-testNuma.checkModeInterleave*:testNumaNodesAllocations/testNumaOnEachNode.checkNumaNodesAllocations*:testNumaNodesAllocations/testNumaOnEachNode.checkModePreferred*:testNumaNodesAllocations/testNumaOnEachNode.checkModeInterleaveSingleNode*:testNumaNodesAllocationsAllCpus/testNumaOnEachCpu.checkModePreferredEmptyNodeset*:testNumaNodesAllocationsAllCpus/testNumaOnEachCpu.checkModeLocal*"'
;;
./test/umf_test-memspace_highest_bandwidth)
./test/test_memspace_highest_bandwidth)
FILTER='--gtest_filter="-*allocLocalMt*"'
;;
./test/umf_test-memspace_lowest_latency)
./test/test_memspace_lowest_latency)
FILTER='--gtest_filter="-*allocLocalMt*"'
;;
./test/umf_test-memoryPool)
./test/test_memoryPool)
FILTER='--gtest_filter="-*allocMaxSize*"'
;;
./examples/umf_example_ipc_ipcapi_*)
Expand Down