/// <summary> /// Verifies that the arguments constructed in the fragment (string) matches with the one in the resulting graph. /// </summary> /// <param name="graph">Resulting graph.</param> /// <param name="fragmentOrigin">Graph fragment where the arguments are constructed.</param> /// <param name="processInFragment">Process in fragments whose arguments are to be verified.</param> private void VerifyMatchingArguments(PipGraph graph, TestPipGraphFragment fragmentOrigin, Process processInFragment) { var outputPath = processInFragment.FileOutputs.First().ToFileArtifact().Path; var pipId = graph.TryGetProducer(FileArtifact.CreateOutputFile(RemapFragmentPath(fragmentOrigin, outputPath))); XAssert.IsTrue(pipId.IsValid); Process processInGraph = graph.PipTable.HydratePip(pipId, global::BuildXL.Pips.PipQueryContext.PipGraphGetProducingPip) as Process; XAssert.IsNotNull(processInGraph); string argumentsInFragment = processInFragment.Arguments.ToString(fragmentOrigin.Context.PathTable).ToUpperInvariant(); string argumentsInGraph = processInGraph.Arguments.ToString(Context.PathTable).ToUpperInvariant(); XAssert.AreEqual(argumentsInFragment, argumentsInGraph); }
protected static bool IsDependencyAndDependent(global::BuildXL.Pips.Operations.Process dependency, global::BuildXL.Pips.Operations.Process dependent) { // Unfortunately the test pip graph we are using doesn't keep track of dependencies/dependents. So we check there is a directory output of the dependency // that is a directory input for a dependent return(dependency.DirectoryOutputs.Any(directoryOutput => dependent.DirectoryDependencies.Any(directoryDependency => directoryDependency == directoryOutput))); }