summaryrefslogtreecommitdiff
path: root/Compiler.Testing
diff options
context:
space:
mode:
Diffstat (limited to 'Compiler.Testing')
-rw-r--r--Compiler.Testing/Compiler.Testing.csproj28
-rw-r--r--Compiler.Testing/SanityTests.cs43
-rw-r--r--Compiler.Testing/TestingHelpers.cs14
3 files changed, 0 insertions, 85 deletions
diff --git a/Compiler.Testing/Compiler.Testing.csproj b/Compiler.Testing/Compiler.Testing.csproj
deleted file mode 100644
index ed9c322..0000000
--- a/Compiler.Testing/Compiler.Testing.csproj
+++ /dev/null
@@ -1,28 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <TargetFramework>net9.0</TargetFramework>
- <LangVersion>latest</LangVersion>
- <ImplicitUsings>enable</ImplicitUsings>
- <Nullable>enable</Nullable>
- <IsPackable>false</IsPackable>
- </PropertyGroup>
-
- <ItemGroup>
- <PackageReference Include="coverlet.collector" Version="6.0.2"/>
- <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
- <PackageReference Include="NUnit" Version="4.2.2"/>
- <PackageReference Include="NUnit.Analyzers" Version="4.4.0"/>
- <PackageReference Include="NUnit3TestAdapter" Version="4.6.0"/>
- </ItemGroup>
-
- <ItemGroup>
- <Using Include="NUnit.Framework"/>
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="..\Compiler\Compiler.csproj" />
- <ProjectReference Include="..\Orchestrator\Orchestrator.csproj" />
- </ItemGroup>
-
-</Project>
diff --git a/Compiler.Testing/SanityTests.cs b/Compiler.Testing/SanityTests.cs
deleted file mode 100644
index 46c0323..0000000
--- a/Compiler.Testing/SanityTests.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-namespace Compiler.Testing;
-
-using Q1;
-
-[TestFixture]
-public class SanityTests
-{
- [Test]
- public void BlankProgram()
- {
- string program = """
- int main() { }
- """;
-
- string result = TestingHelpers.CompileString(program).Trim();
- Assert.That(
- result, Is.EqualTo(
- """
- jmp _main
- _main:
- mov 0, V0
- ret
- """));
- }
-
- [Test]
- public void ReturnConstant()
- {
- string program = """
- int main() { return 42; }
- """;
-
- string result = TestingHelpers.CompileString(program).Trim();
- Assert.That(
- result, Is.EqualTo(
- """
- jmp _main
- _main:
- mov 42, V0
- ret
- """));
- }
-} \ No newline at end of file
diff --git a/Compiler.Testing/TestingHelpers.cs b/Compiler.Testing/TestingHelpers.cs
deleted file mode 100644
index a3d85fe..0000000
--- a/Compiler.Testing/TestingHelpers.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-namespace Compiler.Testing;
-
-using Antlr4.Runtime;
-using Q1.Compiler;
-
-public class TestingHelpers
-{
- public static string CompileString(string input)
- {
- CompilerOptions options = new() { CommentCompilationMode = CommentCompilationMode.None };
- IEnumerable<string> lines = Program.Compile(options, new AntlrInputStream(input));
- return Program.Optimize(lines);
- }
-} \ No newline at end of file