Files
dora-zed/tests/run.sh
T
cristhian c1a7d70ba6 add typed Arrow payloads and a dora-image-view dataflow
dora-image-view takes std/media/v1/Image, and dora's compatibility graph
has no edge from std/core/v1/UInt8 to it, so wiring the two failed
`dora validate` whatever the node actually sent. Its flat-buffer fallback
would not have decoded these frames either: it reads width/height
metadata, and this node only published shape.

image and depth now go out as the Image struct, camera_info and
point_cloud as Float32 arrays and camera_state as a string, all built
against the Arrow C data interface in src/arrow so the node still links
no Arrow C++. Shape, dtype and encoding metadata are dropped where the
payload describes itself; intrinsics, frame_id and both timestamps are
unchanged. tests/run.sh covers the packing without a camera or the SDK,
round-tripping each array through pyarrow and rebuilding it under the
sanitizers.

Breaking: image_bgr is renamed to image and every payload changes shape.
dataflow_plot.yml is replaced by dataflow_view.yml, which wires the
viewer from a tag and repeats its contract in input_types so validate
checks both sides of the wiring.
2026-09-15 10:52:08 -05:00

30 lines
1.1 KiB
Bash
Executable File

#!/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"