This class is used as the result of executing the BisectCommand.
Пример #1
0
        /// <summary>
        /// Attempts to parse the empty result, typically returned from executing a <see cref="BisectCommand"/>
        /// with a <see cref="State"/> of <see cref="BisectState.Reset"/>.
        /// </summary>
        /// <param name="standardOutput">
        /// The standard output from executing the command.
        /// </param>
        /// <returns>
        /// <c>true</c> if this method was able to parse the results correctly;
        /// otherwise <c>false</c> to continue testing other ways to parse it.
        /// </returns>
        private bool ParseEmptyResult(string standardOutput)
        {
            if (StringEx.IsNullOrWhiteSpace(standardOutput))
            {
                Result = new BisectResult();
                return(true);
            }

            return(false);
        }
Пример #2
0
        /// <summary>
        /// Attempts to parse the results indicating that further testing is required and that the
        /// repository has now been updated to a new revision for testing and subsequent marking of
        /// good or bad.
        /// </summary>
        /// <param name="standardOutput">
        /// The standard output from executing the command.
        /// </param>
        /// <returns>
        /// <c>true</c> if this method was able to parse the results correctly;
        /// otherwise <c>false</c> to continue testing other ways to parse it.
        /// </returns>
        private bool ParseTestingResult(string standardOutput)
        {
            var   re = new Regex(@"^Testing changeset (?<revno>\d+):", RegexOptions.IgnoreCase);
            Match ma = re.Match(standardOutput);

            if (ma.Success)
            {
                int currentlyAtRevision = int.Parse(ma.Groups["revno"].Value, CultureInfo.InvariantCulture);
                Result = new BisectResult(RevSpec.Single(currentlyAtRevision), false);
            }

            return(ma.Success);
        }
Пример #3
0
        /// <summary>
        /// Attempts to parse the results that indicate that the first good changeset was found.
        /// </summary>
        /// <param name="standardOutput">
        /// The standard output from executing the command.
        /// </param>
        /// <returns>
        /// <c>true</c> if this method was able to parse the results correctly;
        /// otherwise <c>false</c> to continue testing other ways to parse it.
        /// </returns>
        private bool ParseFoundResult(string standardOutput)
        {
            var   re = new Regex(@"^The first good revision is:\s+changeset:\s+(?<revno>\d+):", RegexOptions.IgnoreCase);
            Match ma = re.Match(standardOutput);

            if (ma.Success)
            {
                int foundAtRevision = int.Parse(ma.Groups["revno"].Value, CultureInfo.InvariantCulture);
                Result = new BisectResult(RevSpec.Single(foundAtRevision), true);
            }

            return(ma.Success);
        }