Skip to content

Commit

Permalink
Add mkvalidator.exe to test project
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMoolenaar committed Jan 2, 2024
1 parent 30db10c commit 220a76b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
7 changes: 5 additions & 2 deletions MatroskaLib/MatroskaLib.Test/Helpers/MkvValidator.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;

namespace MatroskaLib.Test.Helpers;
Expand Down Expand Up @@ -29,8 +30,10 @@ public static void Validate(string filePath)
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.FileName = "mkvalidator";
p.StartInfo.Arguments = "\"" + filePath + "\"";
p.StartInfo.FileName = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ?
"mkvalidator.exe" :
"mkvalidator";
p.StartInfo.Arguments = $"\"{filePath}\"";
p.Start();
output = p.StandardError.ReadToEnd();
p.Close();
Expand Down
5 changes: 5 additions & 0 deletions MatroskaLib/MatroskaLib.Test/MatroskaLib.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,10 @@
<ItemGroup>
<AssemblyAttribute Include="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage" />
</ItemGroup>
<ItemGroup>
<Resource Include="mkvalidator.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
</ItemGroup>

</Project>
Binary file added MatroskaLib/MatroskaLib.Test/mkvalidator.exe
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0-Windows</TargetFramework>
<RootNamespace>MkvDefaultTrackChanger.WinForms</RootNamespace>
</PropertyGroup>
Expand Down

0 comments on commit 220a76b

Please sign in to comment.