Example #1
0
        /// [parser_func_info]
        private void CreateTestFuncInfo(Project project, ParseInfo parseInfo, bool currentSuiteDisabled)
        {
            //Create test group path(s) if not existent
            bool isRoot            = true;
            var  currentParseNode  = parseInfo.GroupNode;
            var  currentTargetNode = project.TestGroups;

            while (true)
            {
                //Root may have different namings
                if (isRoot || parseInfo.GroupNode.Value == project.TestGroups.Value.Name)
                {
                    isRoot = false;
                    if (currentParseNode.HasChild())
                    {
                        var targetNode = currentTargetNode.Childs.FirstOrDefault(x => x.Value.Name == currentParseNode.Child.Value);
                        if (targetNode != null)
                        {
                            //target node exists - use as new seek point
                            currentTargetNode = targetNode;
                        }
                        else
                        {
                            //target not doesn't exist - create new
                            var newGroupEntry = new TestGroupEntry(project.AppType == AppType.BOOST, currentParseNode.Child.Value);
                            currentTargetNode      = currentTargetNode.AddChildNode(new NodeList <TestGroupEntry>(newGroupEntry));
                            newGroupEntry.NodeList = currentTargetNode;
                        }
                        currentParseNode = currentParseNode.Child;
                    }
                    else
                    {
                        //This is the end...
                        break;
                    }
                }
            }

            // Store the found test function description
            TestFuncEntry tf = new TestFuncEntry(project.AppType == AppType.BOOST, currentTargetNode.Value, parseInfo.BoostMacroDisabled || currentSuiteDisabled);

            tf.TestFunction   = parseInfo.description;
            tf.FileFullPath   = parseInfo.FileFullPath;
            tf.IsDataTestCase = parseInfo.IsDataTestCase;
            tf.LineNum        = parseInfo.GetLineNum();
            currentTargetNode.Value.testFuncs.Add(tf);

            WriteLine(3, "CreateTestFuncInfo: " + tf.TestFunction + " within group: " + tf.TestGroup.NodeList.GetPath()
                      + " file: " + tf.FileFullPath + " line: " + tf.LineNum);
        }
Example #2
0
 public TestFunctionTreeViewItem(TreeViewItemBase parent, TestFuncEntry testFuncEntry)
     : base(parent)
 {
     TestFuncEntry = testFuncEntry;
 }