-
Notifications
You must be signed in to change notification settings - Fork 152
/
test_cpp.sh
executable file
·50 lines (36 loc) · 1.2 KB
/
test_cpp.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# Copyright (c) 2022-2024, NVIDIA CORPORATION.
set -euo pipefail
. /opt/conda/etc/profile.d/conda.sh
rapids-logger "Downloading artifacts from previous jobs"
CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)
rapids-logger "Generate C++ testing dependencies"
rapids-dependency-file-generator \
--output conda \
--file-key test_cpp \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch)" \
--prepend-channel "${CPP_CHANNEL}" | tee env.yaml
rapids-mamba-retry env create --yes -f env.yaml -n test
# Temporarily allow unbound variables for conda activation.
set +u
conda activate test
set -u
RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/
mkdir -p "${RAPIDS_TESTS_DIR}"
# CUSPATIAL_HOME is used to find test files
export CUSPATIAL_HOME="${PWD}"
rapids-print-env
rapids-logger "Check GPU usage"
nvidia-smi
EXITCODE=0
trap "EXITCODE=1" ERR
set +e
# Run libcuspatial gtests from libcuspatial-tests package
rapids-logger "Run gtests"
for gt in "$CONDA_PREFIX"/bin/gtests/libcuspatial/* ; do
test_name=$(basename ${gt})
echo "Running gtest $test_name"
${gt} --gtest_output=xml:${RAPIDS_TESTS_DIR}
done
rapids-logger "Test script exiting with value: $EXITCODE"
exit ${EXITCODE}