20 private readonly List<BadNUnitTestCase>
m_Cases =
new List<BadNUnitTestCase>();
30 private readonly List<BadFunction>
m_Setup =
new List<BadFunction>();
35 private readonly List<BadFunction>
m_Teardown =
new List<BadFunction>();
56 public void Register(
bool optimizeFolding,
bool optimizeSubstitution, params
string[] files)
58 foreach (
string file
in files)
60 SetupStage(file, optimizeFolding, optimizeSubstitution);
86 name = (testName as
IBadString)?.Value ??
throw new InvalidOperationException(
"Test name must be a string");
129 private void SetupStage(
string file,
bool optimizeFolding =
false,
bool optimizeSubstitution =
false)
139 if (optimizeSubstitution)
Exposes the BadScript Runtime Functionality to Consumers.
BadRuntime Clone()
Clone this Runtime.
BadRuntimeExecutionResult Execute(IEnumerable< BadExpression > expressions, string workingDirectory)
Executes the specified expressions.
BadRuntime UseApi(BadInteropApi api, bool replace=false)
Adds or Replaces a specified API.
Public interface for the filesystem abstraction of the BadScript Engine.
static string ReadAllText(this IFileSystem fileSystem, string path)
static IFileSystem Instance
File System implementation.
Implements the "NUnit" Api(Console Version)
void SetContext(BadUnitTestContextBuilder console)
Represents a BadScript NUnit Test Case.
Builds a BadScript NUnit Test Context.
void AddSetup(BadFunction function)
Adds a Setup Function to the Test Context.
void Reset()
Resets the Builder state.
void SetupStage(string file, bool optimizeFolding=false, bool optimizeSubstitution=false)
Runs the Setup Stage Registering test cases and setup/teardown functions happens here.
void AddTest(BadFunction function, BadObject testName, bool allowCompile=true)
Adds a Test Case to the Test Context.
readonly BadRuntime m_Runtime
The Runtime.
BadUnitTestContext CreateContext(string workingDir)
Creates a new BadUnitTestContext.
BadUnitTestContextBuilder(BadRuntime runtime)
Constructs a new BadUnitTestContextBuilder.
void AddTeardown(BadFunction function)
Adds a Teardown Function to the Test Context.
readonly List< BadNUnitTestCase > m_Cases
The Test Cases.
readonly List< BadFunction > m_Setup
The Setup Functions.
readonly List< BadFunction > m_Teardown
The Teardown Functions.
void Register(bool optimizeFolding, bool optimizeSubstitution, params string[] files)
Registers one or multiple files to the Test Context.
Implements a BadScript NUnit Test Context.
Implements a simple constant folding optimization.
static BadExpression Optimize(BadExpression expr)
Optimizes the given expression.
Contains the Implementation of the Constant Substitution Optimization This optimization replaces expr...
static IEnumerable< BadExpression > Optimize(BadConstantSubstitutionOptimizerScope scope, IEnumerable< BadExpression > expressions)
Substitutes all variables in the expressions with their constant value.
The Parser of the Language. It turns Source Code into an Expression Tree.
static BadSourceParser Create(string fileName, string source)
Creates a BadSourceParser Instance based on the source and filename provided.
static IEnumerable< BadExpression > Parse(string fileName, string source)
Parses a BadExpression from the Source Reader.
The Base Class for all BadScript Objects.
static readonly BadObject Null
The Null Value for the BadScript Language.
Implements a function that can be called from the script.
string GetFullPath(string path)
Returns the full path of the given path.
Implements the Interface for Native Strings.
Contains IO Implementation for the BadScript2 Runtime.
Contains NUnit Extensions and APIs for the BadScript2 Runtime.
Contains the BadScript2 Constant Folding Optimizations.
Contains the BadScript2 Constant Substitution Optimizations.
Contains the Expressions for the BadScript2 Language.
Contains the Parser for the BadScript2 Language.
Contains Runtime Function Objects.
Contains the Native Runtime Objects.
Contains the Runtime Objects.