In the codebase, there are a lot of unit tests that have this pattern: > DECLARE_OOXMLEXPORT_TEST(testFoo,"test.odt") > { > xmlDocPtr pXmlDoc = parseExport(); > if (!pXmlDoc) > return; > assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r", 2); > } The code tests that pXmlDoc is valid, because the export tests run in two stages, first in initial import, then in follow-up import-export-import. For the former, there's no export yet to parse, and so the pXmlDoc validity test makes this unit test "export-only". There are special test templates for export-only tests; and so the task is to change the above code to > DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFoo,"test.odt") > { > xmlDocPtr pXmlDoc = parseExport(); > assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r", 2); > } This not only makes it simpler, but also more robust: if parseExport fails for some parsing problem and returns nullptr, the test should fail, which would happen now, unlike with original code, where it would silently pass. The code is in .cxx files, mostly under sw/qa: https://opengrok.libreoffice.org/search?project=core&full=%2FDECLARE_.*EXPORT_TEST%2F&si=full&n=250 https://opengrok.libreoffice.org/search?project=core&full=%22if+%28%21pXmlDoc%29%22&si=full Of course, only the actual export-only tests need to be changed.
CC Michael Stahl, we just discussed a similar topic on IRC yesterday.
Onur Yilmaz committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/ae26c6a3cc7662c4e2a9b4c684f64b44ae28e8a9 tdf#129423: Make export tests export-only where applicable It will be available in 6.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Onur Yilmaz committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/5c907e0718bda1cc8631eacabc1b41e4d9617332 tdf#129423: Make export tests export-only where applicable It will be available in 6.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Onur Yilmaz committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c48b3d092976f5b8a162408d885b178b4660d91d tdf#129423: Make export tests export-only where applicable It will be available in 6.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
ayhanyalcinsoy committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/3b8007d4270c5453a65dabef984ed6c24a5a2b4a tdf#129423: Make export tests export-only where applicable It will be available in 6.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Onur Yilmaz committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/408f84f6b95a99013b841e1d923ec4cb05bd2a5c tdf#129423: Make export tests export-only where applicable It will be available in 6.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Onur Yilmaz committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/873ce9b271b00e044912f4849ae2649b4fa21efd tdf#129423: Make export tests export-only where applicable It will be available in 6.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
ayhanyalcinsoy committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/16e7ca76ae873fe953b483f4c34aa9e5610addf8 tdf#129423: Make export tests export-only where applicable It will be available in 6.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Kemal Ayhan committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c59c1a9170e9510a18a084cd90289b6a7d8b87e4 tdf#129423: Make export tests export-only where applicable It will be available in 6.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Shivam Kumar Singh committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/6ffaefa1694f71175bb499cd5ee5886b23874e90 tdf#129423: Make export tests export-only where applicable It will be available in 6.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Yusuf Keten committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/a5cdcc3a17a562382fc2cc38a8aaf5b584343d12 tdf#129423: Make export tests export-only where applicable It will be available in 6.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I'm starting to work on this.
Note that this syntax should also be checked and converted where necessary: > if (xmlDocPtr pXmlDoc = parseExport("styles.xml")) > { > ... > }
(In reply to Mike Kaganski from comment #13) > Note that this syntax should also be checked and converted where necessary: > > > if (xmlDocPtr pXmlDoc = parseExport("styles.xml")) > > { > > ... > > } Yes, sw/qa/extras/ooxmlexport/ooxmlexport5.cxx has some of those. E.g https://opengrok.libreoffice.org/xref/core/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx?r=ec8dc357#1210
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/8e572dc82b132de8472928db0ab0aed6388390e8 tdf#129423: make these tests export-only It will be available in 7.0.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Already done.
(In reply to Attila Bakos (NISZ) from comment #16) > Already done. I don't see it done e.g. for odfexport...
Oh, should the unit tests that load a concrete XML file also be converted? Such as testTableStyles3 in odfexport which calls parseExport("styles.xml")?
(In reply to Attila Bakos (NISZ) from comment #18) Please check some commits mentioned in this bug, like e.g. in comment 2.
Attila Bakos committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/5ac88d12b377f64ff36551bfb3cf95a4a23a167d tdf#129423 sw: Convert more tests to export-only It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Daniel Arato (NISZ) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d9e1775941ff2314d4c1c3d2ace273796d809ca4 tdf#129423 sw: remove last two bad nullptr checks It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to Attila Bakos (NISZ) from comment #16) > Already done. (In reply to Mike Kaganski from comment #17) > I don't see it done e.g. for odfexport... Then today ... > Dániel Arató (NISZ) <arato.daniel@nisz.hu> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > Status|ASSIGNED |RESOLVED > Resolution|--- |FIXED I'm looking at odfexport, and don't see anything changed. Does NISZ team simply try to close as many bugs as it can, ignoring the common sense?
(In reply to Mike Kaganski from comment #22) I apologize. The original bug description referred to OOXML export tests specifically. I never looked at the other modules. We will look for the same pattern in the remaining modules now.
(In reply to Dániel Arató (NISZ) from comment #23) > The original bug description referred to OOXML export tests specifically. No. It described a pattern; and then provided a OpenGrok reference using DECLARE_.*EXPORT_TEST regex.
(In reply to Mike Kaganski from comment #24) You're correct of course. Please excuse my inattention.
Daniel Arato (NISZ) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/ceae73dd294b5ca4073062afc1223efb1c206780 tdf#129423 sw: Make yet more tests export-only It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Daniel Arato (NISZ) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/f83f06475996cdf072a230aa8c0abe6d85b278ec tdf#129423 sw: export-only tests, part 2 It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Daniel Arato (NISZ) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/87c6b7a8dea4f59b09001d4d6364cb1835d10903 tdf#129423 sw: export-only tests, part 3 It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Daniel Arato (NISZ) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/78bc1c3c0c71eb67046db5596eb8d442ad564310 tdf#129423 sw: export-only tests, part 6 It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Daniel Arato (NISZ) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/bc01e76bab663826c7c0f125cbbfc790f7de4a98 tdf#129423 sw: export-only tests, part 7 It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Daniel Arato (NISZ) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/4419b19715fdc65728b559d9fc6e36c9e66bc562 tdf#129423 sw: export-only tests, part 11 It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Daniel Arato (NISZ) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/a53e0459280a06a3794cd2a83fd7fbca90fb7ea5 tdf#129423 sw: export-only tests, part 12 It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Daniel Arato (NISZ) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c41d937fdd97238fe7787f97a51b3e2a4c72d30a tdf#129423 sw: export-only tests, part 13 It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Daniel Arato (NISZ) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/f51aaf80002c74af78c8934a3dff4938e1f55acd tdf#129423 sw: export-only tests, part 9 It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Daniel Arato (NISZ) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/0e3e0b04395de673e0cc9709de360e5cf95c1cc7 tdf#129423 sw: export-only tests, part 5 It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Daniel Arato (NISZ) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/4d57fd4557d818c6ec5aea12cdd797899b4fdcf7 tdf#129423 sw: export-only tests, part 8 It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Daniel Arato (NISZ) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/77829e5310350afe5d5e66f8abc3adbcc988ba39 tdf#129423 sw: export-only tests, part 4 It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Daniel Arato (NISZ) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/0be6e21857f868d85049fca2c8e02fc5e8802120 tdf#129423 sw: export-only tests, part 10 It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
umutbayramoglu committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/0825f53a715d7c0e8ddcd9220726c71c4250536e tdf#129423: Make export tests export-only where applicable It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.