#!/usr/bin/env bash # Build and run the payload tests. # # They cover src/arrow only, which is the part of the node that has no ZED SDK, # no CUDA and no dora dependency - so this runs anywhere, and is what CI runs. set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_DIR="$(dirname "$SCRIPT_DIR")" OUT_DIR="${REPO_DIR}/build/tests" mkdir -p "$OUT_DIR" # Sanitized: the release callbacks have to free the whole exported tree, and a # leak there would be one per frame. g++ -std=c++17 -Wall -Wextra -Werror -g -fsanitize=address,undefined \ -I "${REPO_DIR}/src" \ -o "${OUT_DIR}/arrow_test" \ "${REPO_DIR}/src/arrow/array.cc" "${REPO_DIR}/tests/arrow_test.cc" "${OUT_DIR}/arrow_test" echo "ok arrow_test" # Unsanitized: pyarrow is the consumer standing in for dora, and loads the same # code as a shared library. g++ -std=c++17 -Wall -Wextra -Werror -O2 -shared -fPIC \ -I "${REPO_DIR}/src" \ -o "${OUT_DIR}/libzed_arrow.so" \ "${REPO_DIR}/src/arrow/array.cc" "${REPO_DIR}/tests/arrow_export.cc" uv run --no-project --with pyarrow python "${REPO_DIR}/tests/test_arrow.py"