Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ bin
obj
*.pidb
*.userprefs
.vs/
packages/
znull.erlectric.1.0.0.nupkg
40 changes: 40 additions & 0 deletions CONTRIBUTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Developers Guide

## Buind Environment Setup

### Windows-Mono
Follow only if you're a cli-geek.
> NOTE: Commands below uses [chocolatey project](https://chocolatey.org) to install packages on windows environment
* install `mono`
```
choco install -y mono --version 5.20.1.19
```
* Install nunit3 console runner
```
choco install -y nunit-console-runner --version 3.10.0
```
* Install `nuget` binaries for command line
```
choco install -y nuget.commandline --version 5.0.2
```
* Install `msys2` binaries to run make.
> **NOTE:** You may also need to update path enviroment to use gnu tools from windows command line
```
choco install -y msys2
# Upgradle to latest binaries distribution
msys2_shell.cmd -msys -c "pacman -S -u --noconfirm"
# install make
msys2_shell.cmd -msys -c "pacman -S -y --noconfirm msys/make"
```

### Windows-VisualStudio
* Install visual studio (Latest verified version in `2017 Community`)
* Follow instructions to download additionl worksets
* Open `Erlectric.sln`
* ...
* GL HF

## Build
```
make
```
26 changes: 26 additions & 0 deletions Erlectric.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>znull.erlectric</id>
<version>1.0.0</version>
<title>Erlectric</title>
<authors>https://github.com/znull</authors>
<owners>https://github.com/znull</owners>
<license type="file">LICENSE</license>
<projectUrl>https://github.com/znull/erlectric</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>
Erlectric is a partial implementation of erlang's External Term Format for C#.
It serves as the backend for csharp-bert, but may be used independently.
The name and inspiration come from the excellent erlastic module for python.
</description>
<releaseNotes>Initial version of the package</releaseNotes>
<copyright>Copyright © 2013 Jason Lunz</copyright>
<tags>erlang</tags>
</metadata>
<files>
<file src="src\Erlectric\bin\Debug\Erlectric.dll" target="lib/net45/Erlectric.dll" />
<file src="src\Erlectric\bin\Debug\Erlectric.pdb" target="lib/net45/Erlectric.pdb" />
<file src="LICENSE" />
</files>
</package>
31 changes: 31 additions & 0 deletions Erlectric.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.168
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Erlectric", "src\Erlectric\Erlectric.csproj", "{A4A96C58-7257-4975-8B54-DDADFA902008}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Erlectric.Tests", "tests\Erlectric.Tests\Erlectric.Tests.csproj", "{9498AE7F-89D6-4BC8-BB5D-6E22B9FC79CC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A4A96C58-7257-4975-8B54-DDADFA902008}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A4A96C58-7257-4975-8B54-DDADFA902008}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4A96C58-7257-4975-8B54-DDADFA902008}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4A96C58-7257-4975-8B54-DDADFA902008}.Release|Any CPU.Build.0 = Release|Any CPU
{9498AE7F-89D6-4BC8-BB5D-6E22B9FC79CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9498AE7F-89D6-4BC8-BB5D-6E22B9FC79CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9498AE7F-89D6-4BC8-BB5D-6E22B9FC79CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9498AE7F-89D6-4BC8-BB5D-6E22B9FC79CC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {ADC6A1B8-A866-4842-B3A3-082881BF2CDB}
EndGlobalSection
EndGlobal
17 changes: 14 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
BUILD_CONFIG = Debug
ERLECTRIC_TEST_DLL = tests/Erlectric.Tests/bin/$(BUILD_CONFIG)/Erlectric.Tests.dll
NUNIT_OPTS = -noresult -nologo -stoponerror -labels
NUNIT_OPTS =
BUILD_OPTS =

test:
all: packages build test rel

build: packages
xbuild src/Erlectric/Erlectric.csproj
xbuild tests/Erlectric.Tests/Erlectric.Tests.csproj

nunit-console $(ERLECTRIC_TEST_DLL) $(NUNIT_OPTS)
test: build
nunit3-console $(ERLECTRIC_TEST_DLL) $(NUNIT_OPTS)

packages:
nuget restore -ConfigFile nuget.config

rel: all
nuget pack Erlectric.nuspec

clean:
rm -rf src/*/bin
rm -rf src/*/obj
rm -rf tests/*/bin
rm -rf tests/*/obj
rm -rf packages
44 changes: 44 additions & 0 deletions TestResult.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<test-run id="2" testcasecount="15" result="Passed" total="15" passed="15" failed="0" inconclusive="0" skipped="0" asserts="139" engine-version="3.10.0.0" clr-version="4.0.30319.42000" start-time="2019-05-16 12:33:31Z" end-time="2019-05-16 12:33:32Z" duration="0.701350">
<command-line><![CDATA["C:\ProgramData\chocolatey\lib\nunit-console-runner\tools\nunit3-console.exe" tests/Erlectric.Tests/bin/Debug/Erlectric.Tests.dll]]></command-line>
<test-suite type="Assembly" id="0-1017" name="Erlectric.Tests.dll" fullname="C:\tmp\erlectric\tests\Erlectric.Tests\bin\Debug\Erlectric.Tests.dll" runstate="Runnable" testcasecount="15" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.170496" total="15" passed="15" failed="0" warnings="0" inconclusive="0" skipped="0" asserts="139">
<environment framework-version="3.12.0.0" clr-version="4.0.30319.42000" os-version="Microsoft Windows NT 10.0.14393.0" platform="Win32NT" cwd="C:\tmp\erlectric" machine-name="DESKTOP-A71GHAR" user="vagrant" user-domain="DESKTOP-A71GHAR" culture="en-US" uiculture="en-US" os-architecture="x64" />
<settings>
<setting name="DisposeRunners" value="True" />
<setting name="WorkDirectory" value="C:\tmp\erlectric" />
<setting name="ImageRuntimeVersion" value="4.0.30319" />
<setting name="ImageTargetFrameworkName" value=".NETFramework,Version=v4.5" />
<setting name="ImageRequiresX86" value="False" />
<setting name="ImageRequiresDefaultAppDomainAssemblyResolver" value="False" />
<setting name="NumberOfTestWorkers" value="2" />
</settings>
<properties>
<property name="_PID" value="5016" />
<property name="_APPDOMAIN" value="domain-" />
</properties>
<test-suite type="TestSuite" id="0-1018" name="Erlectric" fullname="Erlectric" runstate="Runnable" testcasecount="15" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.146335" total="15" passed="15" failed="0" warnings="0" inconclusive="0" skipped="0" asserts="139">
<test-suite type="TestFixture" id="0-1000" name="ErlectricTests" fullname="Erlectric.ErlectricTests" classname="Erlectric.ErlectricTests" runstate="Runnable" testcasecount="15" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.141046" total="15" passed="15" failed="0" warnings="0" inconclusive="0" skipped="0" asserts="139">
<test-case id="0-1016" name="Test_LARGE_BIG_EXT" fullname="Erlectric.ErlectricTests.Test_LARGE_BIG_EXT" methodname="Test_LARGE_BIG_EXT" classname="Erlectric.ErlectricTests" runstate="Runnable" seed="1952307363" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.043172" asserts="4" />
<test-case id="0-1015" name="Test_SMALL_BIG_EXT" fullname="Erlectric.ErlectricTests.Test_SMALL_BIG_EXT" methodname="Test_SMALL_BIG_EXT" classname="Erlectric.ErlectricTests" runstate="Runnable" seed="1173243115" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.000802" asserts="4" />
<test-case id="0-1005" name="TestAtom" fullname="Erlectric.ErlectricTests.TestAtom" methodname="TestAtom" classname="Erlectric.ErlectricTests" runstate="Runnable" seed="291770419" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.018174" asserts="7" />
<test-case id="0-1006" name="TestAtomHashing" fullname="Erlectric.ErlectricTests.TestAtomHashing" methodname="TestAtomHashing" classname="Erlectric.ErlectricTests" runstate="Runnable" seed="638937988" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.007168" asserts="5" />
<test-case id="0-1007" name="TestBinary" fullname="Erlectric.ErlectricTests.TestBinary" methodname="TestBinary" classname="Erlectric.ErlectricTests" runstate="Runnable" seed="1562156102" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.000387" asserts="6" />
<test-case id="0-1003" name="TestBool" fullname="Erlectric.ErlectricTests.TestBool" methodname="TestBool" classname="Erlectric.ErlectricTests" runstate="Runnable" seed="2020936512" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.000681" asserts="2" />
<test-case id="0-1004" name="TestEmptyList" fullname="Erlectric.ErlectricTests.TestEmptyList" methodname="TestEmptyList" classname="Erlectric.ErlectricTests" runstate="Runnable" seed="1816238981" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.000290" asserts="1" />
<test-case id="0-1013" name="TestFloat" fullname="Erlectric.ErlectricTests.TestFloat" methodname="TestFloat" classname="Erlectric.ErlectricTests" runstate="Runnable" seed="1215741373" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.007939" asserts="7" />
<test-case id="0-1001" name="TestHeterogenousList" fullname="Erlectric.ErlectricTests.TestHeterogenousList" methodname="TestHeterogenousList" classname="Erlectric.ErlectricTests" runstate="Runnable" seed="1396989908" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.002805" asserts="3" />
<test-case id="0-1012" name="TestInt" fullname="Erlectric.ErlectricTests.TestInt" methodname="TestInt" classname="Erlectric.ErlectricTests" runstate="Runnable" seed="361120114" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.001213" asserts="81" />
<test-case id="0-1002" name="TestNull" fullname="Erlectric.ErlectricTests.TestNull" methodname="TestNull" classname="Erlectric.ErlectricTests" runstate="Runnable" seed="785523918" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.000429" asserts="1" />
<test-suite type="ParameterizedMethod" id="0-1011" name="TestString" fullname="Erlectric.ErlectricTests.TestString" classname="Erlectric.ErlectricTests" runstate="Runnable" testcasecount="3" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.009444" total="3" passed="3" failed="0" warnings="0" inconclusive="0" skipped="0" asserts="3">
<properties>
<property name="_JOINTYPE" value="Sequential" />
</properties>
<test-case id="0-1008" name="TestString(&quot;nonempty string&quot;)" fullname="Erlectric.ErlectricTests.TestString(&quot;nonempty string&quot;)" methodname="TestString" classname="Erlectric.ErlectricTests" runstate="Runnable" seed="295069013" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.000529" asserts="1" />
<test-case id="0-1009" name="TestString(&quot;unicode: ກ ຜ ໄ ໓&quot;)" fullname="Erlectric.ErlectricTests.TestString(&quot;unicode: ກ ຜ ໄ ໓&quot;)" methodname="TestString" classname="Erlectric.ErlectricTests" runstate="Runnable" seed="281406794" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.000091" asserts="1" />
<test-case id="0-1010" name="TestString(&quot;&quot;)" fullname="Erlectric.ErlectricTests.TestString(&quot;&quot;)" methodname="TestString" classname="Erlectric.ErlectricTests" runstate="Runnable" seed="843598995" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.000063" asserts="1" />
</test-suite>
<test-case id="0-1014" name="TestTuple" fullname="Erlectric.ErlectricTests.TestTuple" methodname="TestTuple" classname="Erlectric.ErlectricTests" runstate="Runnable" seed="104063105" result="Passed" start-time="2019-05-16 12:33:32Z" end-time="2019-05-16 12:33:32Z" duration="0.003386" asserts="15" />
</test-suite>
</test-suite>
</test-suite>
</test-run>
Binary file removed lib/nunit.framework.dll
Binary file not shown.
8 changes: 8 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<configuration>
<config>
<add key="repositoryPath" value="packages" />
</config>
<packageSources>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
</packageSources>
</configuration>
16 changes: 9 additions & 7 deletions src/Erlectric/Erlectric.csproj
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<Configuration Condition="'$(Configuration)' == '' ">Debug</Configuration>
<OutputPath>bin\$(Configuration)</OutputPath>
<Platform Condition="'$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A4A96C58-7257-4975-8B54-DDADFA902008}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Erlectric</RootNamespace>
<AssemblyName>Erlectric</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand All @@ -40,4 +42,4 @@
<Compile Include="Types.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
</Project>
54 changes: 53 additions & 1 deletion tests/Erlectric.Tests/Erlectric.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1 +1,53 @@
<?xml version="1.0" encoding="utf-8"?><Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion>10.0.0</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{9498AE7F-89D6-4BC8-BB5D-6E22B9FC79CC}</ProjectGuid> <OutputType>Library</OutputType> <RootNamespace>Erlectric.Tests</RootNamespace> <AssemblyName>Erlectric.Tests</AssemblyName> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug</OutputPath> <DefineConstants>DEBUG</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <ConsolePause>false</ConsolePause> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>none</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Release</OutputPath> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <ConsolePause>false</ConsolePause> </PropertyGroup> <ItemGroup> <Compile Include="AssemblyInfo.cs" /> <Compile Include="ErlectricTests.cs" /> </ItemGroup> <ItemGroup> <Reference Include="nunit.framework, Version=2.6.0.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\lib\nunit.framework.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\..\src\Erlectric\Erlectric.csproj"> <Project>{A4A96C58-7257-4975-8B54-DDADFA902008}</Project> <Name>Erlectric</Name> </ProjectReference> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /></Project>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9498AE7F-89D6-4BC8-BB5D-6E22B9FC79CC}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Erlectric.Tests</RootNamespace>
<AssemblyName>Erlectric.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="ErlectricTests.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>../../packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Erlectric\Erlectric.csproj">
<Project>{A4A96C58-7257-4975-8B54-DDADFA902008}</Project>
<Name>Erlectric</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
4 changes: 4 additions & 0 deletions tests/Erlectric.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Nunit" version="3.12.0" />
</packages>