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


C# IFrameworkHandle.LaunchProcessWithDebuggerAttached方法代码示例

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


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

示例1: Debug

        /// <summary>
        /// Starts a Process in a debug session using the provided command line arguments string.
        /// </summary>
        /// <param name="framework">The IFrameworkHandle which provides debug session handling.</param>
        /// <param name="info">The process start info which will be used to launch the external test program.</param>
        /// <returns>The newly spawned debug process.</returns>
        private static Process Debug(IFrameworkHandle framework, ProcessStartInfo info)
        {
            if (framework == null)
            {
                return Run(info);
            }

            Dictionary<string, string> environment =
                info.EnvironmentVariables.Cast<DictionaryEntry>().ToDictionary(
                    item => item.Key.ToString(),
                    item => item.Value.ToString()
                );

            int pid = framework.LaunchProcessWithDebuggerAttached(
                info.FileName,
                info.WorkingDirectory,
                info.Arguments,
                environment
            );

            // Get a process on the local computer, using the process id.
            return Process.GetProcessById(pid);
        }
开发者ID:stimm81,项目名称:vs-boost-unit-test-adapter,代码行数:29,代码来源:BoostTestRunnerBase.cs

示例2: DebugCatchTest

        /// <summary>
        /// Runs a test in a source (Catch binary) with a debugger attached and returns the resulting XML string.
        /// </summary>
        internal static string DebugCatchTest(string testBinary, string testSpec, IFrameworkHandle framework)
        {
            string output;

            var cwd = Directory.GetCurrentDirectory();
            var exePath = Path.Combine(cwd, testBinary);
            var outputPath = Path.GetTempFileName();
            try
            {
                var arguments = Utility.escapeArguments(testSpec, "-r", "xml", "-b", "-d", "yes", "-o", outputPath);
                var debuggee = Process.GetProcessById(framework.LaunchProcessWithDebuggerAttached(exePath, cwd, arguments, null));
                debuggee.WaitForExit();
                output = File.ReadAllText(outputPath);
                debuggee.Close();
            }
            finally
            {
                File.Delete(outputPath);
            }

            return output;
        }
开发者ID:mrpi,项目名称:CatchVsTestAdapter,代码行数:25,代码来源:CatchTestExecutor.cs


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