在调试模式下运行 Fitnesse

发布于 2024-12-04 18:41:11 字数 1431 浏览 0 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

逆夏时光 2024-12-11 18:41:11

要调试 .Net 中的装置,我通常在 C# 装置代码中添加 Debugger.Break()

To debug fixtures in .Net I normally add Debugger.Break() inside my C# fixture code

脱离于你 2024-12-11 18:41:11

尽管我首选的开发解决方案已经在 Rustin 的 DebugBreak() 建议 上指出,而替代解决方案是调用 RunnerW.exe,需要将以下行添加到您的目标 Fitnesse 测试页面

[[Press me to start in remote debug mode][?responder=test&remote_debug=true]]

请记住,我假设您的测试页面已经定义REMOTE_DEBUG_RUNNER 指向 RunnerW.exe,如 健身指南的自定义测试执行部分

为了简单起见,我将提供一个示例适合性测试标头。

因此,以下是如何使用 Visual Studio 进行远程调试

  1. 确保 Fitnesse 测试页面以以下行开头
!define TEST_RUNNER {FitSharp\Runner.exe}

!define REMOTE_DEBUG_RUNNER {FitSharp\RunnerW.exe}

[[按我启动远程调试模式][?responder=test&remote_debug=true]]

测试规范的其余部分在这里
  1. Visual Studio中,设置目标代码断点
  2. 在拟合测试页面上,单击上面定义的按我以远程调试模式启动。这将启动 RunnerW.exe 进程(名为 Fitsharp 的 winform 应用程序),该进程将等待 30 秒(我不确定)。
  3. Visual Studio中> 调试菜单> 附加到进程,找到RunnerW.exe并按附加按钮。
  4. Fitsharp窗口(RunnerW.exe进程)中,单击GO按钮即可开始操作。

作为实用的解决方案,我使用以下策略:

  1. 我创建名为 SetupEngine 的静态页面,并添加前面步骤 1 中所述的 3 行。
  2. 在每个测试页面的顶部,我只需添加以下标题,这样我就不必重复这三行。

!包含.SetupEngine

请注意,.SetupEngine(路径)上的.(点)指的是您的 Fitnesse 根页面。你可能需要调整它。

当我提到 Fitnesse.UserGuide 的远程调试部分时,我有了这个想法

希望它有帮助

Although my prefered development solution has already been pointed out on Rustin's DebugBreak() suggestion, and alternate solution is to invoke RunnerW.exe, which requires adding the following line to your target Fitnesse test page

[[Press me to start in remote debug mode][?responder=test&remote_debug=true]]

Please, bear in mind that I am assuming your test page already defines REMOTE_DEBUG_RUNNER pointing to RunnerW.exe, as stated in Fitnesse guide's Customizing Test Execution section

For the sake of simplicity, I will present a sample fit test header.

So, here is how to Remote Debug using Visual Studio:

  1. Make sure you fitnesse test page starts with the following lines
!define TEST_RUNNER {FitSharp\Runner.exe}

!define REMOTE_DEBUG_RUNNER {FitSharp\RunnerW.exe}

[[Press me to start in remote debug mode][?responder=test&remote_debug=true]]

The rest of your test specification goes here
  1. In Visual Studio, set target code breakpoint
  2. On fit test page, click on Press me to start in remote debug mode, defined above. This starts the RunnerW.exe process (winform app called Fitsharp) which will wait for 30 seconds (I am not sure).
  3. In Visual Studio > Debug menu > Attach to process, locate RunnerW.exe and press Attach button.
  4. On Fitsharp window (RunnerW.exe process), click GO button and you are on your way.

As pratical solution, I use the following strategy:

  1. I create static page called SetupEngine and add the 3 lines stated on previous step 1.
  2. On the top of every test page, I just put the following header, so I don't have to repeat those 3 lines.

!include .SetupEngine

Note that . (dot) on .SetupEngine (which is a path) refers to your Fitnesse root page. You may have to adjust it.

I had this ideia when I was referring to Fitnesse.UserGuide's remote debug section

Hope it helps

鯉魚旗 2024-12-11 18:41:11

在测试目标位置之前添加以下行

!|debug|

有关更多详细信息,请参阅 Michael Sorens 的优秀文章,关于 Fitnesse 调试技术的最全面的文章。

Add the following line just before the your test target location

!|debug|

For further details, refer to Michael Sorens' excelent article, the most comprehensive article on Fitnesse debug techniques.

萌︼了一个春 2024-12-11 18:41:11

您考虑使用 RunnerW.exe 而不是 Runner.exe。

如果您将测试运行程序更改为 RunnerW,则会出现一个弹出窗口,上面有一个“执行”按钮,并且在您点击它之前不会启动适应性测试。

在点击 go 之前,您可以附加到任何进程(如果您使用 VS,则通过调试菜单中的“附加到进程”),并且执行将在设置的断点处暂停。

注意:FitNesse 使用的构建版本必须与您正在调试的代码相同。

您还可以使用远程调试器附加到远程进程。

另外,如果附加 RunnerW.exe 进程,您可以调试装置本身。

Your thinking of using RunnerW.exe as opposed to the Runner.exe.

If you change your test runner to be RunnerW a pop-up window will appear with a 'go' button on it, and will not start the fitnesse test until you hit it.

Before hitting go you can attach to any process (via 'Attach To Process' in the debug menu if your using VS) and the execution will pause at the break points set.

Note: You must have the same build being used by FitNesse as the code you are debugging.

You can also attach to a remote process, using the Remote Debugger.

Also, if you attach the the RunnerW.exe process, you can debug the fixtures themselves.

骷髅 2024-12-11 18:41:11

我已经有一段时间没有这样做了,但 FitNesse 附带的当前文档表明您已经很接近了。您应该使用remote_debug而不是debug

最好的办法是从 FitNesse 副本附带的文档开始,因为它与您正在运行的内容相匹配。如果您在端口 8080 上运行,则以下链接应该有效:http://localhost:8080/FitNesse。 UserGuide.DebugingFixtureCode

假设您使用的是 Java,这些说明应该会有所帮助。如果您使用不同的语言,我不确定我可以提供帮助。

I haven't had to do it in a while, but the current documentation that comes with FitNesse indicates that you are close. You should be using remote_debug instead of debug.

The best thing is to start with the documentation that comes with your copy of FitNesse, as it matches what you are running. If you are running on port 8080, then the following link should work: http://localhost:8080/FitNesse.UserGuide.DebugingFixtureCode.

Assuming you are using Java, these instructions should help. If you are using a different language I am not sure I can help.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文