Beispiel #1
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     if (txbName.Text.Length > 0)
     {
         RecordingTypes recType;
         if (rdbFilter.Checked) recType = RecordingTypes.Filter;
         else if (rdbRecording.Checked) recType = RecordingTypes.Active;
         else recType = RecordingTypes.Inactive;
         newRecording_ = new Recording(txbName.Text, recType);
         this.Close();
     }
 }
Beispiel #2
0
        /// <summary>
        /// start new code coverage session with given ThreadStart
        /// </summary>
        /// <param name="ts"></param>
        private void startCodeCoverage(ThreadStart ts)
        {
            if (dbgthread_ != null)
            {
                dbgthread_.Abort();
                dbgthread_.Join();
            }
            // search for active recording (GUI has to ensure there is only one, otherwise the first is taken)
            activeRecording_ = null;
            foreach (Recording rec in recordings_)
                if (rec.RecordingType == RecordingTypes.Active)
                {
                    activeRecording_ = rec;
                    break;
                }
            // make sure we start from a clean recording
            activeRecording_.reset();

            // we need to know which module belongs to which path so we can look it up while debugging
            moduleNamesMap_.Clear();
            foreach (PEModule module in modules_) moduleNamesMap_.Add(module.Path, module);

            dbgthread_ = new Thread(ts);
            dbgthread_.Start();
        }
Beispiel #3
0
 public CoverageFinishedEventArgs(Recording recording)
 {
     recording_ = recording;
 }
Beispiel #4
0
 /// <summary>
 /// udpate coverage listview with data from recording
 /// </summary>
 /// <param name="recording"></param>
 private void updateListView(Recording recording)
 {
     lsvCoverage.Items.Clear();
     foreach (PEModule module in recording.Modules)
     {
         ListViewItem item = new ListViewItem(module.Path);
         item.SubItems.Add(module.Hits.Count.ToString());
         int percent = (int)((float)module.Hits.Count / (float)module.FunctionCount * 100.0f);
         item.SubItems.Add(percent.ToString() + "%");
         lsvCoverage.Items.Add(item);
     }
 }