mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-16 17:22:21 +00:00
Initial commit of .NET port of FlatBuffers
Include C# codegen in flatc and .NET FlatBuffer access via the FlatBufferBuilder class Tested: on Windows. Change-Id: If5228a8df60a10e0751b245c6c64530264ea2d8a
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
3f85183c88
commit
9a1f7be6fd
46
tests/FlatBuffers.Test/Program.cs
Normal file
46
tests/FlatBuffers.Test/Program.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace FlatBuffers.Test
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
var tests = new FlatBuffersExampleTests();
|
||||
try
|
||||
{
|
||||
tests.RunTests();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("FlatBuffersExampleTests FAILED - {0}", ex.GetBaseException());
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Run ByteBuffers Tests
|
||||
var testClass = new ByteBufferTests();
|
||||
|
||||
var methods = testClass.GetType().GetMethods(BindingFlags.Public |
|
||||
BindingFlags.Instance)
|
||||
.Where(m => m.Name.StartsWith("ByteBuffer_"));
|
||||
foreach (var method in methods)
|
||||
{
|
||||
try
|
||||
{
|
||||
method.Invoke(testClass, new object[] { });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("ByteBufferTests FAILED when invoking {0} with error {1}",
|
||||
method.Name, ex.GetBaseException());
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user