/// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="configuration">Configuration</param>
        private TestingProcessScheduler(Configuration configuration)
        {
            this.TestingProcesses = new Dictionary<int, Process>();
            this.Profiler = new Profiler();
            this.SchedulerLock = new object();
            this.BugFound = false;

            configuration.Verbose = 1;
            configuration.PrintTrace = false;
            configuration.PerformFullExploration = false;
            configuration.EnableDataRaceDetection = false;

            this.Configuration = configuration;
        }
示例#2
0
        void InitOnEntry()
        {
            int numOfNodes = (this.ReceivedEvent as Config).NumberOfNodes;

            this.Nodes = new List<MachineId>();

            Profiler profiler = new Profiler();
            profiler.StartMeasuringExecutionTime();

            for (int idx = 0; idx < numOfNodes; idx++)
            {
                var node = this.CreateMachine(typeof(Node));
                this.Nodes.Add(node);
            }

            profiler.StopMeasuringExecutionTime();
            Console.WriteLine($"... Created {numOfNodes} machines in '" +
                profiler.Results() + "' seconds.");
        }
示例#3
0
文件: Test.cs 项目: yonglehou/PSharp
        static void Main(string[] args)
        {
            Profiler profiler = new Profiler();
            profiler.StartMeasuringExecutionTime();

            new TPLTest().Start(Test.NumOfNodes);

            profiler.StopMeasuringExecutionTime();
            Console.WriteLine("... TPL executed for '" +
                profiler.Results() + "' seconds.");

            profiler.StartMeasuringExecutionTime();

            var runtime = PSharpRuntime.Create();
            Test.Execute(runtime);
            runtime.Wait();

            profiler.StopMeasuringExecutionTime();
            Console.WriteLine("... P# executed for '" +
                profiler.Results() + "' seconds.");
        }
示例#4
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="configuration">Configuration</param>
 private RaceDetectionProcess(Configuration configuration)
 {
     this.Profiler = new Profiler();
     this.Configuration = configuration;
 }
示例#5
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="configuration">Configuration</param>
 /// <param name="action">Action</param>
 protected AbstractTestingEngine(Configuration configuration,
     Action<PSharpRuntime> action)
 {
     this.Profiler = new Profiler();
     this.Configuration = configuration;
     this.PerIterationCallbacks = new HashSet<Action<int>>();
     this.TestAction = action;
     this.Initialize();
 }
示例#6
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="configuration">Configuration</param>
 /// <param name="assembly">Assembly</param>
 protected AbstractTestingEngine(Configuration configuration, Assembly assembly)
 {
     this.Profiler = new Profiler();
     this.Configuration = configuration;
     this.PerIterationCallbacks = new HashSet<Action<int>>();
     this.Assembly = assembly;
     this.FindEntryPoint();
     this.TestInitMethod = FindTestMethod(typeof(TestInit));
     this.TestDisposeMethod = FindTestMethod(typeof(TestDispose));
     this.TestIterationDisposeMethod = FindTestMethod(typeof(TestIterationDispose));
     this.Initialize();
 }
示例#7
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="configuration">Configuration</param>
        protected AbstractTestingEngine(Configuration configuration)
        {
            this.Profiler = new Profiler();
            this.Configuration = configuration;

            this.PerIterationCallbacks = new HashSet<Action<int>>();

            try
            {
                this.Assembly = Assembly.LoadFrom(configuration.AssemblyToBeAnalyzed);
            }
            catch (FileNotFoundException ex)
            {
                IO.Error.ReportAndExit(ex.Message);
            }

            this.FindEntryPoint();
            this.TestInitMethod = FindTestMethod(typeof(TestInit));
            this.TestDisposeMethod = FindTestMethod(typeof(TestDispose));
            this.TestIterationDisposeMethod = FindTestMethod(typeof(TestIterationDispose));
            this.Initialize();
        }
示例#8
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="context">CompilationContext</param>
 private StaticAnalysisEngine(CompilationContext context)
 {
     this.Profiler = new Profiler();
     this.CompilationContext = context;
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="context">AnalysisContext</param>
 /// <param name="configuration">Configuration</param>
 protected StateMachineAnalysisPass(AnalysisContext context, Configuration configuration)
 {
     this.Profiler = new Profiler();
     this.AnalysisContext = context;
     this.Configuration = configuration;
 }