Example #1
0
        public TestProjectEntity(XElement el)
            : base(el)
        {
            var xmsbProj = DataElement.Element(XSessionMSBuildNames.Project);

            if (xmsbProj != null)
            {
                _msbuildProj = new MSBuildProject(xmsbProj);

                // Load the current configuration
                UpdateProjectConfiguration();
            }

            // WARNING: Can't do this here because we may trigger the xml tree changed event on itself.
            //// Make sure the loadTestAssembly container element is there
            //if (DataElement.Element(XSessionNames.LoadedTestAssembly) == null)
            //{
            //    if (xmsbProj == null)
            //        DataElement.Add(new XElement(XSessionNames.LoadedTestAssembly));
            //    else
            //        xmsbProj.AddBeforeSelf(new XElement(XSessionNames.LoadedTestAssembly));
            //}

            //LoadProjectFile();
        }
        /// <summary>
        /// Sets up the base <see cref="MChessOptions"/> instance for a fresh run of this test.
        /// This is the part that usually differentiate tests using MChess from each other.
        /// </summary>
        /// <returns></returns>
        public virtual void SetBaseMChessOptionsForTestExecution(AppTasks.RunMChessBasedTestTask runTestTask, MChessOptions opts)
        {
            // Look to see if the test defines an MChessOptions element
            var xopts = DataElement.Element(XChessNames.MChessOptions);

            if (xopts != null)
            {
                var testOpts = new MChessOptions(xopts);
                opts.MergeWith(testOpts);
            }
        }
        //public override void CheckForResults()
        //{
        //    XElement xchessResults = TaskState.TaskHandle.GetXmlResults();
        //    if (xchessResults != null)
        //        ProcessTaskResults(xchessResults);
        //}

        internal void ProcessTaskResults(XElement xtaskResults)
        {
            // TODO: Might need to add this element elsewhere once plugins are finished
            DataElement.Add(xtaskResults);

            // if this run was started by an engine, notify it now
            int?xengineid = (int?)DataElement.Element(XSessionNames.Engineid);

            if (xengineid.HasValue)
            {
                Engine engine = Model.engines[xengineid.Value];
                engine.NewResults(this, xtaskResults);
            }
        }
Example #4
0
        public TestArgs GetTestArgs()
        {
            XElement xargs = DataElement.Element(XNames.TestArgs);

            return(xargs == null ? null : new TestArgs(xargs));
        }