Skip to content

Commit

Permalink
Merge pull request #134 from dpanfilyonok/fix-tests
Browse files Browse the repository at this point in the history
Fix tests running
  • Loading branch information
gsvgit authored Mar 23, 2022
2 parents 2577b43 + d2904b9 commit ee100a0
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 227 deletions.
256 changes: 32 additions & 224 deletions tests/Brahma.FSharp.Tests/Brahma.FSharp.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -1,227 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<GenerateProgramFile>false</GenerateProgramFile>
<LangVersion>4.7</LangVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Common.fs" />
<Compile Include="FullTests.fs" />
<Compile Include="WorkflowTests.fs" />
<Compile Include="TranslatorTests.fs" />
<Compile Include="QuotationsTransformerTests.fs" />
<Compile Include="CompositeTypesTests.fs" />
<Compile Include="UnionTests.fs" />
<Compile Include="AtomicTests.fs" />
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Brahma.FSharp.OpenCL.Core\Brahma.FSharp.OpenCL.Core.fsproj" />
<ProjectReference Include="..\..\src\Brahma.FSharp.OpenCL.Translator\Brahma.FSharp.OpenCL.Translator.fsproj" />
<ProjectReference Include="..\..\src\YC.OpenCL.NET\YC.OpenCL.NET.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="Expected\Array.Item.Set.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Binary.Operations.Math.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Binding.And.FOR.Counter.Conflict.1.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Binding.And.FOR.Counter.Conflict.2.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Binding.And.FOR.Counter.Conflict.3.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Binding.And.FOR.Counter.Conflict.4.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Binding.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Binding.In.FOR.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Binding.In.IF.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Binding.In.WHILE.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Bindings.With.Equal.Names.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Binop.Plus.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Constant array translation. Test 2.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Constant array translation. Test 1.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\For.Integer.Loop.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\If.Then.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\If.Then.Else.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Let renamed 2.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Let renamed.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\LocalMemory.int.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\LocalMemory.float.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\LocalMemory.int [].cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\LocalID1D.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\LocalID2D.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Nested.Function.Carring.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Nested.Function.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Quotations.Injections.1.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Quotations.Injections.2.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Renamer Test.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Seq.With.Bindings.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Sequential.Bindings.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Simple.Seq.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Simple.WHILE.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Template Test 0.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Template Test 1.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Template Test 10.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Template Test 11.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Template Test 12.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Template Test 13.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Template Test 14.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Template Test 15.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Template Test 16.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Template Test 2.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Template Test 3.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Template Test 4.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Template Test 5.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Template Test 6.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Template Test 7.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Template Test 8.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Template Test 9.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\WHILE.with.complex.condition.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Nested.Function.Carring2.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Printf test 1.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Printf test 2.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Printf test 3.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Printf test 4.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Printf test 5.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\Printf test 6.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="UnionExpected\Translation.Test1.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="UnionExpected\Union.Compile.Test1.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="UnionExpected\Union.Compile.Test2.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="UnionExpected\Union.Compile.Test3.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="UnionExpected\Union.Compile.Test4.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="UnionExpected\Union.Compile.Test5.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="UnionExpected\Union.Compile.Test6.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="UnionExpected\Union.Compile.Test7.cl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<GenerateProgramFile>false</GenerateProgramFile>
<LangVersion>4.7</LangVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.fs"/>
<Compile Include="Common.fs"/>
<Compile Include="FullTests.fs"/>
<Compile Include="WorkflowTests.fs"/>
<Compile Include="TranslatorTests.fs"/>
<Compile Include="QuotationsTransformerTests.fs"/>
<Compile Include="CompositeTypesTests.fs"/>
<Compile Include="UnionTests.fs"/>
<Compile Include="AtomicTests.fs"/>
<Compile Include="Program.fs"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Brahma.FSharp.OpenCL.Core\Brahma.FSharp.OpenCL.Core.fsproj"/>
<ProjectReference Include="..\..\src\Brahma.FSharp.OpenCL.Translator\Brahma.FSharp.OpenCL.Translator.fsproj"/>
<ProjectReference Include="..\..\src\YC.OpenCL.NET\YC.OpenCL.NET.csproj"/>
</ItemGroup>
<ItemGroup>
<Content Include="UnionExpected\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Expected\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets"/>
</Project>
3 changes: 2 additions & 1 deletion tests/Brahma.FSharp.Tests/Expected/Printf test 3.cl
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ __kernel void brahmaKernel (__global int * xs)
{int i = 0 ;
while ((i < 10))
{xs [0] = (i * 2) ;
printf ("i = %d, xs.[0]*10 = %d\n", i, (xs [0] + 10)) ;} ;}
printf ("i = %d, xs.[0]*10 = %d\n", i, (xs [0] + 10)) ;
i = (i + 1) ;} ;}
2 changes: 1 addition & 1 deletion tests/Brahma.FSharp.Tests/FullTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ let kernelArgumentsTests = testList "Kernel arguments tests" [

Expect.sequenceEqual actual expected "Arrays should be equals"

testProperty "Parallel execution of kernel" <| fun _const ->
ptestProperty "Parallel execution of kernel" <| fun _const ->
let n = 4
let l = 256
let getAllocator (context: ClContext) =
Expand Down
1 change: 0 additions & 1 deletion tests/Brahma.FSharp.Tests/Program.fs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
open Expecto

open Brahma.FSharp.Tests
open Brahma.FSharp.OpenCL

[<Tests>]
let allTests =
Expand Down
1 change: 1 addition & 0 deletions tests/Brahma.FSharp.Tests/TranslatorTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ let printfTests = testList "Translation of printf" [
while i < 10 do
xs.[0] <- i * 2
printf "i = %d, xs.[0]*10 = %d\n" i (xs.[0] + 10)
i <- i + 1
@>

checkCode command "Printf test 3.gen" "Printf test 3.cl"
Expand Down

0 comments on commit ee100a0

Please sign in to comment.