Skip to content

Commit

Permalink
Run unit tests as part of the build (and CI) (#789)
Browse files Browse the repository at this point in the history
* Run unit tests as part of CI and official runs

* update yml

* Target => Targets

* add RuntimeIdentifiers to Mcp23xxx tests and do not run hardware independent tests on Windows (there is none)

* use linux rid instead of ubuntu.18.04-x64

* Try removin RuntimeIdentifiers from Mcp23xxx

* do not pass RuntimeIdentifier for hardware independent tests

* workaround arcade issue #4107

* remove failing test

* differentiate binlog output

* Run tests as part of the build

* Remove hack causing output to get printed
  • Loading branch information
krwq authored Oct 15, 2019
1 parent a5a53b5 commit 62dd695
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
13 changes: 11 additions & 2 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@

<Import Project="Directory.Build.targets" />

<ItemGroup>
<UnitTestProjects Include="$(MSBuildThisFileDirectory)src\devices\**\*.Tests.csproj" />
</ItemGroup>

<Target Name="BuildProduct">
<ItemGroup>
<_ExcludeBuildProductProjects Include="$(MSBuildThisFileDirectory)src\Iot.Device.Bindings\Iot.Device.Bindings.csproj" />
<_ExcludeBuildProductProjects Include="$(MSBuildThisFileDirectory)src\Native\build-native.proj" />
<_BuildProductProjects Include="$(MSBuildThisFileDirectory)src\**\*.csproj" Exclude="@(_ExcludeBuildProductProjects)" />
<_BuildProductProjects Include="$(MSBuildThisFileDirectory)src\**\*.csproj" Exclude="@(_ExcludeBuildProductProjects);@(UnitTestProjects)" />
</ItemGroup>

<MSBuild Projects="@(_BuildProductProjects)" />
Expand Down Expand Up @@ -56,7 +60,12 @@
<MSBuild Projects="@(_ProjectsToRestore)" Targets="Restore" />
</Target>

<Target Name="Test" />
<Target Name="Test">
<MSBuild Projects="@(UnitTestProjects)" Targets="VSTest"
ContinueOnError="ErrorAndContinue" />
<Error Condition="$(MSBuildLastTaskResult) != 'true'"
Text="Unit tests failed. Please check the detailed log to find out which ones failed." />
</Target>

<Target Name="Pack">
<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion src/devices/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Target Name="Test" />
</Project>

0 comments on commit 62dd695

Please sign in to comment.