summaryrefslogtreecommitdiff
path: root/50-build-unit-tests.sh
blob: cfda0b925eda53cf6462bf1308ec93d16a8c5af0 (plain)
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
#!/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 \
			-Db_coverage=true \
			-Dv4l2=true \
			-Dandroid=enabled \
			-Ddocumentation=disabled \
			-Dgstreamer=enabled \
			-Dtest=true
	fi

	ninja -C "$BUILDDIR"
}


build > $logfile

pass_fail $? "Build for unit tests"

completed $ID