当前位置: 首页>>代码示例>>C#>>正文


C# BuildRequestEntry.Continue方法代码示例

本文整理汇总了C#中Microsoft.Build.BackEnd.BuildRequestEntry.Continue方法的典型用法代码示例。如果您正苦于以下问题:C# BuildRequestEntry.Continue方法的具体用法?C# BuildRequestEntry.Continue怎么用?C# BuildRequestEntry.Continue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Build.BackEnd.BuildRequestEntry的用法示例。


在下文中一共展示了BuildRequestEntry.Continue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestSimpleStateProgression

        public void TestSimpleStateProgression()
        {
            // Start in Ready
            BuildRequest request = CreateNewBuildRequest(1, new string[1] { "foo" });
            BuildRequestConfiguration config = new BuildRequestConfiguration(1, new BuildRequestData("foo", new Dictionary<string, string>(), "foo", new string[0], null), "2.0");
            BuildRequestEntry entry = new BuildRequestEntry(request, config);
            Assert.Equal(entry.State, BuildRequestEntryState.Ready);
            Assert.Equal(entry.Request, request);
            Assert.Null(entry.Result);

            // Move to active.  Should not be any results yet.
            IDictionary<int, BuildResult> results = entry.Continue();
            Assert.Equal(entry.State, BuildRequestEntryState.Active);
            Assert.Null(entry.Result);
            Assert.Null(results);

            // Wait for results, move to waiting.
            BuildRequest waitingRequest = CreateNewBuildRequest(2, new string[1] { "bar" });
            entry.WaitForResult(waitingRequest);
            Assert.Equal(entry.State, BuildRequestEntryState.Waiting);
            Assert.Equal(entry.Request, request);
            Assert.Null(entry.Result);

            // Provide the results, move to ready.
            BuildResult requiredResult = new BuildResult(waitingRequest);
            requiredResult.AddResultsForTarget("bar", TestUtilities.GetEmptySucceedingTargetResult());
            entry.ReportResult(requiredResult);
            Assert.Equal(entry.State, BuildRequestEntryState.Ready);
            Assert.Equal(entry.Request, request);
            Assert.Null(entry.Result);

            // Continue the build, move to active.
            results = entry.Continue();
            Assert.Equal(entry.State, BuildRequestEntryState.Active);
            Assert.Null(entry.Result);
            Assert.Equal(results.Count, 1);
            Assert.True(results.ContainsKey(requiredResult.NodeRequestId));
            Assert.Equal(results[requiredResult.NodeRequestId], requiredResult);

            // Complete the build, move to completed.
            BuildResult result = new BuildResult(request);
            result.AddResultsForTarget("foo", TestUtilities.GetEmptySucceedingTargetResult());
            entry.Complete(result);
            Assert.Equal(entry.State, BuildRequestEntryState.Complete);
            Assert.NotNull(entry.Result);
            Assert.Equal(entry.Result, result);
        }
开发者ID:cameron314,项目名称:msbuild,代码行数:47,代码来源:BuildRequestEntry_Tests.cs

示例2: TestResultsWithNoMatch1

        public void TestResultsWithNoMatch1()
        {
            BuildRequest request = CreateNewBuildRequest(1, new string[1] { "foo" });
            BuildRequestConfiguration config = new BuildRequestConfiguration(1, new BuildRequestData("foo", new Dictionary<string, string>(), "foo", new string[0], null), "2.0");
            BuildRequestEntry entry = new BuildRequestEntry(request, config);
            Assert.AreEqual(entry.State, BuildRequestEntryState.Ready);

            entry.Continue();
            Assert.AreEqual(entry.State, BuildRequestEntryState.Active);

            BuildRequest waitingRequest1 = CreateNewBuildRequest(2, new string[1] { "bar" });
            entry.WaitForResult(waitingRequest1);
            Assert.AreEqual(entry.State, BuildRequestEntryState.Waiting);

            BuildRequest randomRequest = CreateNewBuildRequest(3, new string[0]);
            BuildResult requiredResult = new BuildResult(randomRequest);
            requiredResult.AddResultsForTarget("bar", TestUtilities.GetEmptySucceedingTargetResult());
            entry.ReportResult(requiredResult);
            Assert.AreEqual(entry.State, BuildRequestEntryState.Waiting);
        }
