public bool ShouldInclude()

in BoostTestAdapter/Settings/TestSourceFilter.cs [53:79]


        public bool ShouldInclude(string source)
        {
            if (source == null)
            {
                return false;
            }

            // NOTE Due to ordering of statements, exclusions have precedence over inclusions
            //      which implies that if a test source matches both an include and an exclude
            //      pattern, the exclude pattern is preferred, thus the test would be rejected.

            // If a test source file-path matches one of the defined exclude patterns, reject test source
            if (!IsNullOrEmpty(this.Exclude) && IsMatch(this.Exclude, source))
            {
                return false;
            }

            // If a test source file-path matches one of the defined include patterns, accept test source
            if (!IsNullOrEmpty(this.Include) && IsMatch(this.Include, source))
            {
                return true;
            }

            // If no exclude/include patterns are defined, accept any and all tests
            // Else accept tests if-and-only-if an exclude list is present without an include list (i.e. 'accept all tests except...' semantics)
            return this.IsEmpty || (!IsNullOrEmpty(this.Exclude) && IsNullOrEmpty(this.Include));
        }