Recover transient camera failures within six timeout windows
This commit is contained in:
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
test_dir="$(mktemp -d)"
|
||||
trap 'rm -rf "$test_dir"' EXIT
|
||||
flags=(-std=c++17 -O1 -g -Wall -Wextra -Wpedantic -pthread -fsanitize=undefined -fno-sanitize-recover=all -I"$root/include")
|
||||
links=()
|
||||
if [[ -f "$root/include/v4l2_capture.h" ]]; then
|
||||
flags+=(-DTEST_V4L2_CAPTURE -I"$root/tests/stubs")
|
||||
else
|
||||
for fn in open close ioctl mmap munmap poll __poll_chk; do links+=("-Wl,--wrap=$fn"); done
|
||||
fi
|
||||
"${CXX:-g++}" "${flags[@]}" "${CAMERA_SOURCE:-$root/src/camera.cpp}" "$root/tests/camera_timeout_test.cpp" "${links[@]}" -o "$test_dir/camera_timeout_test"
|
||||
"$test_dir/camera_timeout_test" "$@"
|
||||
Reference in New Issue
Block a user