public void PipIdWithPrefixFilter() { RootFilter expected = new RootFilter( new PipIdFilter(-8826251658372796143)); RunPositiveFilterParserTest("id=\'Pip8582DAE1547CB111'", expected); }
public void CompoundFilterPrecedence() { // And has greater precedence than or. RootFilter expected = new RootFilter( new BinaryFilter( new BinaryFilter( new TagFilter(StringId.Create(StringTable, "Test")), FilterOperator.And, new TagFilter(StringId.Create(StringTable, "csc.exe"))), FilterOperator.Or, new TagFilter(StringId.Create(StringTable, "Test2")))); RunPositiveFilterParserTest("tag=\'Test\'andtag=\'csc.exe\'ortag=\'Test2\'", expected); RootFilter expected2 = new RootFilter( new BinaryFilter( new TagFilter(StringId.Create(StringTable, "Test2")), FilterOperator.Or, new BinaryFilter( new TagFilter(StringId.Create(StringTable, "Test")), FilterOperator.And, new TagFilter(StringId.Create(StringTable, "csc.exe"))))); RunPositiveFilterParserTest("tag=\'Test2\'ortag=\'csc.exe\'andtag=\'Test\'", expected2); }
public void NestedDependencyBinaryFilter() { RootFilter expected = new RootFilter( new BinaryFilter( new DependenciesFilter( new BinaryFilter( new TagFilter(StringId.Create(StringTable, "Test1")), FilterOperator.And, new TagFilter(StringId.Create(StringTable, "Test2")))), FilterOperator.And, new TagFilter(StringId.Create(StringTable, "Test3")))); RunPositiveFilterParserTest(" ( dpc( tag = \'Test1\' and tag = \'Test2\' ) and tag = \'Test3\' )", expected); expected = new RootFilter( new BinaryFilter( new TagFilter(StringId.Create(StringTable, "Test1")), FilterOperator.And, new DependenciesFilter( new BinaryFilter( new TagFilter(StringId.Create(StringTable, "Test2")), FilterOperator.And, new TagFilter(StringId.Create(StringTable, "Test3")))))); RunPositiveFilterParserTest(" ( tag = \'Test1\' and dpc( tag = \'Test2\' and tag = \'Test3\' ) )", expected); }
public void SingleFilterCopyDependents() { RootFilter expected = new RootFilter( new CopyDependentsFilter(new TagFilter(StringId.Create(StringTable, "Test")))); RunPositiveFilterParserTest("copydpt(tag=\'Test\')", expected); }
public void TagFilter() { RootFilter expected = new RootFilter( new TagFilter(StringId.Create(StringTable, "Test"))); RunPositiveFilterParserTest("tag=\'Test\'", expected); }
/// <summary> /// Creates the scheduler state /// </summary> public SchedulerState(Scheduler scheduler) { // If the filter is not applied, rootFilter and filterPassingNodes are null. m_rootFilter = scheduler.RootFilter; m_filterPassingNodes = scheduler.FilterPassingNodes; m_incrementalSchedulingState = scheduler.IncrementalSchedulingState; }
public void SingleFilterRequiredInputs() { RootFilter expected = new RootFilter( new DependenciesFilter(new TagFilter(StringId.Create(StringTable, "Test")), ClosureMode.DirectExcludingSelf)); RunPositiveFilterParserTest("requiredfor(tag=\'Test\')", expected); }
public void SingleFilterDoubleNegated() { RootFilter expected = new RootFilter( new TagFilter(StringId.Create(StringTable, "Test"))); RunPositiveFilterParserTest("~(~(tag=\'Test\'))", expected); }
public void DefaultFallback() { RootFilter filter = ParseFilter(values: null, commandLineFilter: null, defaultFilter: NegatedTagFilter, out _, out _); XAssert.IsFalse(filter.IsEmpty); XAssert.IsTrue(filter.PipFilter is NegatingFilter); }
public void CommandLineFilterIsHighest() { RootFilter filter = ParseFilter(values: null, commandLineFilter: TagFilter, defaultFilter: NegatedTagFilter, out _, out _); XAssert.IsFalse(filter.IsEmpty); XAssert.IsFalse(filter.PipFilter is NegatingFilter); }
public void ValueFilter() { FullSymbol identifier = FullSymbol.Create(m_context.SymbolTable, "BuildXL.Transformers.dll"); RootFilter expected = new RootFilter(new ValueFilter(identifier)); RunPositiveFilterParserTest("value=\'BuildXL.Transformers.dll'", expected); }
public void OutputFilterFileName() { RootFilter expected = new RootFilter( new OutputFileFilter(AbsolutePath.Invalid, $"{Path.DirectorySeparatorChar}myoutput.dll", MatchMode.PathPrefixWildcard, pathFromMount: false)); RunPositiveFilterParserTest($"output='*{Path.DirectorySeparatorChar}myoutput.dll'", expected); }
public void SingleFilterDependencies() { RootFilter expected = new RootFilter( new DependenciesFilter(new TagFilter(StringId.Create(StringTable, "Test")))); RunPositiveFilterParserTest("dpc(tag=\'Test\')", expected); }
public void SpecFilterFromMountTrailingWildcard() { RootFilter expected = new RootFilter( CreateSpecFilter(AbsolutePath.Create(m_context.PathTable, DummyMountPath + $"{Path.DirectorySeparatorChar}hello"), null, MatchMode.WithinDirectoryAndSubdirectories, pathFromMount: true)); RunPositiveFilterParserTest($"spec='Mount[DummyMount]{Path.DirectorySeparatorChar}hello{Path.DirectorySeparatorChar}*'", expected); }
public void SourceFilter() { RootFilter expected = new RootFilter( new OutputFileFilter(AbsolutePath.Invalid, $"{Path.DirectorySeparatorChar}Program.cs", MatchMode.PathPrefixWildcard, pathFromMount: false)); RunPositiveFilterParserTest($"input='*{Path.DirectorySeparatorChar}Program.cs'", expected); }
public void SpecFilterFromMount() { RootFilter expected = new RootFilter( CreateSpecFilter(AbsolutePath.Create(m_context.PathTable, DummyMountPath), null, MatchMode.WithinDirectoryAndSubdirectories, pathFromMount: true)); RunPositiveFilterParserTest("spec='Mount[DummyMount]'", expected); }
private RootFilter RunPositiveFilterParserTest(string inputString, RootFilter expected) { RootFilter result = Deserialize(inputString); XAssert.AreEqual(expected.GetHashCode(), result.GetHashCode()); return(result); }
public void SpecFilterModuleDottedName() { RootFilter expected = new RootFilter( CreateModuleFilter(StringId.Create(m_context.StringTable, @"My.Test.Module"))); RunPositiveFilterParserTest("module=\'My.Test.Module\'", expected); }
public void SpecFilterAbsolute() { var path = X("/c/users/John Doe/src/foo.ds"); RootFilter expected = new RootFilter( CreateSpecFilter(AbsolutePath.Create(m_context.PathTable, path))); RunPositiveFilterParserTest($"spec=\'{path}'", expected); }
public void OutputFilterRecursivePath() { var path = X("/c/users/John Doe/src"); RootFilter expected = new RootFilter( new OutputFileFilter(AbsolutePath.Create(m_context.PathTable, path), null, MatchMode.WithinDirectoryAndSubdirectories, pathFromMount: false)); RunPositiveFilterParserTest($"output=\'{path}{Path.DirectorySeparatorChar}*'", expected); }
public void SpecFilterFilenamePrefixAndSuffixWildcardWithoutAnyNonWildcardCharacters() { RootFilter expected = new RootFilter( CreateSpecFilter(AbsolutePath.Invalid, Path.DirectorySeparatorChar.ToString(), MatchMode.PathPrefixAndSuffixWildcard)); RootFilter actual = RunPositiveFilterParserTest("spec='**'", expected); XAssert.AreEqual(0, actual.GetEvaluationFilter(SymbolTable, PathTable).ValueDefinitionRootsToResolve.Count); }
public void SpecFilterFilenamePrefixAndSuffixWildcard() { RootFilter expected = new RootFilter( CreateSpecFilter(AbsolutePath.Invalid, $"src{Path.DirectorySeparatorChar}BuildXL.", MatchMode.PathPrefixAndSuffixWildcard)); RootFilter actual = RunPositiveFilterParserTest($"spec='*src{Path.DirectorySeparatorChar}BuildXL.*'", expected); XAssert.AreEqual(0, actual.GetEvaluationFilter(SymbolTable, PathTable).ValueDefinitionRootsToResolve.Count); }
public void DependentsSelected() { RootFilter expected = new RootFilter( new DependentsFilter( new TagFilter(StringId.Create(StringTable, "Test")))); RunPositiveFilterParserTest("+tag=\'Test\'", expected); }
public void ImplicitPathTrumpsDefault() { RootFilter filter = ParseFilter(values: new string[] { "myPath" }, commandLineFilter: null, defaultFilter: NegatedTagFilter, out _, out _); XAssert.IsTrue(filter.PipFilter is BinaryFilter); XAssert.IsTrue(((BinaryFilter)filter.PipFilter).Left is OutputFileFilter); XAssert.IsTrue(((BinaryFilter)filter.PipFilter).Right is SpecFileFilter); }
public void SpecFilterDependenciesAbsolute() { var path = X("/c/users/John Doe/src/foo.ds"); RootFilter expected = new RootFilter( CreateSpecFilter(AbsolutePath.Create(m_context.PathTable, path), specDependencies: true)); RunPositiveFilterParserTest($"specref=\'{path}\'", expected); }
public void SpecFilterCurrentDirectory() { var path = X("/c/users/John Doe/src"); RootFilter expected = new RootFilter( CreateSpecFilter(AbsolutePath.Create(m_context.PathTable, path), null, MatchMode.WithinDirectory)); RunPositiveFilterParserTest($"spec=\'{path}{Path.DirectorySeparatorChar}.'", expected); }
private IFilterManager GetFilter2(string str) { FilterParser parser = new FilterParser(); IVideoFilter video_filter = parser.Parse(str); IFilterManager filter = new RootFilter(is_output_filtered_video, video_filter); return(filter); }
public void SpecFilterFilenameSuffixWildcard() { var path = X("/c/src/BuildXL."); RootFilter expected = new RootFilter( CreateSpecFilter(AbsolutePath.Invalid, path, MatchMode.PathSuffixWildcard)); RootFilter actual = RunPositiveFilterParserTest($"spec='{path}*'", expected); XAssert.AreEqual(0, actual.GetEvaluationFilter(SymbolTable, PathTable).ValueDefinitionRootsToResolve.Count); }
public void SpecFilterFilenamePrefixWildcard() { RootFilter expected = new RootFilter( CreateSpecFilter(AbsolutePath.Invalid, ".ds", MatchMode.PathPrefixWildcard)); RootFilter actual = RunPositiveFilterParserTest("spec=\'*.ds'", expected); XAssert.AreEqual(0, actual.GetEvaluationFilter(SymbolTable, PathTable).ValueDefinitionRootsToResolve.Count); }
public void OutputFilterFromMount() { RootFilter expected = new RootFilter( new OutputFileFilter(AbsolutePath.Create(m_context.PathTable, DummyMountPath), null, MatchMode.WithinDirectoryAndSubdirectories, pathFromMount: true)); RunPositiveFilterParserTest("output='Mount[DummyMount]'", expected); RunNegativeFilterParserTest("output='MOUNT[DUMMYMOUNT'", 24, "end of a named mount"); RunNegativeFilterParserTest("output='mount[badMountName]'", 14, "Could not find mount"); RunNegativeFilterParserTest("output='mount[)(@!&%]'", 14, "Could not find mount"); }
public static RootFilter FromXmlDocument(XmlDocument xmlDocument) { Hashtable item; RootFilter result; try { item = (Hashtable)SNDK.Convert.FromXmlDocument (SNDK.Convert.XmlNodeToXmlDocument (xmlDocument.SelectSingleNode ("(//scms.rootfilter)[1]"))); } catch { item = (Hashtable)SNDK.Convert.FromXmlDocument (xmlDocument); } try { result = new RootFilter (SNDK.Convert.StringToEnum<Enums.RootFilterType> ((string)item["type"])); } catch (Exception exception) { // LOG: LogDebug.ExceptionUnknown SorentoLib.Services.Logging.LogDebug (string.Format (SorentoLib.Strings.LogDebug.ExceptionUnknown, "SCMS.ROOTFILTER", exception.Message)); // EXCEPTION: Exception.RootFilterFromXMLDocument throw new Exception (Strings.Exception.RootFilterFromXMLDocument); } if (item.ContainsKey ("data")) { result._data = (string)item["data"]; } return result; }