Beispiel #1
0
        //[InlineData("Output.Inspect.Heap.Null.cs2output"/*, true*/)]
        public async Task InspectHeap_ProducesExpectedOutput(string resourceName /*, bool allowExceptions = false*/)
        {
            var code = TestCode.FromResource(resourceName);

            var output = await ContainerTestDriver.CompileAndExecuteAsync(code.Original);

            code.AssertIsExpected(RemoveFlowJson(output), _testOutputHelper);
        }
Beispiel #2
0
        public async Task InspectMemoryGraph_ProducesExpectedOutput(string resourceName)
        {
            var code = TestCode.FromResource(resourceName);

            var output = await ContainerTestDriver.CompileAndExecuteAsync(code.Original);

            code.AssertIsExpected(RemoveFlowJson(output), _testOutputHelper);
        }
        public async Task SlowUpdate_IncludesInspectMemoryGraphInOutput(string resourceName)
        {
            var code   = TestCode.FromResource("Execution." + resourceName);
            var driver = await NewTestDriverAsync(code.Original);

            var result = await SendSlowUpdateWithRetryOnMovedObjectsAsync(driver);

            AssertIsSuccess(result);
            code.AssertIsExpected(result.ExtensionResult?.GetOutputAsString(), _testOutputHelper);
        }
Beispiel #4
0
        public async Task SlowUpdate_IncludesInspectHeapInOutput(string resourceName, bool allowExceptions = false)
        {
            var code   = TestCode.FromResource("Execution." + resourceName);
            var driver = await NewTestDriverAsync(code.Original);

            var result = await driver.SendSlowUpdateAsync <ExecutionResultData>();

            AssertIsSuccess(result, allowRuntimeException: allowExceptions);
            code.AssertIsExpected(result.ExtensionResult?.GetOutputAsString(), _testOutputHelper);
        }
Beispiel #5
0
        public async Task SlowUpdate_ReturnsExpectedResult_ForAst(string resourceName) {
            var data = TestCode.FromResource(resourceName);
            var driver = await NewTestDriverAsync(data);

            var result = await driver.SendSlowUpdateAsync<JArray>();

            var json = result.ExtensionResult?.ToString();

            data.AssertIsExpected(json, _output);
        }
Beispiel #6
0
        public async Task SlowUpdate_ReturnsExpectedDecompiledCode_InDebug(string resourceName) {
            var data = TestCode.FromResource(resourceName);
            var driver = await NewTestDriverAsync(data, Optimize.Debug);

            var result = await driver.SendSlowUpdateAsync<string>();
            var errors = result.JoinErrors();

            var decompiledText = result.ExtensionResult?.Trim();
            Assert.True(string.IsNullOrEmpty(errors), errors);
            data.AssertIsExpected(decompiledText, _output);
        }
Beispiel #7
0
        public async Task SlowUpdate_ReturnsExpectedDecompiledCode_ForJitAsm(string resourceName) {
            // https://github.com/ashmind/SharpLab/issues/514
            if (resourceName.Contains(".Fma.") && !Fma.IsSupported)
                resourceName = resourceName.Replace(".Fma.", ".NoFma.");
            if (resourceName.Contains(".Avx2.") && !Avx2.IsSupported)
                resourceName = resourceName.Replace(".Avx2.", ".NoAvx2.");

            var data = TestCode.FromResource(resourceName);
            var driver = await NewTestDriverAsync(data);

            var result = await driver.SendSlowUpdateAsync<string>();
            var errors = result.JoinErrors();

            var decompiledText = result.ExtensionResult?.Trim();
            Assert.True(string.IsNullOrEmpty(errors), errors);
            data.AssertIsExpected(decompiledText, _output);
        }