summaryrefslogtreecommitdiff
path: root/src/lc-compliance/simple_capture.h
AgeCommit message (Collapse)Author
2021-04-14lc-compliance: Drop return value from SimpleCapture::stop()Niklas Söderlund
The return value is never checked and serves to real usage, drop it. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-04-12lc-compliance: Add test stopping single stream with requests queuedNiklas Söderlund
Add a test which stops a camera while requests are still queued. This intends to test cleanup paths where requests are dequeued from video devices in an uncompleted state. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
2021-04-12lc-compliance: Add a libcamera compliance toolNiklas Söderlund
Add a compliance tool to ease testing of cameras. In contrast to the unit-tests under test/ that aims to test the internal components of libcamera the compliance tool aims to test application use-cases and to some extent the public API. This change adds the boilerplate code of a simple framework for the creation of tests. The tests aim both to demonstrate the tool and to catch real problems. The tests added are: - Test that if one queues exactly N requests to a camera exactly N requests are eventually completed. - Test that a configured camera can be started and stopped multiple times in an attempt to exercise cleanup code paths otherwise not often tested with 'cam' for example. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
opt">=$(git rev-parse --git-dir 2>&1) || exit 1 # Derive the source directory from the git directory if not specified. if [ -z "$src_dir" ] then src_dir=$(readlink -f "$git_dir/..") fi # Get a short description from the tree. version=$(git describe --abbrev=8 --match "v[0-9]*" 2>/dev/null) if [ -z "$version" ] then # Handle an un-tagged repository sha=$(git describe --abbrev=8 --always 2>/dev/null) commits=$(git log --oneline | wc -l 2>/dev/null) version="v0.0.0-$commits-g$sha" fi # Append a '-dirty' suffix if the working tree is dirty. Prevent false # positives due to changed timestamps by running git update-index. if [ -z "$build_dir" ] || (echo "$build_dir" | grep -q "$src_dir") then git update-index --refresh > /dev/null 2>&1 fi git diff-index --quiet HEAD || version="$version-dirty ($(date +%Y-%m-%dT%H:%M:%S%Z))" # If a project version is provided, use it to replace the version number. if [ -n "$project_version" ] then version=$(echo "$version" | sed -e 's/^[^-]*-//') version="v$project_version-$version" fi # Replace first '-' with a '+' to denote build metadata, strip the 'g' in from # of the git SHA1 and remove the initial 'v'. version=$(echo "$version" | sed -e 's/-/+/' | sed -e 's/-g/-/' | cut -c 2-) echo "$version"