Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

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.

  1. First, grab MMALSharp from source and build the library in Visual Studio or using dotnet restore && dotnet build.
  2. 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 the bin/Debug/netcoreapp2.2/linux-arm/publish directory.
  3. 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.
  4. Copy xunit.runner.console v2.4.1 over to your Pi. This will be located in your NuGet packages folder.
  5. Open a new console window on your Pi locally, or SSH to your Pi via PuTTY in Windows.
  6. cd to xunit.runner.console/2.4.1/tools/netcoreapp2.0.
  7. Enter export DOTNET_ROOT=$HOME/dotnet22 and export PATH=$PATH:$HOME/dotnet22 if required.
  8. 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.
Clone this wiki locally