开发者ID:JamesLinus,项目名称:msbuild,代码行数:20,代码来源:BuildRequestEntry_Tests.cs

示例3: TestMixedWaitingRequests

        public void TestMixedWaitingRequests()
        {
            BuildRequest request = CreateNewBuildRequest(1, new string[1] { "foo" });
            BuildRequestConfiguration config = new BuildRequestConfiguration(1, new BuildRequestData("foo", new Dictionary<string, string>(), "foo", new string[0], null), "2.0");
            BuildRequestEntry entry = new BuildRequestEntry(request, config);
            Assert.AreEqual(entry.State, BuildRequestEntryState.Ready);

            entry.Continue();
            Assert.AreEqual(entry.State, BuildRequestEntryState.Active);

            BuildRequest waitingRequest1 = CreateNewBuildRequest(2, new string[1] { "bar" });
            entry.WaitForResult(waitingRequest1);
            Assert.AreEqual(entry.State, BuildRequestEntryState.Waiting);

            BuildRequest waitingRequest2 = CreateNewBuildRequest(-1, new string[1] { "xor" });
            entry.WaitForResult(waitingRequest2);
            Assert.AreEqual(entry.State, BuildRequestEntryState.Waiting);

            Assert.IsNull(entry.GetRequestsToIssueIfReady(), "Entry should not be ready to issue because there are unresolved configurations");

            entry.ResolveConfigurationRequest(-1, 3);
            Assert.AreEqual(entry.State, BuildRequestEntryState.Waiting);

            BuildResult requiredResult1 = new BuildResult(waitingRequest1);
            requiredResult1.AddResultsForTarget("bar", TestUtilities.GetEmptySucceedingTargetResult());
            entry.ReportResult(requiredResult1);
            Assert.AreEqual(entry.State, BuildRequestEntryState.Waiting);

            BuildResult requiredResult2 = new BuildResult(waitingRequest2);
            requiredResult2.AddResultsForTarget("xor", TestUtilities.GetEmptySucceedingTargetResult());
            entry.ReportResult(requiredResult2);
            Assert.AreEqual(entry.State, BuildRequestEntryState.Ready);
        }
开发者ID:JamesLinus,项目名称:msbuild,代码行数:33,代码来源:BuildRequestEntry_Tests.cs

