/* If a container marked as focus has a descendant that is also marked as focus, Ginkgo's policy is to unmark the container's focus. This gives developers a more intuitive experience when debugging specs. It is common to focus a container to just run a subset of specs, then identify the specific specs within the container to focus - this policy allows the developer to simply focus those specific specs and not need to go back and turn the focus off of the container: As a common example, consider: FDescribe("something to debug", function() { It("works", function() {...}) It("works", function() {...}) FIt("doesn't work", function() {...}) It("works", function() {...}) }) here the developer's intent is to focus in on the `"doesn't work"` spec and not to run the adjacent specs in the focused `"something to debug"` container. The nested policy applied by this function enables this behavior. */ func ApplyNestedFocusPolicyToTree(tree *TreeNode) { … } /* Ginkgo supports focussing specs using `FIt`, `FDescribe`, etc. - this is called "programmatic focus" It also supports focussing specs using regular expressions on the command line (`-focus=`, `-skip=`) that match against spec text and file filters (`-focus-files=`, `-skip-files=`) that match against code locations for nodes in specs. When both programmatic and file filters are provided their results are ANDed together. If multiple kinds of filters are provided, the file filters run first followed by the regex filters. This function sets the `Skip` property on specs by applying Ginkgo's focus policy: - If there are no CLI arguments and no programmatic focus, do nothing. - If a spec somewhere has programmatic focus skip any specs that have no programmatic focus. - If there are CLI arguments parse them and skip any specs that either don't match the focus filters or do match the skip filters. *Note:* specs with pending nodes are Skipped when created by NewSpec. */ func ApplyFocusToSpecs(specs Specs, description string, suiteLabels Labels, suiteConfig types.SuiteConfig) (Specs, bool) { … }