[Libreoffice-commits] .: 3 commits - solenv/gbuild unotest/source
Bjoern Michaelsen
bmichaelsen at kemper.freedesktop.org
Thu Nov 24 20:31:03 PST 2011
solenv/gbuild/JunitTest.mk | 7 +-
solenv/gbuild/platform/unxgcc_gdbforjunit.sh | 35 +++++++---
unotest/source/java/org/openoffice/test/OfficeConnection.java | 15 ++++
3 files changed, 45 insertions(+), 12 deletions(-)
New commits:
commit a1b57be652ac532ebddb3e3e53dddc35ae420f31
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date: Fri Nov 25 05:27:15 2011 +0100
empty java stacktrace for soffice crashers, they are not interesting anyway
diff --git a/unotest/source/java/org/openoffice/test/OfficeConnection.java b/unotest/source/java/org/openoffice/test/OfficeConnection.java
index 54a412d..8f99076 100644
--- a/unotest/source/java/org/openoffice/test/OfficeConnection.java
+++ b/unotest/source/java/org/openoffice/test/OfficeConnection.java
@@ -48,7 +48,13 @@ import static org.junit.Assert.*;
org.openoffice.test.arg.... system properties.
*/
+
public final class OfficeConnection {
+ private final class PostprocessFailedException extends java.lang.RuntimeException {
+ PostprocessFailedException() {
+ super("This likely means that soffice crashed during the test.");
+ }
+ };
/** Start up an OOo instance.
*/
public void setUp() throws Exception {
@@ -159,7 +165,14 @@ public final class OfficeConnection {
Forward pperrForward = new Forward(postprocess.getErrorStream(), System.err);
pperrForward.start();
postprocess.waitFor();
- assertEquals(0, postprocess.exitValue());
+ if(postprocess.exitValue() != 0)
+ {
+ // no ugly long java stacktrace needed here
+ PostprocessFailedException e = new PostprocessFailedException();
+ StackTraceElement[] newStackTrace = new StackTraceElement[0];
+ e.setStackTrace(newStackTrace);
+ throw e;
+ }
}
}
catch(IOException e) {}
commit 1cec66388eac81af2197da4fbf8fd2b00c56c7a5
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date: Fri Nov 25 05:25:16 2011 +0100
dont choke without gdb
diff --git a/solenv/gbuild/platform/unxgcc_gdbforjunit.sh b/solenv/gbuild/platform/unxgcc_gdbforjunit.sh
index ced0444..8520849 100755
--- a/solenv/gbuild/platform/unxgcc_gdbforjunit.sh
+++ b/solenv/gbuild/platform/unxgcc_gdbforjunit.sh
@@ -34,18 +34,33 @@
OFFICEFILE=${1}
WORKDIR=${2}
-if test -e ${WORKDIR}/core
+if test -n "`which gdb`"
then
- STORELOCATION=`mktemp --tmpdir=${WORKDIR} core.XXXX`
- echo "Found a core dump at ${WORKDIR}, moving it to ${STORELOCATION}"
- mv ${WORKDIR}/core ${STORELOCATION}
- echo "Stacktrace:"
- GDBCOMMANDFILE=`mktemp`
- echo "bt" > ${GDBCOMMANDFILE}
- gdb -x $GDBCOMMANDFILE --batch ${OFFICEFILE}.bin ${STORELOCATION}
- rm ${GDBCOMMANDFILE}
- exit 1
+ if test -e ${WORKDIR}/core
+ then
+ STORELOCATION=`mktemp --tmpdir=${WORKDIR} core.XXXX`
+ echo
+ echo "It seems like soffice.bin crashed during the test excution!"
+ echo "Found a core dump at ${WORKDIR}, moving it to ${STORELOCATION}"
+ mv ${WORKDIR}/core ${STORELOCATION}
+ echo "Stacktrace:"
+ GDBCOMMANDFILE=`mktemp`
+ echo "bt" > ${GDBCOMMANDFILE}
+ gdb -x $GDBCOMMANDFILE --batch ${OFFICEFILE}.bin ${STORELOCATION}
+ rm ${GDBCOMMANDFILE}
+ echo
+ exit 1
+ else
+ echo
+ echo "No core dump at ${WORKDIR}, to create core dumps (and stack traces)"
+ echo "for crashed soffice instances, enable core dumps with:"
+ echo
+ echo " ulimit -c unlimited"
+ echo
+ exit 0
+ fi
else
+ echo "You need gdb in you path to general stacktraces."
exit 0
fi
commit 279473f1ed6cd3bb6f6d2b8b9c75529b91836e39
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date: Fri Nov 25 05:24:23 2011 +0100
cut out noise in junit stacktrace for output, but keep them in log
diff --git a/solenv/gbuild/JunitTest.mk b/solenv/gbuild/JunitTest.mk
index 10df1da..dab548a 100644
--- a/solenv/gbuild/JunitTest.mk
+++ b/solenv/gbuild/JunitTest.mk
@@ -54,7 +54,12 @@ $(call gb_JunitTest_get_target,%) :
'-Dorg.openoffice.test.arg.debugcommand=$(gb_JunitTest_DEBUGCOMMAND)') \
$(DEFS) \
org.junit.runner.JUnitCore \
- $(CLASSES) 2>&1 > $@.log || (cat $@.log && false)) && \
+ $(CLASSES) 2>&1 > $@.log || \
+ (grep -v -e 'at org.junit.' \
+ -e 'at com.sun.star.lib.uno.' \
+ -e 'at java.lang.reflect.' \
+ -e 'at sun.reflect.' $@.log \
+ && echo "see full error log at $@.log" && false)) && \
rm -rf $(call gb_JunitTest_get_userdir,$*))
$(CLEAN_CMD)
More information about the Libreoffice-commits
mailing list