示例4: BuildRequest

        /// <summary>
        /// Build a request entry
        /// </summary>
        /// <param name="entry"></param>
        public void BuildRequest(NodeLoggingContext nodeLoggingContext, BuildRequestEntry entry)
        {
            _requestedEntry = entry;
            if (null == _requestedEntry.RequestConfiguration.Project)
            {
                Project mockProject = new Project(XmlReader.Create(new System.IO.StringReader(
@"<Project ToolsVersion='4.0' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
            <Target Name='t'>
            </Target>
            </Project>")));
                _requestedEntry.RequestConfiguration.Project = mockProject.CreateProjectInstance();
            }

            _currentProjectDefinition = _testDataProvider[_requestedEntry.Request.ConfigurationId];
            _requestedEntry.Continue();
            _builderThread = new Thread(BuilderThreadProc);
            _builderThread.Name = "Builder Thread for Request: " + entry.Request.ConfigurationId.ToString();
            _builderThread.Start();
        }
开发者ID:cameron314,项目名称:msbuild,代码行数:23,代码来源:MockRequestBuilder.cs

示例5: TestNoCompleteToWaiting

        public void TestNoCompleteToWaiting()
        {
            Assert.Throws<InternalErrorException>(() =>
            {
                BuildRequest request = CreateNewBuildRequest(1, new string[1] { "foo" });
                BuildRequestConfiguration config = new BuildRequestConfiguration(1, new BuildRequestData("foo", new Dictionary<string, string>(), "foo", new string[0], null), "2.0");
                BuildRequestEntry entry = new BuildRequestEntry(request, config);
                Assert.Equal(entry.State, BuildRequestEntryState.Ready);

                entry.Continue();
                Assert.Equal(entry.State, BuildRequestEntryState.Active);

                BuildResult requiredResult = new BuildResult(request);
                requiredResult.AddResultsForTarget("foo", TestUtilities.GetEmptySucceedingTargetResult());
                entry.Complete(requiredResult);
                Assert.Equal(entry.State, BuildRequestEntryState.Complete);

                BuildRequest waitingRequest1 = CreateNewBuildRequest(2, new string[1] { "bar" });
                entry.WaitForResult(waitingRequest1);
            }
           );
        }
开发者ID:cameron314,项目名称:msbuild,代码行数:22,代码来源:BuildRequestEntry_Tests.cs

示例6: TestMultipleWaitingRequests

        public void TestMultipleWaitingRequests()
        {
            BuildRequest request = CreateNewBuildRequest(1, new string[1] { "foo" });
            BuildRequestData data1 = new BuildRequestData("foo", new Dictionary<string, string>(), "foo", new string[0], null);
            BuildRequestConfiguration config = new BuildRequestConfiguration(1, data1, "2.0");
            BuildRequestEntry entry = new BuildRequestEntry(request, config);

            entry.Continue();
            Assert.Equal(entry.State, BuildRequestEntryState.Active);

            BuildRequest waitingRequest1 = CreateNewBuildRequest(2, new string[1] { "bar" });
            entry.WaitForResult(waitingRequest1);
            Assert.Equal(entry.State, BuildRequestEntryState.Waiting);

            BuildRequest waitingRequest2 = CreateNewBuildRequest(2, new string[1] { "xor" });
            entry.WaitForResult(waitingRequest2);
            Assert.Equal(entry.State, BuildRequestEntryState.Waiting);

            BuildResult requiredResult1 = new BuildResult(waitingRequest1);
            requiredResult1.AddResultsForTarget("bar", TestUtilities.GetEmptySucceedingTargetResult());
            entry.ReportResult(requiredResult1);
            Assert.Equal(entry.State, BuildRequestEntryState.Waiting);

            BuildResult requiredResult2 = new BuildResult(waitingRequest2);
            requiredResult2.AddResultsForTarget("xor", TestUtilities.GetEmptySucceedingTargetResult());
            entry.ReportResult(requiredResult2);
            Assert.Equal(entry.State, BuildRequestEntryState.Ready);
        }
开发者ID:cameron314,项目名称:msbuild,代码行数:28,代码来源:BuildRequestEntry_Tests.cs

示例7: BuildRequest

        /// <summary>
        /// Starts a build request
        /// </summary>
        /// <param name="loggingContext">The logging context for the node.</param>
        /// <param name="entry">The entry to build.</param>
        public void BuildRequest(NodeLoggingContext loggingContext, BuildRequestEntry entry)
        {
            ErrorUtilities.VerifyThrowArgumentNull(loggingContext, "loggingContext");
            ErrorUtilities.VerifyThrowArgumentNull(entry, "entry");
            ErrorUtilities.VerifyThrow(null != _componentHost, "Host not set.");
            ErrorUtilities.VerifyThrow(_targetBuilder == null, "targetBuilder not null");
            ErrorUtilities.VerifyThrow(_nodeLoggingContext == null, "nodeLoggingContext not null");
            ErrorUtilities.VerifyThrow(_requestEntry == null, "requestEntry not null");
            ErrorUtilities.VerifyThrow(!_terminateEvent.WaitOne(0), "Cancel already called");

            _nodeLoggingContext = loggingContext;
            _blockType = BlockType.Unblocked;
            _requestEntry = entry;
            _requestEntry.Continue();
            _continueResults = null;

            _targetBuilder = (ITargetBuilder)_componentHost.GetComponent(BuildComponentType.TargetBuilder);

            VerifyEntryInActiveState();
            InitializeOperatingEnvironment();
            StartBuilderThread();
        }
开发者ID:cameron314,项目名称:msbuild,代码行数:27,代码来源:RequestBuilder.cs

示例8: BuildRequest

            public void BuildRequest(NodeLoggingContext context, BuildRequestEntry entry)
            {
                Assert.Null(_builderThread); // "Received BuildRequest while one was in progress"

                _continueEvent = new AutoResetEvent(false);
                _cancelEvent = new AutoResetEvent(false);
                _entry = entry;
                entry.Continue();

                _builderThread = new Thread(BuilderThreadProc);
                _builderThread.Start();
            }
开发者ID:cameron314,项目名称:msbuild,代码行数:12,代码来源:BuildRequestEngine_Tests.cs


注:本文中的Microsoft.Build.BackEnd.BuildRequestEntry.Continue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。