Bug 339299 - meinproc test using data from install rather than build dir
Summary: meinproc test using data from install rather than build dir
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kdoctools
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Documentation Editorial Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-22 13:47 UTC by Harald Sitter
Modified: 2014-09-24 09:12 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.3.0


Attachments
patch using --srcdir on meinproc5 (969 bytes, patch)
2014-09-22 14:26 UTC, Harald Sitter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Sitter 2014-09-22 13:47:59 UTC
the test should try to find the xsl from the build dir, not the installed path. otherwise it would be testing against the installed version, rather than the to-be-installed one.

side effect is that if the test is run before the initial install the xsl lookup will fail entirely (which is also a problem as far as clean distribution package builds are concerned as they wouldn't ever have a previous install to test against):

/usr/bin/ctest --force-new-ctest-process -j4
Test project /build/buildd/kdoctools-5.2.0+git20140922.1336/obj-i686-linux-gnu
    Start 1: meinproc_template
1/1 Test #1: meinproc_template ................***Failed    0.01 sec
Could not locate file "kf5/kdoctools/customization" in ("/home/buildd/.local/share", "/usr/local/share", "/usr/share")
Could not locate file "kf5/kdoctools/customization/kde-chunk.xsl" in ("/home/buildd/.local/share", "/usr/local/share", "/usr/share")
Error: Unable to find the stylesheet named "customization/kde-chunk.xsl" in dtd resources

Reproducible: Always
Comment 1 Harald Sitter 2014-09-22 14:26:37 UTC
Created attachment 88791 [details]
patch using --srcdir on meinproc5

Attached a patch using --srcdir to make meinproc find the xsl files that are alraedy being replicated into src/customization.

Other than using --srcdir there appear (with my very limited overview on the matter) exactly two options:
- detect missing assets and let the test pass (assuming that we are running pre-install, and even post-install failing on missing assets would really be more validation of whether the installation and envrionment is suitable than a test of meinproc)
- replicate an installation path structure in the build dir and use XDG_DATA_DIRS to make meinproc5 find it, at which point the test becomes more of an integration test than anything else
Comment 2 Luigi Toscano 2014-09-22 20:30:02 UTC
(In reply to Harald Sitter from comment #1)
> - replicate an installation path structure in the build dir and use
> XDG_DATA_DIRS to make meinproc5 find it, at which point the test becomes
> more of an integration test than anything else
This is the solution I would like to have, but for now the codepath which forces srcdir (used during the generation of the documentation shipped with kdoctools) is a test. Please commit (and if you can, backport to the corresponding kdelibs/kdoctools test).
Comment 3 Harald Sitter 2014-09-24 09:12:40 UTC
Git commit a1efbd838538a6ce32ff994eb8fd8e4260ec3b60 by Harald Sitter.
Committed on 24/09/2014 at 09:12.
Pushed by sitter into branch 'KDE/4.14'.

make meinproc test work before running make install

this is achieved by using --srcdir on meinproc5 to define the path where
to look for the customization directory

note: builddir/customization is populated by the relevant install
macros in the kdoctools directory
FIXED-IN: 4.14.2

M  +1    -1    kdoctools/tests/CMakeLists.txt

http://commits.kde.org/kdelibs/a1efbd838538a6ce32ff994eb8fd8e4260ec3b60
Comment 4 Harald Sitter 2014-09-24 09:12:53 UTC
Git commit ae8c4837a5c2f52528a42ad6565d7fdea00bbc0d by Harald Sitter.
Committed on 24/09/2014 at 09:12.
Pushed by sitter into branch 'master'.

make meinproc test work before running make install

this is achieved by using --srcdir on meinproc5 to define the path where
to look for the customization directory

note: builddir/src/customization is populated by the relevant install
macros in src/
FIXED-IN: 5.3.0

M  +1    -1    autotests/CMakeLists.txt

http://commits.kde.org/kdoctools/ae8c4837a5c2f52528a42ad6565d7fdea00bbc0d