Hey Vishv,
2013/7/5 Vishv Brahmbhatt <vishvbrahmbhatt19@gmail.com>:
Hi,
I am working on "Slide Layout Extendibility" project for GSOC. As for
one of
my initial task,I had to set up XML file and parser which reads
information
from that XML file.So as of now the parser is working perfectly and even
compilation works perfectly.But the "unit test" fails.I have been stuck
on
this error for last 4 days and it seems that,there is a bug in the
"unit-test" process(for XML configuration files in Impress). And I am
sharing this problem as per the advice of my mentor Thorsten(Please
refer to
my commit & Error links at the end):
(1) So for setting up the configuration path of "layoutlist.xml" ,I have
made an entry of "LayoutListFiles",similar to that of "EffectFiles" in
"Impress.xcs:457".
(2) The code processing of XML is similar to that in
"core/sd/source/core/CustomAnimationPreset.cxx:300".
(3) After using xNameAccess->getByName( "LayoutListFiles" ) >>= aFiles
and
expandMacros() function.The configuration file-path
"vnd.sun.star.expand:$BRAND_BASE_DIR/share/config/soffice.cfg/simpress/layoutlist.xml"
expands to
"/home/vishv/Libre_Git/core/solver/unxlngx6/installation/opt/program/../share/config/soffice.cfg/simpress/layoutlist.xml"
for "installation" process.
But for "Unit-Test" ,it expands to
"/home/vishv/Libre_Git/core/solver/unxlngx6/unittest/install/share/config/soffice.cfg/simpress/layoutlist.xml".
Ok so some background knowdlege about why our unittests work
differently than a normal start. For unit tests we use a clean minimal
user profile that contains exactly the few entries that are necessary
to run the tests during a build.
I am using the above generated string in parseURI(string filepath) to get
DOM structure and then traverse through XML for information.
(4)So in-spite of unit-test errors, XML parser works perfectly,because
correct path goes into the parseURI() in the installation process(i.e
.install/program/simpress works well without any crashes).
(5)The problem here is that path generated for unit-test check is wrong:
Correct path should be:
"/home/vishv/Libre_Git/core/solver/unxlngx6/unittest/install/../user/share/config/soffice.cfg/simpress/layoutlist.xml"
, because at this place a new "layoutlist.xml" is generated after
packaging.
But the wrong path generated as stated above is
:"/home/vishv/Libre_Git/core/solver/unxlngx6/unittest/install/share/config/soffice.cfg/simpress/layoutlist.xml"
It leads to errors (i.e failed to load external entity at "filepath..."
)
Also this scenario happens for the current configuration "effects.xml"
file
as well.
It would be great ,if someone can guide in correcting the "unit-test"
path
and indeed removing the error.Also please correct me,if I am wrong in my
observations.
So if you need these files for the unit tests you need to tell the
tests that they should be copied to the tests profile. You can find
the test profile at test/user-template/ and the makefile copying them
to their destination folder at test/Package_unittest.mk. You might
just want to add some code to the makefile that takes your xml files
and copies them to the correct location.
Regards,
Markus
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.