tdf#157003: interactive Java unit test debugging

Hossein Nourikhah hossein at libreoffice.org
Fri May 17 14:11:37 UTC 2024


Hello Martin,

If you remember from the previous problem with this test, I could run it 
this way on Windows, as displayed on the command line:

java -Xmx64M -classpath 
"$W/JavaClassSet/JunitTest/sw_complex;C:/cygwin64/home/user/lode/opt/share/java/junit.jar;$I/program;$W/Jar/OOoRunner.jar;$I/program/classes/libreoffice.jar;$W/Jar/test.jar" 
-Dorg.openoffice.test.arg.soffice="path:$I/program/soffice" 
-Dorg.openoffice.test.arg.env=PATH="$PATH" 
-Dorg.openoffice.test.arg.user=file:///$W/JunitTest/sw_complex/user 
org.junit.runner.JUnitCore 
complex.indeterminateState.CheckIndeterminateState

You can find similar command on your platform from the make output, and 
then set up a Java debugger/IDE to debug this Java command line.

Btw, one of the goals of porting complex test from Java to Python/C++ is 
to ease the debugging.

Regards,
Hossein

On 17.05.2024 12:05, Martin Gube wrote:
> Hi Developers,
> 
> I'd like to interactively debug the Java unit test
> JunitTest_sw_complex (CheckIndeterminateState.java) for further work
> on tdf#157003. Can anyone help me on how to do this?
> 
> In case of failing unit tests, the make process output after invoking
> "make JunitTest_sw_complex" suggests the following:
> "Or to do interactive debugging, run two shells with:
>     make debugrun
>     make gb_JunitTest_DEBUGRUN=T JunitTest_sw_complex"
> 
> However "make gb_JunitTest_DEBUGRUN=T JunitTest_sw_complex" results in
> a virtually never ending make process for me. I tried this few times
> and canceled it after several hours without visible progress.
> 
> Also I tried to run JunitTest_sw_complex inside GDB in different ways,
> without success. However, I'm wondering if GDB is able to debug Java
> [1].
> I also tried to use JDB instead of GDB but got stuck with making the
> unit test run inside JDB.
> 
> Can anyone help me how to interactively debug Java unit tests for
> LibreOffice?
> 
> Many thanks for your help + best Regards,
> Martin
> P.S.: please excuse me in case you got this mail twice. I already sent
> it yesterday, however it appeared like not properly sent.
>  [1] https://www.sourceware.org/gdb/

-- 
Hossein Nourikhah, Ph.D., Developer Community Architect
Tel: +49 30 5557992-65 | Email: hossein at libreoffice.org
The Document Foundation, Winterfeldtstraße 52, 10781 Berlin, DE
Gemeinnützige rechtsfähige Stiftung des bürgerlichen Rechts
Legal details: https://www.documentfoundation.org/imprint


More information about the LibreOffice mailing list