Exemple #1
0
 /// <summary>
 /// Tries to create a new thread monitor.
 /// </summary>
 /// <param name="threadID">ThreadId</param>
 /// <param name="monitor">IThreadExecutionMonitor</param>
 /// <returns>Boolean</returns>
 bool IThreadMonitorFactory.TryCreateThreadMonitor(int threadID,
                                                   out IThreadExecutionMonitor monitor)
 {
     if (this.Monitors.Count == 0)
     {
         monitor = null;
         return(false);
     }
     else
     {
         monitor = new ThreadExecutionMonitorDispatcher(this.Host.Log,
                                                        threadID, this, this.TestingEngine, this.Configuration);
         return(true);
     }
 }
Exemple #2
0
        private void DiagnoseInstrumentedUninstrumented()
        {
            if (MyEngine.EnvironmentVars.Diagnose)
            {
                var uninstrumentedTypes = ThreadExecutionMonitorDispatcher.GetUninstrumentedTypes();

                var sortUninstrumented = new SafeOrderedSet <string>(StringComparer.CurrentCulture);
                foreach (var t in uninstrumentedTypes)
                {
                    if (t.Value == false)
                    {
                        sortUninstrumented.Add(t.Key.FullName);
                    }
                }

                var sortInstrumented = new SafeOrderedSet <string>(StringComparer.CurrentCulture);
                foreach (var t in uninstrumentedTypes)
                {
                    if (t.Value == true)
                    {
                        sortInstrumented.Add(t.Key.FullName);
                    }
                }
                var diagnose = @"/diagnose output. Uninstrumented types:
";
                foreach (var s in sortUninstrumented)
                {
                    diagnose += s + "\n";
                }
                diagnose += "\n/diagnose output. Instrumented types:";
                foreach (var s in sortInstrumented)
                {
                    diagnose += s + "\n";
                }
                MChessChess.ReportWarning(diagnose, "", false);
            }
        }