Example #1
0
        public void StartTarget()
        {
            var options = Options;

            if (options == null)
            {
                throw new InvalidOperationException("Options are not set");
            }

            connector.StatusCallback = actionCallback;

            // set mode
            connector.EnableOption(ProfilerMode.COUNT_COVERAGE);

            ExcludeItem("[mscorlib]*");
            ExcludeItem("[System*]*");

            if (options.TargetDirectory != null)
            {
                options.TargetDirectory = options.TargetDirectory.Trim();
            }
            if (options.TargetPath != null)
            {
                options.TargetPath = options.TargetPath.Trim();
            }
            if (options.TargetArguments != null)
            {
                options.TargetArguments = options.TargetArguments.Trim();
            }
            if (string.IsNullOrEmpty(options.TargetDirectory))
            {
                options.TargetDirectory = Directory.GetCurrentDirectory();
            }

            // start target
            //  ProcessCallback.writeStatus("Start target");
            connector.StartTarget(
                options.TargetPath,
                options.TargetDirectory,
                options.TargetArguments,
                options.RedirectOutput);

            // wait results
            //ProcessCallback.writeStatus("Wait results");
            connector.WaitForResults(options.DelayClose);

            // walk results
            //ProcessCallback.writeStatus("Walk results");
            receiver.Report = new Report();
            connector.GetReport(receiver);

            Report = receiver.Report;

            if (options.FlattenDomains)
            {
                Report = new ReportDomainFlattener(Report).Flatten();
            }
        }
Example #2
0
        public void StartTarget()
        {
            var options = Options;
            if (options == null)
                throw new InvalidOperationException("Options are not set");

            connector.StatusCallback = actionCallback;

            // set mode
            connector.EnableOption(ProfilerMode.COUNT_COVERAGE);

            ExcludeItem("[mscorlib]*");
            ExcludeItem("[System*]*");

            if (options.TargetDirectory != null)
            {
                options.TargetDirectory = options.TargetDirectory.Trim();
            }
            if (options.TargetPath != null)
            {
                options.TargetPath = options.TargetPath.Trim();
            }
            if (options.TargetArguments != null)
            {
                options.TargetArguments = options.TargetArguments.Trim();
            }
            if (string.IsNullOrEmpty(options.TargetDirectory))
            {
                options.TargetDirectory = Directory.GetCurrentDirectory();
            }

            // start target
            //  ProcessCallback.writeStatus("Start target");
            connector.StartTarget(
                options.TargetPath,
                options.TargetDirectory,
                options.TargetArguments,
                options.RedirectOutput);

            // wait results
            //ProcessCallback.writeStatus("Wait results");
            connector.WaitForResults(options.DelayClose);

            // walk results
            //ProcessCallback.writeStatus("Walk results");
            receiver.Report = new Report();
            connector.GetReport(receiver);

            Report = receiver.Report;

            if (options.FlattenDomains)
            {
                Report = new ReportDomainFlattener(Report).Flatten();
            }
        }