internal static void RunTests( IQmlTestRunner qmlTestRunner, string source, IEnumerable <TestCase> testCases, IFrameworkHandle frameworkHandle, IDiscoveryContext context) { try { foreach (TestCase testCase in testCases) { frameworkHandle.RecordStart(testCase); } Dictionary <string, TestCase> dict = testCases.ToDictionary(tc => tc.FullyQualifiedName); string functions = String.Join(" ", testCases.Select(tc => "\"" + tc.FullyQualifiedName + "\"")); string arguments = "-xml -input " + source + " " + functions; QmlTestRunnerResult result = qmlTestRunner.Execute(arguments, context); ParseQmlTestRunnerXmlOutput(frameworkHandle, dict, result.StandardOutput); } catch (Exception ex) { frameworkHandle.SendMessage(TestMessageLevel.Error, ex.StackTrace); } }
internal static IEnumerable <TestCase> GetTests( IQmlTestRunner qmlTestRunner, string filePath, IMessageLogger logger, IDiscoveryContext context) { try { QmlTestRunnerResult result = qmlTestRunner.Execute("-functions -input " + filePath, context); if (result.ExitCode != 0) { logger.SendMessage(TestMessageLevel.Error, result.StandardError); } return(ParseQmlTestRunnerFunctionsOutput(filePath, result.StandardError)); } catch (Exception ex) { logger.SendMessage(TestMessageLevel.Error, ex.StackTrace); } return(new List <TestCase>()); }