コード例 #1
0
ファイル: TestRecords.cs プロジェクト: dotnet/wpf-test
        /// <summary>
        /// Discover a collection of test cases.
        /// </summary>
        /// <param name="discoveryInfoPath">Path to Discovery Info. If path is relative, it will interpreted as relative to the current directory.</param>
        /// <param name="filteringSettings">Filtering settings.</param>
        /// <returns></returns>
        public static TestRecords Discover(FileInfo discoveryInfoPath, FilteringSettings filteringSettings)
        {
            Profiler.StartMethod();

            IEnumerable <TestInfo> testInfos = DiscoveryEngine.Discover(discoveryInfoPath, filteringSettings);
            TestRecords            tests     = new TestRecords();

            foreach (TestInfo testInfo in testInfos)
            {
                TestRecord testRecord = new TestRecord();
                testRecord.TestInfo = testInfo;
                tests.TestCollection.Add(testRecord);
            }
            Profiler.EndMethod();
            return(tests);
        }
コード例 #2
0
ファイル: TestRecords.cs プロジェクト: dotnet/wpf-test
        public static TestRecords Load(DirectoryInfo serializationDirectory)
        {
            FileInfo resultsFileInfo = new FileInfo(Path.Combine(serializationDirectory.FullName, serializationFileName));

            Profiler.StartMethod();
            TestRecords records = null;

            try
            {
                using (XmlTextReader textReader = new XmlTextReader(resultsFileInfo.OpenRead()))
                {
                    records = (TestRecords)ObjectSerializer.Deserialize(textReader, typeof(TestRecords), null);
                }
            }
            catch (Exception e)
            {
                throw new IOException("Failed to Deserialize: " + resultsFileInfo.FullName, e);
            }
            Profiler.EndMethod();
            return(records);
        }
コード例 #3
0
ファイル: TestRecords.cs プロジェクト: dotnet/wpf-test
 /// <summary>
 /// Produce a comprehensive static xml report from the test results
 /// </summary>
 public void GenerateXmlReport(TestRecords tests, RunInfo runInfo, DirectoryInfo reportRoot, DirectoryInfo testBinariesDirectory)
 {
     Profiler.StartMethod();
     ReportingEngine.GenerateXmlReport(tests, runInfo, reportRoot, testBinariesDirectory);
     Profiler.EndMethod();
 }