Merged in system-tests (pull request #349)

RTM: System tests

Approved-by: Michael Harding <michael.harding@bluetradesys.com>
Approved-by: Pedro Pinto <pedro.pinto+atlassian@bluetradesys.com>
This commit is contained in:
Eric Harding authored and Pedro Pinto committed 2019-10-07 13:20:35 +00:00
commit 27aa4fca26
5 files changed
+23 -12

No files matched your search

@@ -10,9 +10,9 @@ using System.Diagnostics;
namespace bts.test {
public static class InProcessTestRunner {
public static void run_test_synchronously(string v, TestEnumerator enumerator, Action<TestResult> report) {
foreach (var t in enumerator.find(v)) {
run_test_synchronously(t, report);
public static void run_test_synchronously(string v, TestType type, TestEnumerator enumerator, Action<TestResult> report) {
foreach (var t in enumerator.find(v,type)) {
run_test_synchronously(t, report);
}
}
public static void run_test_synchronously(TestMethod test, Action<TestResult> report) {
@@ -36,18 +36,19 @@ namespace bts.test {
}
public IEnumerable<TestMethod> find(string name) {
public IEnumerable<TestMethod> find(string name, TestType type) {
foreach (var g in TestGroups) {
foreach (var t in g.methods) {
if (g.name == name || t.name == name || t.full_name == name) {
if (g.test_type == type &&
(g.name == name || t.name == name || t.full_name == name)) {
yield return t;
}
}
}
}
public IEnumerable<TestMethod> match(IEnumerable<string> names) {
return names.SelectMany(find).Distinct();
public IEnumerable<TestMethod> match(TestType type, IEnumerable<string> names) {
return names.SelectMany(name => find(name,type)).Distinct();
}
}
+9 -3
View File
@@ -48,7 +48,7 @@ namespace sparkcmd {
}
else Configuration.initialize();
Console.WriteLine(JsonConvert.SerializeObject(o));
ConsoleEx.WriteLine(JsonConvert.SerializeObject(o), ConsoleColor.DarkGray);
if (o.list) {
list_tests((o.type));
@@ -58,13 +58,19 @@ namespace sparkcmd {
if (o.timeout == 0 && o.tests.Count() == 1 && !o.self_contained) {
//System.Threading.Thread.Sleep(5000);
using (var trr = new TestResultReceiver(true)) {
InProcessTestRunner.run_test_synchronously(o.tests.First(), Enumerator, trr.get_reporter());
InProcessTestRunner.run_test_synchronously(o.tests.First(), o.type, Enumerator, trr.get_reporter());
trr.print_summary();
if (trr.ResultCount == 0) {
ConsoleEx.Write("No ", ConsoleColor.Red);
ConsoleEx.Write(o.type.ToString(), ConsoleColor.Yellow);
ConsoleEx.WriteLine($" tests matched filter '{o.tests.First()}'", ConsoleColor.Red);
return -1;
}
return trr.ErrorCount;
}
}
else if (o.tests.Count() > 0) {
return run_tests(o, Enumerator.match(o.tests));
return run_tests(o, Enumerator.match(o.type, o.tests));
}
else {
return run_tests(o, Enumerator.get_of_type(o.type));
+5 -1
View File
@@ -29,8 +29,12 @@ namespace sparkcmd {
// initialized from c++ instead of c#
BTSNativeMethods.provide_command_line(args, args.Length);
var parser = new Parser(ps => {
ps.CaseInsensitiveEnumValues = true;
});
// note: this can be made to infer the options type list from the list of delegates
return Parser.Default
return parser
.ParseArguments<
ConfigcheckOptions,
ScriptClientOptions,
+1 -1
View File
@@ -22,7 +22,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.4.3" />
<PackageReference Include="CommandLineParser" Version="2.6.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
</ItemGroup>