Ejemplo n.º 1
0
        public void EngineStateIsUpdated()
        {
            SetupHelloWorld();
            SetUpConfig();
            EngineState lastEngineState = RunEngine("Engine State is Updated");

            XAssert.IsTrue(EngineState.IsUsable(lastEngineState));

            var previousEngineState = lastEngineState;

            FreshSetUp();
            lastEngineState = RunEngine("Engine State is Updated again", engineState: lastEngineState);
            XAssert.IsNotNull(lastEngineState);
            XAssert.IsTrue(EngineState.IsUsable(lastEngineState));
            XAssert.IsFalse(EngineState.IsUsable(previousEngineState));
            XAssert.AreNotSame(previousEngineState, lastEngineState);
        }
Ejemplo n.º 2
0
        public void EngineStateIsUpdatedAfterFailedExecution()
        {
            SetupHelloWorld();
            SetUpConfig();

            EngineState afterFirst = RunEngine("First build");

            FreshSetUp();
            Configuration.Filter = "tag='IDontMatchAnything'";

            // Build should fail
            var afterFail = RunEngine("Engine State is Updated", expectSuccess: false, engineState: afterFirst);

            AssertErrorEventLogged(global::BuildXL.Pips.Tracing.LogEventId.NoPipsMatchedFilter);
            XAssert.IsNotNull(afterFail);
            XAssert.IsTrue(EngineState.IsUsable(afterFail));
            XAssert.IsFalse(EngineState.IsUsable(afterFirst));
            XAssert.AreNotSame(afterFirst, afterFail);
        }
Ejemplo n.º 3
0
        public void EngineStateIsUpdatedAfterFailedScheduling()
        {
            SetupHelloWorld();
            SetUpConfig();

            EngineState afterFirst = RunEngine("First build");

            RestartEngine();
            AddModule("HelloWorld", ("hello.dsc", "invalid spec content"), placeInRoot: true); // Invalid spec
            SetUpConfig();

            // Build should fail
            var afterFail = RunEngine("Engine State is Updated", expectSuccess: false, engineState: afterFirst);

            AssertErrorEventLogged(global::BuildXL.FrontEnd.Core.Tracing.LogEventId.TypeScriptSyntaxError, 5);
            AssertErrorEventLogged(global::BuildXL.FrontEnd.Core.Tracing.LogEventId.CannotBuildWorkspace);
            XAssert.IsNotNull(afterFail);
            XAssert.IsTrue(EngineState.IsUsable(afterFail));
            XAssert.IsFalse(EngineState.IsUsable(afterFirst));
            XAssert.AreNotSame(afterFirst, afterFail);
        }
Ejemplo n.º 4
0
        public void TestMultipleReuses()
        {
            SetupHelloWorld();
            SetUpConfig();
            EngineState firstEngineState = RunEngine("First build");

            FreshSetUp("bar");
            EngineState secondEngineState = RunEngine("Second build", engineState: firstEngineState);

            XAssert.IsTrue(!EngineState.IsUsable(firstEngineState));
            XAssert.IsNotNull(secondEngineState);
            XAssert.IsTrue(!secondEngineState.IsDisposed);
            XAssert.AreNotSame(firstEngineState, secondEngineState);

            FreshSetUp("baz");
            EngineState thirdEngineState = RunEngine("Third build", engineState: secondEngineState);

            XAssert.IsTrue(!EngineState.IsUsable(secondEngineState));
            XAssert.IsNotNull(EngineState.IsUsable(thirdEngineState));
            XAssert.IsTrue(!thirdEngineState.IsDisposed);
            XAssert.AreNotSame(secondEngineState, thirdEngineState);
        }