如何调试Tycho运行的测试用例?

Aar*_*lla 8 java remote-debugging tycho tycho-surefire-plugin

使用Tycho构建项目时,测试用例使用equinox启动程序在新进程中运行-application org.eclipse.tycho.surefire.osgibooter.headlesstest.

如何调试测试用例?

jsi*_*ers 8

有一种更简单的方法来实现这一目标:

只需添加-DdebugPort=8000到Maven命令行并附加远程调试会话.

查看文档http://www.eclipse.org/tycho/sitedocs/tycho-surefire/tycho-surefire-plugin/test-mojo.html#debugPort


Aar*_*lla 5

将其添加到您的 POM 中:

<profiles>
    <profile>
        <id>debug</id>

        <build>
            <plugins>
                <plugin>
                    <groupId>org.eclipse.tycho</groupId>
                    <artifactId>tycho-surefire-plugin</artifactId>
                    <version>${tycho-version}</version>
                    <configuration>
                       <argLine>-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y</argLine>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>
Run Code Online (Sandbox Code Playgroud)

mvn ... -P debug现在,您可以在打印以下行时启用调试:

监听地址为 8000 的传输 dt_socket

请参阅Eclipse 帮助如何配置 IDE