Пример #1
0
        internal void ProcessInput()
        {
            string line;

            while ((line = process.StandardOutput.ReadLine()) != null)
            {
                logger.WriteLine(LogKind.Default, line);

                if (string.IsNullOrEmpty(line))
                {
                    continue;
                }

                if (!line.StartsWith("//"))
                {
                    LinesWithResults.Add(line);
                }
                else if (line == Engine.Signals.BeforeAnythingElse)
                {
                    diagnoser?.BeforeAnythingElse(process, benchmark);
                }
                else if (line == Engine.Signals.AfterSetup)
                {
                    diagnoser?.AfterSetup(process, benchmark);
                }
                else if (line == Engine.Signals.BeforeCleanup)
                {
                    diagnoser?.BeforeCleanup();
                }
                else
                {
                    LinesWithExtraOutput.Add(line);
                }
            }
        }
Пример #2
0
        /// <summary>Sends notification signal to the host.</summary>
        /// <param name="hostSignal">The signal to send.</param>
        public void SendSignal(HostSignal hostSignal)
        {
            switch (hostSignal)
            {
            case HostSignal.BeforeAnythingElse:
                diagnoser?.BeforeAnythingElse(diagnoserActionParameters);
                WriteLine(Engine.Signals.BeforeAnythingElse);
                break;

            case HostSignal.AfterSetup:
                diagnoser?.AfterSetup(diagnoserActionParameters);
                WriteLine(Engine.Signals.AfterSetup);
                break;

            case HostSignal.BeforeMainRun:
                diagnoser?.BeforeMainRun(diagnoserActionParameters);
                WriteLine(Engine.Signals.BeforeMainRun);
                break;

            case HostSignal.BeforeCleanup:
                diagnoser?.BeforeCleanup();
                WriteLine(Engine.Signals.BeforeCleanup);
                break;

            case HostSignal.AfterAnythingElse:
                WriteLine(Engine.Signals.AfterAnythingElse);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(hostSignal), hostSignal, null);
            }
        }
Пример #3
0
 /// <summary>Sends AfterSetup notification.</summary>
 public void AfterSetup()
 {
     WriteLine(Engine.Signals.AfterSetup);
     _diagnoser?.AfterSetup(_currentProcess, _benchmark);
 }