You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible for AltCover to programatically start and save code coverage?
Similar to how dotCover does it (but allowing for multiple isolated code coverage sessions):
using JetBrains.Profiler.Api;
MeasureProfiler.StartCollectingData();
PerformBusinessLogicAction()
MeasureProfiler.SaveData();
A ChatGPT-dreamt example, where two independent coverage.xml file snapshots would be saved to disk:
using System;
using AltCover.Recorder2;
class Program
{
static void Main(string[] args)
{
// Create two independent recorders
var recorder1 = new Recorder();
var recorder2 = new Recorder();
// Start first coverage session
recorder1.Start();
Console.WriteLine("Running code for recorder1...");
DoSomething();
recorder1.Save("coverage1.xml");
// Start second coverage session
recorder2.Start();
Console.WriteLine("Running code for recorder2...");
DoSomethingElse();
recorder2.Save("coverage2.xml");
Console.WriteLine("Coverage sessions completed.");
}
}
If not, I will use the Pause/Resume Control File thing instead.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible for AltCover to programatically start and save code coverage?
Similar to how dotCover does it (but allowing for multiple isolated code coverage sessions):
A ChatGPT-dreamt example, where two independent coverage.xml file snapshots would be saved to disk:
If not, I will use the Pause/Resume Control File thing instead.
Beta Was this translation helpful? Give feedback.
All reactions