forked from SciSharp/NumSharp
-
Notifications
You must be signed in to change notification settings - Fork 3
/
ExecuteUnitTests.ps1
40 lines (30 loc) · 1.29 KB
/
ExecuteUnitTests.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Write-Output "Starting unit Tests "
Write-Output "--------------------"
Write-Output "--------------------"
Write-Output "Start with building"
Write-Output "--------------------"
$projectFolders = @{};
$projectFolders['projectRoot'] = $PSScriptRoot;
$projectFolders['UnitTest'] = Join-Path $projectFolders['projectRoot'] test/NumSharp.UnitTest;
$projectFolders['UnitTest.Bin'] = Join-Path $projectFolders['UnitTest'] bin
$projectFolders['UnitTest.CSPROJ'] = Join-Path $projectFolders['UnitTest'] NumSharp.UnitTest.csproj
# clear all items before testing
if (Test-Path -Path ($projectFolders['UnitTest.Bin'] ) )
{
Write-Output "bin folder found - remove items";
$puffer = Get-ChildItem -Path $projectFolders['UnitTest.Bin'] -Recurse;
for($idx = 0;$idx -lt $puffer.Length;$idx++)
{
Write-Output (" - " + $puffer[$idx] );
}
Remove-Item -Path $projectFolders['UnitTest.Bin'] -Recurse
}
dotnet build ./src/NumSharp.Core/NumSharp.Core.csproj
dotnet build ./test/NumSharp.UnitTest/NumSharp.UnitTest.csproj
$generatedDlls = Get-ChildItem -Recurse -File -Path $projectFolders['UnitTest.Bin']
Write-Output "following items exist:"
for($idx =0; $idx -lt $generatedDlls.Length;$idx++)
{
Write-Output (" - " + $generatedDlls[$idx].Name)
}
dotnet test $projectFolders['UnitTest.CSPROJ']