Skip to content

Commit

Permalink
Parallel Build and Unit Testing + Improved Unit Test Engine (#1065)
Browse files Browse the repository at this point in the history
* - Parallelized build and test

* - Fix

* - Fix

* - Fix

* - Fix

* - name: Set net7.0
        uses: actions/setup-dotnet@v3
        with:
          dotnet-version: '7.0.x'

* - Fix

* - Fix

* - Fix

* - Fix

* - Fix

* - Fix

* - Fix

* - Fix

* - Fix

* - Fix

* - Improved UnitTest Engine

* - Improved UnitTest Engine

* - Improved UnitTest Engine

* - Improved UnitTest Engine

* - Improved UnitTest Engine

* - Improved UnitTest Engine

* - Improved UnitTest Engine

* - Improved UnitTest Engine

* - Improved UnitTest Engine

* - Improved UnitTest Engine

* - Improved UnitTest Engine

* - Updated builds.yml

* - Updated builds.yml

* - Updated builds.yml
  • Loading branch information
tgiphil committed Jun 14, 2023
1 parent 541fd56 commit 5a80b94
Show file tree
Hide file tree
Showing 13 changed files with 700 additions and 498 deletions.
204 changes: 119 additions & 85 deletions .github/workflows/builds.yml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Source/Docs/command-line-arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ Below are the command line arguments available:
-breakpoints,Debugger.BreakpointFile,{value}
-watch,Debugger.WatchFile,{value}

Unit Testings:
-unittest-maxerrors,UnitTest.MaxErrors,{value}

Optimization Levels:
-o0,Optimizations.Basic,false
-o0,Optimizations.SSA,false
Expand Down
12 changes: 12 additions & 0 deletions Source/Docs/settings-options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,15 @@ Import Settings
:widths: 50, 200

Import,Filename of another settings file to import


Unit Test Settings
---------------

.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

UnitTest.MaxErrors,Maximum number of errors before aborting the unit testing
UnitTest.Connection.TimeOut,Maximum connection timeout in milliseconds before retrying
UnitTest.Connection.MaxAttempts,Maximun number of restart attempts before aborting the unit tests
26 changes: 26 additions & 0 deletions Source/Mosa.Compiler.Common/WatchDog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using System.Diagnostics;

namespace Mosa.Compiler.Common
{
public class WatchDog
{
private Stopwatch watch = new Stopwatch();

public long TimeOutMilliseconds = 0;

public bool IsTimedOut => watch.ElapsedMilliseconds > TimeOutMilliseconds;

public WatchDog(long timeOutMilliseconds)
{
TimeOutMilliseconds = timeOutMilliseconds;
watch.Start();
}

public void Restart()
{
watch.Restart();
}
}
}
3 changes: 3 additions & 0 deletions Source/Mosa.Utility.Configuration/CommandLineArguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ private static List<Argument> GetMap()
new Argument { Name = "-breakpoints", Setting = "Debugger.BreakpointFile"},
new Argument { Name = "-watch", Setting = "Debugger.WatchFile"},

// Unit Test:
new Argument { Name = "-unittest-maxerrors", Setting = "UnitTest.MaxErrors"},

// Optimization Levels:
new Argument { Name = "-o0", Setting = "Optimizations.Basic", Value = "false"},
new Argument { Name = "-o0", Setting = "Optimizations.SSA", Value = "false"},
Expand Down

0 comments on commit 5a80b94

Please sign in to comment.