Skip to content

Commit

Permalink
Merge pull request #105 from rbaker26/v2.0.1-rc
Browse files Browse the repository at this point in the history
Version 2.0.1 Release
  • Loading branch information
rbaker26 authored Oct 1, 2020
2 parents 7773e9e + 6819c8f commit f9df179
Show file tree
Hide file tree
Showing 251 changed files with 3,902 additions and 947 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/benchmarks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

name: Add Benchmark Results
on: [pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x' # SDK Version to use; x will use the latest version of the 3.1 channe
- name: build project
run:
dotnet build SAP1EMU.Benchmarks --configuration Release
- name: run benchamrks
run: dotnet run --project SAP1EMU.Benchmarks --no-build --configuration Release
- name: copy report
run: cp BenchmarkDotNet.Artifacts/results/SAP1EMU.Benchmarks.EngineBenchmark-report-github.md .github/workflows/
# && cp ./SAP1EMU.Benchmarks/bin/Release/netcoreapp3.1/BenchmarkDotNet.Artifacts/results/SAP1EMU.Benchmarks.EngineBenchmark-report-github.md .
- uses: harupy/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: SAP1EMU.Benchmarks.EngineBenchmark-report-github.md
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
SAP1EMU.GUI/Properties/*

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
Expand Down
15 changes: 8 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
language: csharp
solution: SAP1EMU-no-gui.sln
solution: SAP1EMU.sln
mono: none
dotnet: 3.1
script:
- dotnet build SAP1EMU-no-gui.sln
- dotnet test SAP1EMU-no-gui.sln
- dotnet build SAP1EMU.sln
- dotnet test SAP1EMU.Lib.Test -v n --no-build --collect:"XPlat Code Coverage"
- dotnet test SAP1EMU.CLI.Test -v n --no-build --collect:"XPlat Code Coverage"
- dotnet test SAP1EMU.Assembler.Test -v n --no-build --collect:"XPlat Code Coverage"
- dotnet test SAP1EMU.Engine.Test -v n --no-build --collect:"XPlat Code Coverage"

after_success:
- cd SAP1EMU.Lib.Test/
- dotnet add package coverlet.collector
- dotnet test --collect:"XPlat Code Coverage"
- bash <(curl -s https://codecov.io/bash)
- bash <(curl -s https://codecov.io/bash)
43 changes: 0 additions & 43 deletions SAP1EMU-no-gui.sln

This file was deleted.

20 changes: 20 additions & 0 deletions SAP1EMU.Assembler.Test/SAP1EMU.Assembler.Test.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.0" />
<PackageReference Include="coverlet.collector" Version="1.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SAP1EMU.Assembler\SAP1EMU.Assembler.csproj" />
</ItemGroup>

</Project>
13 changes: 13 additions & 0 deletions SAP1EMU.Assembler.Test/UnitTest1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace SAP1EMU.Assembler.Test
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
}
}
}
109 changes: 109 additions & 0 deletions SAP1EMU.Benchmarks/EngineBenchmark.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
using System;
using System.Collections.Generic;
using System.Text;

using BenchmarkDotNet.Attributes;

using SAP1EMU.Engine;
using SAP1EMU.Lib;

namespace SAP1EMU.Benchmarks
{
public class EngineBenchmark
{

RAMProgram RP_HLT { get; set; }
RAMProgram RP_LDA170 { get; set; }
RAMProgram RP_FIB{ get; set; }
IDecoder _decoder = new InstructionDecoder();

[GlobalSetup]
public void GlobalSetup()
{
RP_HLT = new RAMProgram(new List<string>() {
"11110000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000"
});

RP_LDA170 = new RAMProgram(new List<string>() {
"00001111",
"11100000",
"11110000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"00000000",
"10101010",
});

RP_FIB = new RAMProgram(new List<string>() {
"00001110",
"00011111",
"00111111",
"00001111",
"00111110",
"00001101",
"00011100",
"00111101",
"10011010",
"01000000",
"11100000",
"11110000",
"00000001",
"11111001",
"00000001",
"00000001",
});
}


[Benchmark(Baseline = true)]
public void EngineRun_HLT()
{
EngineProc engine = new EngineProc();

engine.Init(RP_HLT, _decoder);
engine.Run();
}

[Benchmark]
public void EngineRun_LDA170()
{
EngineProc engine = new EngineProc();

engine.Init(RP_LDA170, _decoder);
engine.Run();
}

[Benchmark]
public void EngineRun_FIB5()
{
EngineProc engine = new EngineProc();

engine.Init(RP_FIB, _decoder);
engine.Run();
}
}
}
14 changes: 14 additions & 0 deletions SAP1EMU.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;

using BenchmarkDotNet.Running;

namespace SAP1EMU.Benchmarks
{
class Program
{
static void Main(string[] args)
{
BenchmarkRunner.Run<EngineBenchmark>();
}
}
}
16 changes: 16 additions & 0 deletions SAP1EMU.Benchmarks/SAP1EMU.Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SAP1EMU.Engine\SAP1EMU.Engine.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit f9df179

Please sign in to comment.