This repository was archived by the owner on Feb 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Unit tests
Ian Auty edited this page Feb 23, 2020
·
7 revisions
MMALSharp has a suite of unit tests covering almost all functionality currently available. Our unit tests use the xUnit framework and a few preliminary steps must be carried out before running them.
As of v0.6, the unit test project in MMALSharp is running against .NET Core 2.2.
- First, grab MMALSharp from source and build the library in Visual Studio or using
dotnet restore && dotnet build
. - Using a command line window, navigate to the tests project folder and publish the project for use on linux-arm by running the following
dotnet
command:dotnet publish -r linux-arm
. The published binaries will then be outputted to thebin/Debug/netcoreapp2.2/linux-arm/publish
directory. - Copy the published binaries to a new folder on your Pi - I'll be copying to the directory
/home/pi/Source/MMALSharpTests
in this tutorial. - Copy
xunit.runner.console
v2.4.1 over to your Pi. This will be located in your NuGet packages folder. - Open a new console window on your Pi locally, or SSH to your Pi via PuTTY in Windows.
- cd to
xunit.runner.console/2.4.1/tools/netcoreapp2.0
. - Enter
export DOTNET_ROOT=$HOME/dotnet22
andexport PATH=$PATH:$HOME/dotnet22
if required. - Run
dotnet xunit.console.dll /home/pi/Source/MMALSharpTests/MMALSharp.Tests.dll -parallel none -maxthreads 1 -verbose
. Note we have used the parallel flag and maxthreads in order to turn off parallelism, this is because only one instance of MMALSharp can be running at any given time.