summaryrefslogtreecommitdiff
path: root/50-build-unit-tests.sh
diff options
context:
space:
mode:
Diffstat (limited to '50-build-unit-tests.sh')
-rwxr-xr-x50-build-unit-tests.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/50-build-unit-tests.sh b/50-build-unit-tests.sh
new file mode 100755
index 0000000..3776fee
--- /dev/null
+++ b/50-build-unit-tests.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+source ./common.sh
+
+LIBCAMERA=${1:-$(srcdir libcamera)}
+ID=unit-tests
+
+BRANCH=$(libcamera_branch "$LIBCAMERA")
+
+check_version "$LIBCAMERA" "$ID"
+
+logfile=$(log_filename $ID)
+
+BUILDDIR="$(builddir $ID)"
+
+function build() {
+ if [ ! -d "$BUILDDIR/build.ninja" ]; then
+ meson "$BUILDDIR" "$LIBCAMERA" \
+ -Db_sanitize=address,undefined \
+ -Dv4l2=true \
+ -Dandroid=enabled \
+ -Ddocumentation=disabled \
+ -Dgstreamer=enabled \
+ -Dtest=true
+ fi
+
+ ninja -C "$BUILDDIR"
+}
+
+
+build > $logfile
+
+pass_fail $? "Build for unit tests"
+
+completed $ID