private void BatchTestThread() { ResultFile resFile = new ResultFile(); resFile.AddFeature("Minimal Conformance", true); resFile.AddFeature("Schema Import", true); resFile.AddFeature("Schema Validation", false); resFile.AddFeature("Full Axis", true); resFile.AddFeature("Serialization", false); resFile.AddFeature("Trivial XML Embedding", false); resFile.Worktime = new Stopwatch(); resFile.Worktime.Start(); foreach (DataRow dr in _testTab.Select("")) { if ((bool)dr[0]) { XmlElement curr = (XmlElement)dr[5]; string id = curr.GetAttribute("name"); TextWriter tw = new StringWriter(); if (PerformTest(tw, curr)) { tw.WriteLine("Passed."); resFile.AddResult(id, "pass"); Interlocked.Increment(ref _passed); } else { tw.WriteLine("Failed."); resFile.AddResult(id, "fail"); _out.Write(tw.ToString()); } //Trace.WriteLine(tw.ToString()); Interlocked.Increment(ref _total); } } resFile.Worktime.Stop(); if (_total > 0) { decimal total = _total; decimal passed = _passed; _out.WriteLine("{0} executed, {1} ({2}%) successed.", total, passed, Math.Round(passed / total * 100, 2)); } Invoke(new CompleteDelegate(CompleteBatchTest), resFile); }
private void CompleteBatchTest(ResultFile resFile) { foreach (DataRow row in _testTab.Rows) row[0] = false; string fileName = _basePath + "\\ReportingResults\\XQTS_QM_Result.xml"; resFile.Create(fileName); statusStrip1.Items.Remove(_statusLabel); statusStrip1.Items.Remove(_progressBar); toolStripStatusLabel1.Text = "Done"; _progressBar = null; _statusLabel = null; }