예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="XunitPerformanceHarness"/> class.
        /// </summary>
        /// <param name="args">String array that contains any command-line arguments passed in.</param>
        public XunitPerformanceHarness(string[] args)
        {
            _args = new string[args.Length];
            args.CopyTo(_args, 0);

            _disposed = false;

            var options = XunitPerformanceHarnessOptions.Parse(_args);

            OutputDirectory             = options.OutputDirectory;
            _collectDefaultXUnitMetrics = options.MetricNames.Contains("default", StringComparer.OrdinalIgnoreCase);
            _metricCollectionFactory    = GetPerformanceMetricFactory(options.MetricNames);
            _requireEtw = RequireEtw(options.MetricNames);
            _typeNames  = new List <string>(options.TypeNames);

            Configuration.RunId       = options.RunId;
            Configuration.FileLogPath = $"{Configuration.RunId}.csv"; // TODO: Conditionally set this based on whether we want a csv file written.
        }
예제 #2
0
        public XunitPerformanceHarness(string[] args)
        {
            _args        = args;
            _disposed    = false;
            _outputFiles = new List <string>();

            var options = XunitPerformanceHarnessOptions.Parse(args);

            // Set the run id.
            _outputDirectory = options.OutputDirectory;
            _typeNames       = new List <string>(options.TypeNames);
            _runner          = (assemblyPath) =>
            {
                XunitRunner.Run(assemblyPath, _typeNames);
            };

            Configuration.RunId = options.RunId;
            // Set the file log path.
            // TODO: Conditionally set this based on whether we want a csv file written.
            Configuration.FileLogPath = Configuration.RunId + ".csv";
        }