Skip to content

Commit 2859c90

Browse files
committed
Naggum.Test: our first test method.
1 parent 05a2934 commit 2859c90

4 files changed

Lines changed: 92 additions & 0 deletions

File tree

Naggum.Test/CompilerTest.fs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace Naggum.Test
2+
open Naggum.Compiler
3+
open NUnit.Framework
4+
open System.Diagnostics
5+
open System.IO
6+
7+
[<TestFixture>]
8+
type CompilerTest() =
9+
let sourceFilename = @"..\..\..\tests\test.naggum"
10+
11+
[<Test>]
12+
member this.RunTest() =
13+
let filename = "test.exe"
14+
15+
use stream = File.Open(sourceFilename, FileMode.Open)
16+
Generator.compile stream "test" filename []
17+
ignore <| (Process.Start filename).WaitForExit(30000) // 30 sec should be enough

Naggum.Test/Naggum.Test.fsproj

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>8.0.30703</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{38230cbd-de3e-4470-925f-de966e8691aa}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<RootNamespace>Naggum.Test</RootNamespace>
11+
<AssemblyName>Naggum.Test</AssemblyName>
12+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
13+
<Name>Naggum.Test</Name>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<Tailcalls>false</Tailcalls>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<WarningLevel>3</WarningLevel>
23+
<DocumentationFile>bin\Debug\Naggum.Test.XML</DocumentationFile>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<Tailcalls>true</Tailcalls>
29+
<OutputPath>bin\Release\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<WarningLevel>3</WarningLevel>
32+
<DocumentationFile>bin\Release\Naggum.Test.XML</DocumentationFile>
33+
</PropertyGroup>
34+
<Import Project="$(MSBuildExtensionsPath32)\FSharp\1.0\Microsoft.FSharp.Targets" Condition="!Exists('$(MSBuildBinPath)\Microsoft.Build.Tasks.v4.0.dll')" />
35+
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\Microsoft.FSharp.Targets" Condition=" Exists('$(MSBuildBinPath)\Microsoft.Build.Tasks.v4.0.dll')" />
36+
<ItemGroup>
37+
<Compile Include="CompilerTest.fs" />
38+
<None Include="packages.config" />
39+
</ItemGroup>
40+
<ItemGroup>
41+
<Reference Include="mscorlib" />
42+
<Reference Include="FSharp.Core" />
43+
<Reference Include="nunit.framework">
44+
<HintPath>..\packages\NUnit.2.6.1\lib\nunit.framework.dll</HintPath>
45+
<Private>True</Private>
46+
</Reference>
47+
<Reference Include="System" />
48+
<Reference Include="System.Core" />
49+
<Reference Include="System.Numerics" />
50+
</ItemGroup>
51+
<ItemGroup>
52+
<ProjectReference Include="..\ngc\ngc.fsproj">
53+
<Name>ngc</Name>
54+
<Project>{a4269c5e-e4ac-44bf-a06e-1b45248910ad}</Project>
55+
<Private>True</Private>
56+
</ProjectReference>
57+
</ItemGroup>
58+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
59+
Other similar extension points exist, see Microsoft.Common.targets.
60+
<Target Name="BeforeBuild">
61+
</Target>
62+
<Target Name="AfterBuild">
63+
</Target>
64+
-->
65+
</Project>

Naggum.Test/packages.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="NUnit" version="2.6.1" targetFramework="net40" />
4+
</packages>

Naggum.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test programs", "Test progr
1010
EndProject
1111
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Naggum.Runtime", "Naggum.Runtime\Naggum.Runtime.csproj", "{402B5E79-E063-4833-AE4B-2986AEEC1D75}"
1212
EndProject
13+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Naggum.Test", "Naggum.Test\Naggum.Test.fsproj", "{38230CBD-DE3E-4470-925F-DE966E8691AA}"
14+
EndProject
1315
Global
1416
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1517
Debug|Any CPU = Debug|Any CPU
@@ -24,6 +26,10 @@ Global
2426
{402B5E79-E063-4833-AE4B-2986AEEC1D75}.Debug|Any CPU.Build.0 = Debug|Any CPU
2527
{402B5E79-E063-4833-AE4B-2986AEEC1D75}.Release|Any CPU.ActiveCfg = Release|Any CPU
2628
{402B5E79-E063-4833-AE4B-2986AEEC1D75}.Release|Any CPU.Build.0 = Release|Any CPU
29+
{38230CBD-DE3E-4470-925F-DE966E8691AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30+
{38230CBD-DE3E-4470-925F-DE966E8691AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
31+
{38230CBD-DE3E-4470-925F-DE966E8691AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
32+
{38230CBD-DE3E-4470-925F-DE966E8691AA}.Release|Any CPU.Build.0 = Release|Any CPU
2733
EndGlobalSection
2834
GlobalSection(SolutionProperties) = preSolution
2935
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)