Skip to content

Commit

Permalink
Reintegrate testing -- #54
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitz committed Jul 23, 2021
1 parent e7aa194 commit 287adf8
Show file tree
Hide file tree
Showing 38 changed files with 1,745 additions and 42,385 deletions.
26 changes: 24 additions & 2 deletions ANTLR4ParseTreeVisualizer.Dev.sln
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,29 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Standard.Package", "Standar
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_visualizerTestNoRef", "_visualizerTestNoRef\_visualizerTestNoRef.csproj", "{CADA5CBA-1FE0-48A2-BF4F-7158C1CFF44F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_visualizerTestStandard", "_visualizerTestStandard\_visualizerTestStandard.csproj", "{1363D6B6-6D48-4A62-A533-3432F74A04F9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_visualizerTestStandard", "_visualizerTestStandard\_visualizerTestStandard.csproj", "{1363D6B6-6D48-4A62-A533-3432F74A04F9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_visualizerTestStandardNoRef", "_visualizerTestStandardNoRef\_visualizerTestStandardNoRef.csproj", "{05FA4741-B091-4075-8355-53C2BC48AACD}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_visualizerTestStandardNoRef", "_visualizerTestStandardNoRef\_visualizerTestStandardNoRef.csproj", "{05FA4741-B091-4075-8355-53C2BC48AACD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{74A0EB35-5FC5-40D6-BD6A-199A070ED68D}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Test.Shared", "Test\Test.Shared\Test.Shared.shproj", "{ED8BAF15-5B0B-4027-9B23-DD14B24739DB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.Legacy", "Test\Test.Legacy\Test.Legacy.csproj", "{01945C0C-2E1A-4FB7-A26B-544FACEA3DA5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.Standard", "Test\Test.Standard\Test.Standard.csproj", "{0268B6F3-FD77-452C-AFB4-75FA81BF5947}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Test\Test.Shared\Test.Shared.projitems*{01945c0c-2e1a-4fb7-a26b-544facea3da5}*SharedItemsImports = 5
Test\Test.Shared\Test.Shared.projitems*{0268b6f3-fd77-452c-afb4-75fa81bf5947}*SharedItemsImports = 5
Debuggee\Debuggee.projitems*{127b215f-f3f8-44df-a2d1-9aaf95b3f8f3}*SharedItemsImports = 13
Visualizer\Visualizer.projitems*{3c553ffd-fa4e-4eab-ad03-9534c7cb8f3e}*SharedItemsImports = 13
Debuggee\Debuggee.projitems*{ae5a655c-c17c-4fbb-be45-13e49a5c7bc8}*SharedItemsImports = 5
Serialization\Serialization.projitems*{ae5a655c-c17c-4fbb-be45-13e49a5c7bc8}*SharedItemsImports = 5
UI\UI.projitems*{e2b06997-76f1-48de-abe6-cf90427423bb}*SharedItemsImports = 13
Serialization\Serialization.projitems*{e3b0367b-3649-4b77-878a-85a8a11c4c09}*SharedItemsImports = 13
Test\Test.Shared\Test.Shared.projitems*{ed8baf15-5b0b-4027-9b23-dd14b24739db}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -101,6 +112,14 @@ Global
{05FA4741-B091-4075-8355-53C2BC48AACD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{05FA4741-B091-4075-8355-53C2BC48AACD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{05FA4741-B091-4075-8355-53C2BC48AACD}.Release|Any CPU.Build.0 = Release|Any CPU
{01945C0C-2E1A-4FB7-A26B-544FACEA3DA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{01945C0C-2E1A-4FB7-A26B-544FACEA3DA5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{01945C0C-2E1A-4FB7-A26B-544FACEA3DA5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{01945C0C-2E1A-4FB7-A26B-544FACEA3DA5}.Release|Any CPU.Build.0 = Release|Any CPU
{0268B6F3-FD77-452C-AFB4-75FA81BF5947}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0268B6F3-FD77-452C-AFB4-75FA81BF5947}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0268B6F3-FD77-452C-AFB4-75FA81BF5947}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0268B6F3-FD77-452C-AFB4-75FA81BF5947}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -112,6 +131,9 @@ Global
{74F8A769-77D2-4889-BB81-2FF397C220B9} = {C0ADF39C-DD3F-4EBD-AC9C-7D1E5D5CD0A8}
{F09CFEBD-151C-487C-BC87-1EA68B5A4043} = {5F2046EA-A159-4673-B7B9-F1F3179C5D6C}
{D7950FB3-F80E-4249-99D1-F08E3A64CA0E} = {C0ADF39C-DD3F-4EBD-AC9C-7D1E5D5CD0A8}
{ED8BAF15-5B0B-4027-9B23-DD14B24739DB} = {74A0EB35-5FC5-40D6-BD6A-199A070ED68D}
{01945C0C-2E1A-4FB7-A26B-544FACEA3DA5} = {74A0EB35-5FC5-40D6-BD6A-199A070ED68D}
{0268B6F3-FD77-452C-AFB4-75FA81BF5947} = {74A0EB35-5FC5-40D6-BD6A-199A070ED68D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A2A19EFC-E356-4E97-8752-D94ABBE584B0}
Expand Down
22 changes: 22 additions & 0 deletions ANTLR4ParseTreeVisualizer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,25 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Legacy.Package", "Legacy\Pa
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Standard.Package", "Standard\Package\Standard.Package.csproj", "{D7950FB3-F80E-4249-99D1-F08E3A64CA0E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{740AF50E-F735-4E54-8091-7DF29ABBD05A}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Test.Shared", "Test\Test.Shared\Test.Shared.shproj", "{ED8BAF15-5B0B-4027-9B23-DD14B24739DB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.Legacy", "Test\Test.Legacy\Test.Legacy.csproj", "{22587B08-85CE-4383-B754-86808D0713E4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.Standard", "Test\Test.Standard\Test.Standard.csproj", "{40F8B1E1-E78C-4231-8ACE-3EE5A9486609}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Debuggee\Debuggee.projitems*{127b215f-f3f8-44df-a2d1-9aaf95b3f8f3}*SharedItemsImports = 13
Test\Test.Shared\Test.Shared.projitems*{22587b08-85ce-4383-b754-86808d0713e4}*SharedItemsImports = 5
Visualizer\Visualizer.projitems*{3c553ffd-fa4e-4eab-ad03-9534c7cb8f3e}*SharedItemsImports = 13
Test\Test.Shared\Test.Shared.projitems*{40f8b1e1-e78c-4231-8ace-3ee5a9486609}*SharedItemsImports = 5
Debuggee\Debuggee.projitems*{ae5a655c-c17c-4fbb-be45-13e49a5c7bc8}*SharedItemsImports = 5
Serialization\Serialization.projitems*{ae5a655c-c17c-4fbb-be45-13e49a5c7bc8}*SharedItemsImports = 5
UI\UI.projitems*{e2b06997-76f1-48de-abe6-cf90427423bb}*SharedItemsImports = 13
Serialization\Serialization.projitems*{e3b0367b-3649-4b77-878a-85a8a11c4c09}*SharedItemsImports = 13
Test\Test.Shared\Test.Shared.projitems*{ed8baf15-5b0b-4027-9b23-dd14b24739db}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -71,6 +82,14 @@ Global
{D7950FB3-F80E-4249-99D1-F08E3A64CA0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7950FB3-F80E-4249-99D1-F08E3A64CA0E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7950FB3-F80E-4249-99D1-F08E3A64CA0E}.Release|Any CPU.Build.0 = Release|Any CPU
{22587B08-85CE-4383-B754-86808D0713E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22587B08-85CE-4383-B754-86808D0713E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22587B08-85CE-4383-B754-86808D0713E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22587B08-85CE-4383-B754-86808D0713E4}.Release|Any CPU.Build.0 = Release|Any CPU
{40F8B1E1-E78C-4231-8ACE-3EE5A9486609}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{40F8B1E1-E78C-4231-8ACE-3EE5A9486609}.Debug|Any CPU.Build.0 = Debug|Any CPU
{40F8B1E1-E78C-4231-8ACE-3EE5A9486609}.Release|Any CPU.ActiveCfg = Release|Any CPU
{40F8B1E1-E78C-4231-8ACE-3EE5A9486609}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -82,6 +101,9 @@ Global
{74F8A769-77D2-4889-BB81-2FF397C220B9} = {C0ADF39C-DD3F-4EBD-AC9C-7D1E5D5CD0A8}
{F09CFEBD-151C-487C-BC87-1EA68B5A4043} = {5F2046EA-A159-4673-B7B9-F1F3179C5D6C}
{D7950FB3-F80E-4249-99D1-F08E3A64CA0E} = {C0ADF39C-DD3F-4EBD-AC9C-7D1E5D5CD0A8}
{ED8BAF15-5B0B-4027-9B23-DD14B24739DB} = {740AF50E-F735-4E54-8091-7DF29ABBD05A}
{22587B08-85CE-4383-B754-86808D0713E4} = {740AF50E-F735-4E54-8091-7DF29ABBD05A}
{40F8B1E1-E78C-4231-8ACE-3EE5A9486609} = {740AF50E-F735-4E54-8091-7DF29ABBD05A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A2A19EFC-E356-4E97-8752-D94ABBE584B0}
Expand Down
7 changes: 7 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<ShowAllFiles>true</ShowAllFiles>
<Nullable>enable</Nullable>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion Legacy/Debuggee/Legacy.Debuggee.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ZSpitz.Util" Version="0.1.113" />
<PackageReference Include="ZSpitz.Util" Version="0.1.114" />
<PackageReference Include="Antlr4.Runtime" Version="4.6.6" />
<Reference Include="Microsoft.VisualStudio.DebuggerVisualizers">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.DebuggerVisualizers.dll</HintPath>
Expand Down
4 changes: 2 additions & 2 deletions Legacy/Debugger/Legacy.Debugger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ZSpitz.Util" Version="0.1.113" />
<PackageReference Include="ZSpitz.Util.Wpf" Version="0.1.113" />
<PackageReference Include="ZSpitz.Util" Version="0.1.114" />
<PackageReference Include="ZSpitz.Util.Wpf" Version="0.1.114" />
<PackageReference Include="Antlr4.Runtime" Version="4.6.6" />
<Reference Include="Microsoft.VisualStudio.DebuggerVisualizers">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.DebuggerVisualizers.dll</HintPath>
Expand Down
6 changes: 3 additions & 3 deletions Legacy/Package/Legacy.Package.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>net472</TargetFrameworks>
<RootNamespace>ParseTreeVisualizer</RootNamespace>
<AssemblyName>ParseTreeVisualizer.UI.Legacy</AssemblyName>
<LangVersion>9.0</LangVersion>
Expand All @@ -25,8 +25,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ZSpitz.Util" Version="0.1.113" />
<PackageReference Include="ZSpitz.Util.Wpf" Version="0.1.113" />
<PackageReference Include="ZSpitz.Util" Version="0.1.114" />
<PackageReference Include="ZSpitz.Util.Wpf" Version="0.1.114" />
<PackageReference Include="Antlr4.Runtime" Version="4.6.6" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.31" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
Expand Down
14 changes: 4 additions & 10 deletions Serialization/VisualizerData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ public class VisualizerData {
public bool CanSelectLexer { get; }
public bool CanSelectParser { get; }

private static readonly string[] ignnoreLoadErrors = new[] {
"Microsoft.Xaml.Behaviors"
};

public VisualizerData(object o, Config config) {
if (config is null) { throw new ArgumentNullException(nameof(config)); }

Expand All @@ -42,12 +38,10 @@ T createInstance<T>(string typename, object[]? args = null) =>
.Where(x => x != GetType().Assembly)
.SelectMany(x => {
var ret = Empty<Type>();
if (!x.FullName.StartsWithAny(ignnoreLoadErrors)) {
try {
ret = x.GetTypes();
} catch {
AssemblyLoadErrors.Add(x.FullName);
}
try {
ret = x.GetTypes();
} catch {
AssemblyLoadErrors.Add(x.FullName);
}
return ret;
})
Expand Down
2 changes: 1 addition & 1 deletion Standard/Debuggee/Standard.Debuggee.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ZSpitz.Util" Version="0.1.113" />
<PackageReference Include="ZSpitz.Util" Version="0.1.114" />
<PackageReference Include="Antlr4.Runtime.Standard" Version="4.9.2" />
<Reference Include="Microsoft.VisualStudio.DebuggerVisualizers">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.DebuggerVisualizers.dll</HintPath>
Expand Down
4 changes: 2 additions & 2 deletions Standard/Debugger/Standard.Debugger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ZSpitz.Util" Version="0.1.113" />
<PackageReference Include="ZSpitz.Util.Wpf" Version="0.1.113" />
<PackageReference Include="ZSpitz.Util" Version="0.1.114" />
<PackageReference Include="ZSpitz.Util.Wpf" Version="0.1.114" />
<PackageReference Include="Antlr4.Runtime.Standard" Version="4.9.2" />
<Reference Include="Microsoft.VisualStudio.DebuggerVisualizers">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.DebuggerVisualizers.dll</HintPath>
Expand Down
4 changes: 2 additions & 2 deletions Standard/Package/Standard.Package.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ZSpitz.Util" Version="0.1.113" />
<PackageReference Include="ZSpitz.Util.Wpf" Version="0.1.113" />
<PackageReference Include="ZSpitz.Util" Version="0.1.114" />
<PackageReference Include="ZSpitz.Util.Wpf" Version="0.1.114" />
<PackageReference Include="Antlr4.Runtime.Standard" Version="4.9.2" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.31" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
Expand Down
47 changes: 47 additions & 0 deletions Test/Test.Legacy/Test.Legacy.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0-windows</TargetFramework>
<RootNamespace>ParseTreeVisualizer.Test</RootNamespace>
<IsPackable>false</IsPackable>
<UseWpf>true</UseWpf>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Antlr4" Version="4.6.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Antlr4.Runtime" Version="4.6.6" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="ZSpitz.Util" Version="0.1.114" />
<PackageReference Include="ZSpitz.Util.Wpf" Version="0.1.114" />

<Antlr4 Include="..\Test.Shared\Grammar\SQLiteLexer.g4">
<Generator>MSBuild:Compile</Generator>
<CustomToolNamespace>ParseTreeVisualizer.Test</CustomToolNamespace>
<Listener>False</Listener>
<Visitor>False</Visitor>
</Antlr4>

<Antlr4 Include="..\Test.Shared\Grammar\SQLiteParser.g4">
<Generator>MSBuild:Compile</Generator>
<CustomToolNamespace>ParseTreeVisualizer.Test</CustomToolNamespace>
<Listener>False</Listener>
<Visitor>False</Visitor>
</Antlr4>

<ProjectReference Include="..\..\Legacy\Package\Legacy.Package.csproj" />
</ItemGroup>

<Import Project="..\Test.Shared\Test.Shared.projitems" Label="Shared" />
</Project>
25 changes: 25 additions & 0 deletions Test/Test.Shared/Extensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;

namespace ParseTreeVisualizer.Test {
public static class Extensions {
public static TheoryData<T1, T2> ToTheoryData<T1, T2>(this IEnumerable<(T1, T2)> src) {
var ret = new TheoryData<T1, T2>();
foreach (var (a, b) in src) {
ret.Add(a, b);
}
return ret;
}
public static TheoryData<T1, T2, T3, T4> ToTheoryData<T1, T2, T3, T4>(this IEnumerable<(T1, T2, T3, T4)> src) {
var ret = new TheoryData<T1, T2, T3, T4>();
foreach (var (a, b, c, d) in src) {
ret.Add(a, b, c, d);
}
return ret;
}
}
}
File renamed without changes.
Loading

0 comments on commit 287adf8

Please sign in to comment.