Example #1
0
 public void Abort()
 {
     isAborted = true;
     if (run != null)
     {
         run.Abort();
     }
 }
        string GetBisectValue(int engineIndex, int modIndex)
        {
            var springRun = new SpringRun();

            testCaseBase.Engine = engineList[engineIndex];
            testCaseBase.Game   = modList[modIndex];
            var ret = testCaseBase.Validate(downloader, true);

            if (ret != null)
            {
                InvokeIfNeeded(() => { tbBisectLog.AppendText(string.Format("Skipping test {0} - {1}\n", testCaseBase, ret)); });
                Trace.TraceError("Skipping test {0} - {1}", testCaseBase, ret);
                return(null);
            }

            Trace.TraceInformation("Testing: {0}", testCaseBase);

            string retVal = null;

            springRun.LineAdded += s =>
            {
                if (s != null)
                {
                    var match = Regex.Match(s, string.Format("!transmitlobby {0}[ ]*:(.*)", variableName), RegexOptions.IgnoreCase);
                    if (match.Success)
                    {
                        retVal = match.Groups[1].Value;
                        springRun.Abort();
                    }
                }
            };
            springRun.Start(springPaths, testCaseBase, benchmark);

            InvokeIfNeeded(() => { tbBisectLog.AppendText(string.Format("Test:{0}   value:{1}\n", testCaseBase, retVal)); });
            return(retVal);
        }