thewml / website-meta-language

An old offline HTML preprocessor (which can be used for static site generation), written in Perl and C that is still maintained for legacy reasons, but probably not recommended for new sites.
https://www.shlomifish.org/open-source/projects/website-meta-language/
GNU General Public License v2.0
14 stars 8 forks source link

Both "make test" and "make check" fail, but only "make check" configures the installation necessary for "make test" #25

Closed xtaran closed 5 years ago

xtaran commented 5 years ago

This fails for quite a while for me when working directly inside a git checkout of this repository with in-tree building, but I never bothered, because it works fine in the Debian package where debhelper seems to to some out-of-tree building CMake magic to make it work.

But now, when trying to test whether the fix for #24 works, I digged a little bit deeper into that. (I want to refer to this issue in my reply to #24, hence this new issue before I reply to #24.) Here's what I tried:

$ git clean -dxf
[…]
$ git pull upstream master
[…]
$ git show
commit 4118be8a2d11fcbfb23ad2a56220ae73b0400b51 (HEAD -> master, upstream/master, origin/master, origin/HEAD)
Author: Shlomi Fish <shlomif@shlomifish.org>
Date:   Sun Jan 6 16:30:30 2019 +0200

    Avoid warnings when accepting input from stdin.
[…]
$ cd src
cmake .
[…]
$ make
[…]
$ make test
Running tests...
Test project /home/abe/wml/website-meta-language/src
    Start 1: wml_tests
1/1 Test #1: wml_tests ........................***Failed    0.69 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.70 sec

The following tests FAILED:
          1 - wml_tests (Failed)
Errors while running CTest
make: *** [Makefile:120: test] Error 8

This fails more or less immediately. Then I tried make check (common in the autoconf world):

$ make check
Scanning dependencies of target check
Running [cd . && mkdir FOO && cd FOO && /usr/bin/perl /home/abe/wml/website-meta-language/src/Tatzer  --prefix=/home/abe/wml/website-meta-language/src/wml_test/tests/installation && make && make install]
cmake -DCMAKE_BUILD_TYPE=debug -DDATADIR=/home/abe/wml/website-meta-language/src/wml_test/tests/installation/share -DBUILD_STATIC_LIBRARY= -DFCS_WITH_TEST_SUITE=1 -DBHS_STATE_STORAGE=BHS_STATE_STORAGE_INTERNAL_HASH -DCMAKE_INSTALL_PREFIX=/home/abe/wml/website-meta-language/src/wml_test/tests/installation /home/abe/wml/website-meta-language/src
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    BHS_STATE_STORAGE
    BUILD_STATIC_LIBRARY
    FCS_WITH_TEST_SUITE

-- Build files have been written to: /home/abe/wml/website-meta-language/src
make[4]: *** No targets specified and no makefile found.  Stop.
Running [cd . && mkdir FOO && cd FOO && /usr/bin/perl /home/abe/wml/website-meta-language/src/Tatzer  --prefix=/home/abe/wml/website-meta-language/src/wml_test/tests/installation && make && make install] failed! at /home/abe/wml/website-meta-language/src/wml_test/run_test.pl line 27.
make[3]: *** [wml_test/CMakeFiles/check.dir/build.make:57: wml_test/CMakeFiles/check] Error 2
make[2]: *** [CMakeFiles/Makefile2:2535: wml_test/CMakeFiles/check.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:2542: wml_test/CMakeFiles/check.dir/rule] Error 2
make: *** [Makefile:873: check] Error 2

This does partially what I would have expected from make test: It prepares the installation of wml into the wml_test/tests/installation tree, but seems to fail to find some kind of check target afterwards. Hence, what makes the test suite pass for me, is the following sequence:

$ make check
[Output as above]
$ make install
Scanning dependencies of target iselect
[  0%] Building C object wml_aux/iselect/CMakeFiles/iselect.dir/iselect_main.c.o
[  1%] Building C object wml_aux/iselect/CMakeFiles/iselect.dir/iselect_browse.c.o
[…]
[ 77%] Built target preprocess_perl_include_config
[100%] Built target includes_pods
Install the project...
-- Install configuration: "debug"
-- Installing: /home/abe/wml/website-meta-language/src/wml_test/tests/installation/lib/wml/exec/wml_aux_iselect
[…]
-- Installing: /home/abe/wml/website-meta-language/src/wml_test/tests/installation/lib/wml/data/logos/logo-xemacs.info
-- Installing: /home/abe/wml/website-meta-language/src/wml_test/tests/installation/lib/wml/data/logos/logo-xemacs.png
$ make test
Running tests...
Test project /home/abe/wml/website-meta-language/src
    Start 1: wml_tests
1/1 Test #1: wml_tests ........................   Passed    8.55 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   8.55 sec

So from my point of view, what the check target does in configuring needs to be copied into the test target to make the above work.

Please tell me if the above is not how it is meant to be used. (I had to guess since INSTALL still has some TODO markers with regards to how to run the test suite.)

shlomif commented 5 years ago

Hi @xtaran !

I'd rather not support in tree building (cmake .) because it is not recommended by cmake best practices. So please don't do that and use cmake ../src or equivalent.

xtaran commented 5 years ago

Out-of-tree building with cmake ../src && make && make test indeed works. Not that I understand it, since I consider out-of-tree building the more complicated special case. But then again, I still don't really understand how CMake works. So let's close this. Thanks for the hint.