Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
b8c87dee
Kaydet (Commit)
b8c87dee
authored
Nis 03, 2013
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Show backtraces for core files from CppunitTests, too
Change-Id: Idff2831913b6fb6e5b522ae36fffeb345e3a1140
üst
b524fb86
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
56 deletions
+81
-56
gdb-core-bt.sh
solenv/bin/gdb-core-bt.sh
+17
-22
CppunitTest.mk
solenv/gbuild/CppunitTest.mk
+9
-1
UnoApiTarget.mk
solenv/gbuild/UnoApiTarget.mk
+1
-2
solaris.mk
solenv/gbuild/platform/solaris.mk
+5
-1
unxgcc.mk
solenv/gbuild/platform/unxgcc.mk
+5
-1
OfficeConnection.java
...est/source/java/org/openoffice/test/OfficeConnection.java
+44
-29
No files found.
solenv/
gbuild/platform/unxgcc_gdbforjuni
t.sh
→
solenv/
bin/gdb-core-b
t.sh
Dosyayı görüntüle @
b8c87dee
...
...
@@ -28,39 +28,34 @@
# instead of those above.
#
# we expect our work directory to be where soffice had been started
# $(1) should be the path to the executable
EXECUTABLE
=
${
1
}
COREDIR
=
${
2
}
OFFICEFILE
=
${
1
}
WORKDIR
=
${
2
}
if
test
-n
"
`
which gdb
`
"
if
test
-n
"
$(
which gdb
)
"
then
if
test
`
ls
"
${
WORKDIR
}
"
/core
*
2>/dev/null |
wc
-l
`
-eq
1
if
test
"
$(
ls
"
$COREDIR
"
/core
*
2>/dev/null |
wc
-l
)
"
-eq
1
then
COREFILE
=
`
ls
"
${
WORKDIR
}
"
/core
*
`
COREFILE
=
$(
ls
"
$COREDIR
"
/core
*)
echo
echo
"It seems like soffice.bin crashed during the test excution!"
echo
"Found a core dump at
${
COREFILE
}
"
echo
"Stacktrace:"
echo
"It looks like
${
EXECUTABLE
}
generated a core file at
${
COREFILE
}
"
echo
"Backtraces:"
GDBCOMMANDFILE
=
`
mktemp
`
echo
"thread apply all b
t"
>
${
GDBCOMMANDFILE
}
gdb
-x
$GDBCOMMANDFILE
--batch
${
OFFICEFILE
}
.bin
${
COREFILE
}
rm
${
GDBCOMMANDFILE
}
echo
"thread apply all b
acktrace"
>
"
$GDBCOMMANDFILE
"
gdb
-x
"
$GDBCOMMANDFILE
"
--batch
"
$EXECUTABLE
"
"
$COREFILE
"
rm
"
$GDBCOMMANDFILE
"
echo
exit
1
exit
0
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
"No core file identified in directory
${
COREDIR
}
"
echo
"To show backtraces for crashes during test execution,"
echo
"enable core files with:"
echo
echo
" ulimit -c unlimited"
echo
exit
0
exit
1
fi
else
echo
"You need gdb in your path to
generate stacktraces.
"
exit
0
echo
"You need gdb in your path to
show backtraces
"
exit
1
fi
# vim: set et sw=4 sts=4:
solenv/gbuild/CppunitTest.mk
Dosyayı görüntüle @
b8c87dee
...
...
@@ -83,6 +83,9 @@ $(call gb_CppunitTest_get_target,%) :| $(gb_CppunitTest_CPPTESTDEPS)
$(call gb_Output_announce,$*,$(true),CUT,2)
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $@) && \
$(if $(gb_CppunitTest__interactive),, \
$(if $(value gb_CppunitTest_postprocess), \
rm -fr $@.core && mkdir $@.core && cd $@.core &&)) \
($(gb_CppunitTest_CPPTESTPRECOMMAND) \
$(if $(G_SLICE),G_SLICE=$(G_SLICE)) \
$(if $(GLIBCXX_FORCE_NEW),GLIBCXX_FORCE_NEW=$(GLIBCXX_FORCE_NEW)) \
...
...
@@ -92,7 +95,12 @@ $(call gb_CppunitTest_get_target,%) :| $(gb_CppunitTest_CPPTESTDEPS)
$(ICECREAM_RUN) $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) $(gb_CppunitTest_CPPTESTCOMMAND) \
$(call gb_LinkTarget_get_target,CppunitTest/$(call gb_CppunitTest_get_libfilename,$*)) \
$(call gb_CppunitTest__make_args) \
$(if $(gb_CppunitTest__interactive),,> $@.log 2>&1 || (cat $@.log && $(UNIT_FAILED_MSG) && false))))
$(if $(gb_CppunitTest__interactive),, \
> $@.log 2>&1 \
|| (cat $@.log && $(UNIT_FAILED_MSG) \
$(if $(value gb_CppunitTest_postprocess), \
&& $(call gb_CppunitTest_postprocess,$(gb_CppunitTest_CPPTESTCOMMAND),$@.core)) \
&& false))))
define gb_CppunitTest_CppunitTest
$(call gb_CppunitTest__CppunitTest_impl,$(1),$(call gb_CppunitTest__get_linktargetname,$(1)))
...
...
solenv/gbuild/UnoApiTarget.mk
Dosyayı görüntüle @
b8c87dee
...
...
@@ -303,8 +303,7 @@ define gb_UnoApiHeadersTarget__command
RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100,\
$(UNOAPI_DEPS)) && \
$(gb_UnoApiHeadersTarget_CPPUMAKERCOMMAND) \
-Gc $(4) -BUCR \
-O$(3) $(call gb_UnoApiTarget_get_target,$(2)) \
-Gc $(4) -O$(3) $(call gb_UnoApiTarget_get_target,$(2)) \
@$${RESPONSEFILE} && \
rm -f $${RESPONSEFILE} && \
touch $(1)
...
...
solenv/gbuild/platform/solaris.mk
Dosyayı görüntüle @
b8c87dee
...
...
@@ -333,6 +333,10 @@ $(call gb_LinkTarget_get_target,$(2)) : RPATH :=
endef
define gb_CppunitTest_postprocess
$(SRCDIR)/solenv/bin/gdb-core-bt.sh $(1) $(2)
endef
# JunitTest class
ifneq ($(OOO_TEST_SOFFICE),)
...
...
@@ -350,7 +354,7 @@ $(call gb_JunitTest_get_target,$(1)) : DEFS := \
-Dorg.openoffice.test.arg.env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
-Dorg.openoffice.test.arg.user=$(call gb_Helper_make_url,$(call gb_JunitTest_get_userdir,$(1))) \
-Dorg.openoffice.test.arg.workdir=$(call gb_JunitTest_get_userdir,$(1)) \
-Dorg.openoffice.test.arg.postprocesscommand=$(
GBUILDDIR)/platform/unxgcc_gdbforjuni
t.sh \
-Dorg.openoffice.test.arg.postprocesscommand=$(
SRCDIR)/solenv/bin/gdb-core-b
t.sh \
-Dorg.openoffice.test.arg.soffice="$(gb_JunitTest_SOFFICEARG)" \
endef
...
...
solenv/gbuild/platform/unxgcc.mk
Dosyayı görüntüle @
b8c87dee
...
...
@@ -329,6 +329,10 @@ $(call gb_LinkTarget_get_target,$(2)) : RPATH :=
endef
define gb_CppunitTest_postprocess
$(SRCDIR)/solenv/bin/gdb-core-bt.sh $(1) $(2)
endef
# JunitTest class
ifneq ($(OOO_TEST_SOFFICE),)
...
...
@@ -346,7 +350,7 @@ $(call gb_JunitTest_get_target,$(1)) : DEFS := \
-Dorg.openoffice.test.arg.env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
-Dorg.openoffice.test.arg.user=$(call gb_Helper_make_url,$(call gb_JunitTest_get_userdir,$(1))) \
-Dorg.openoffice.test.arg.workdir=$(call gb_JunitTest_get_userdir,$(1)) \
-Dorg.openoffice.test.arg.postprocesscommand=$(
GBUILDDIR)/platform/unxgcc_gdbforjuni
t.sh \
-Dorg.openoffice.test.arg.postprocesscommand=$(
SRCDIR)/solenv/bin/gdb-core-b
t.sh \
-Dorg.openoffice.test.arg.soffice="$(gb_JunitTest_SOFFICEARG)" \
endef
...
...
unotest/source/java/org/openoffice/test/OfficeConnection.java
Dosyayı görüntüle @
b8c87dee
...
...
@@ -43,11 +43,6 @@ import static org.junit.Assert.*;
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
{
...
...
@@ -108,6 +103,7 @@ public final class OfficeConnection {
public
void
tearDown
()
throws
InterruptedException
,
com
.
sun
.
star
.
uno
.
Exception
{
boolean
cleanTermination
=
false
;
try
{
boolean
desktopTerminated
=
true
;
if
(
process
!=
null
)
{
...
...
@@ -148,38 +144,45 @@ public final class OfficeConnection {
if
(
process
!=
null
)
{
code
=
process
.
waitFor
();
}
boolean
outTerminated
=
outForward
==
null
||
outForward
.
terminated
();
boolean
errTerminated
=
errForward
==
null
||
errForward
.
terminated
();
boolean
outTerminated
=
outForward
==
null
||
outForward
.
terminated
();
boolean
errTerminated
=
errForward
==
null
||
errForward
.
terminated
();
assertEquals
(
0
,
code
);
cleanTermination
=
true
;
assertTrue
(
outTerminated
);
assertTrue
(
errTerminated
);
}
finally
{
try
{
String
sofficeArg
=
Argument
.
get
(
"soffice"
);
String
workdir
=
Argument
.
get
(
"workdir"
);
String
postprocesscommand
=
Argument
.
get
(
"postprocesscommand"
);
if
(
sofficeArg
.
startsWith
(
"path:"
)
&&
workdir
!=
null
&&
postprocesscommand
!=
null
)
{
ProcessBuilder
pb
=
new
ProcessBuilder
(
postprocesscommand
,
sofficeArg
.
substring
(
"path:"
.
length
()),
workdir
);
Process
postprocess
=
pb
.
start
();
Forward
ppoutForward
=
new
Forward
(
postprocess
.
getInputStream
(),
System
.
out
);
ppoutForward
.
start
();
Forward
pperrForward
=
new
Forward
(
postprocess
.
getErrorStream
(),
System
.
err
);
pperrForward
.
start
();
postprocess
.
waitFor
();
if
(
postprocess
.
exitValue
()
!=
0
)
if
(!
cleanTermination
)
{
try
{
String
sofficeArg
=
Argument
.
get
(
"soffice"
);
String
workdir
=
Argument
.
get
(
"workdir"
);
String
postprocesscommand
=
Argument
.
get
(
"postprocesscommand"
);
if
(
sofficeArg
.
startsWith
(
"path:"
)
&&
workdir
!=
null
&&
postprocesscommand
!=
null
)
{
// no ugly long java stacktrace needed here
PostprocessFailedException
e
=
new
PostprocessFailedException
();
StackTraceElement
[]
newStackTrace
=
new
StackTraceElement
[
0
];
e
.
setStackTrace
(
newStackTrace
);
throw
e
;
ProcessBuilder
pb
=
new
ProcessBuilder
(
postprocesscommand
,
sofficeArg
.
substring
(
"path:"
.
length
())
+
".bin"
,
workdir
);
Process
postprocess
=
pb
.
start
();
Forward
ppoutForward
=
new
Forward
(
postprocess
.
getInputStream
(),
System
.
out
);
ppoutForward
.
start
();
Forward
pperrForward
=
new
Forward
(
postprocess
.
getErrorStream
(),
System
.
err
);
pperrForward
.
start
();
int
code
=
postprocess
.
waitFor
();
if
(
code
!=
0
)
{
throw
new
PostprocessFailedException
(
code
);
}
}
}
catch
(
IOException
e
)
{
throw
new
PostprocessFailedException
(
e
);
}
}
catch
(
IOException
e
)
{}
}
}
...
...
@@ -262,6 +265,18 @@ public final class OfficeConnection {
private
boolean
done
=
false
;
}
private
static
final
class
PostprocessFailedException
extends
RuntimeException
{
PostprocessFailedException
(
int
exitCode
)
{
super
(
"postprocessing failed with exit code "
+
exitCode
);
}
PostprocessFailedException
(
IOException
cause
)
{
super
(
"postprocessing failed with IOException "
+
cause
,
cause
);
}
};
private
String
description
;
private
Process
process
=
null
;
private
Forward
outForward
=
null
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment