Skip to content

Standalone app to run all samples to catch run time exceptions. #3309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>netcoreapp2.1</TargetFramework>
<OutputType>Exe</OutputType>
<SignAssembly>false</SignAssembly>
<!--This ensures that we can never make the mistake of adding this as a friend assembly. Please don't remove.-->
<PublicSign>false</PublicSign>
<RootNamespace>Samples</RootNamespace>
</PropertyGroup>
Expand Down
23 changes: 19 additions & 4 deletions docs/samples/Microsoft.ML.Samples/Program.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
using Samples.Dynamic;
using System;
using System.Reflection;

namespace Microsoft.ML.Samples
{
internal static class Program
public static class Program
{
static void Main(string[] args)
public static void Main(string[] args) => RunAll();

internal static void RunAll()
{
CalculateFeatureContribution.Example();
int samples = 0;
foreach (var type in Assembly.GetExecutingAssembly().GetTypes())
{
var sample = type.GetMethod("Example", BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);

if(sample != null)
{
sample.Invoke(null, null);
samples++;
}
}

Console.WriteLine("Number of samples that ran without any exception: " + samples);
}
}
}