diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-08-05 12:03:32 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-08-06 16:50:09 +0100 |
commit | 068d96700ad7badb6f78435a3821f1b60a0a6ce7 (patch) | |
tree | 7503c560b8841d8844e40058903edb0255f9adca | |
parent | 57fe04982a31aba1a1f4ec1ee033def31abeadc9 (diff) |
ci: Provide a dedictated build for the unit-tests
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rwxr-xr-x | 50-build-unit-tests.sh | 37 | ||||
-rwxr-xr-x | 51-run-unit-tests.sh (renamed from 50-unit-tests.sh) | 4 | ||||
-rwxr-xr-x | 52-package.sh (renamed from 30-package.sh) | 2 | ||||
-rwxr-xr-x | 60-simple-cam.sh | 5 | ||||
-rwxr-xr-x | 61-ipu3-ipa.sh | 2 |
5 files changed, 44 insertions, 6 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 diff --git a/50-unit-tests.sh b/51-run-unit-tests.sh index 150d46b..3f9671e 100755 --- a/50-unit-tests.sh +++ b/51-run-unit-tests.sh @@ -5,11 +5,11 @@ source ./common.sh -ID=unit-tests +ID=run-unit-tests logfile=$(log_filename $ID) LIBCAMERA=${1:-$(srcdir libcamera)} -BUILDDIR=${2:-$(builddir coverity)} +BUILDDIR=${2:-$(builddir unit-tests)} set -e diff --git a/30-package.sh b/52-package.sh index 96c14c1..76086c2 100755 --- a/30-package.sh +++ b/52-package.sh @@ -8,7 +8,7 @@ source ./common.sh LIBCAMERA=${1:-$(srcdir libcamera)} -BUILD=${2:-$(pwd)/builds/coverity} +BUILD=${2:-"$(builddir unit-tests)"} ID=package check_version $LIBCAMERA $ID diff --git a/60-simple-cam.sh b/60-simple-cam.sh index 1c057a9..c5f1490 100755 --- a/60-simple-cam.sh +++ b/60-simple-cam.sh @@ -11,7 +11,7 @@ source ./common.sh # Simple Cam builds against a libcamera BUILD directory... -LIBCAMERA_BUILD=${1:-"$(builddir coverity)"} +LIBCAMERA_BUILD=${1:-"$(builddir unit-tests)"} LIBCAMERA=$LIBCAMERA_BUILD/source/ ID=simple-cam @@ -42,7 +42,8 @@ function build() { rm -fr "$BUILDDIR" PKG_CONFIG_PATH=$LIBCAMERA_UNINSTALLED \ - meson "$BUILDDIR" "$SIMPLECAM" + meson "$BUILDDIR" "$SIMPLECAM" \ + -Db_sanitize=address,undefined ninja -C "$BUILDDIR" ret=$? diff --git a/61-ipu3-ipa.sh b/61-ipu3-ipa.sh index b5c79be..aa349b7 100755 --- a/61-ipu3-ipa.sh +++ b/61-ipu3-ipa.sh @@ -8,7 +8,7 @@ source ./common.sh # IPU3 IPA builds against a libcamera BUILD directory... -LIBCAMERA_BUILD=${1:-"$(builddir coverity)"} +LIBCAMERA_BUILD=${1:-"$(builddir unit-tests)"} LIBCAMERA=$LIBCAMERA_BUILD/source/ ID=ipu3-ipa |