A question about 'make test' target

191 views
Skip to first unread message

Hedayat Vatankhah

unread,
Nov 6, 2015, 2:05:50 AM11/6/15
to opencog
Dear all,
Hi! I'm a new member here, so my question might be about a well known fact or might be answered somewhere in the wiki.

BTW, there is an ambiguity about the 'make test' target that I'd like to know more about. In one hand, you are (somewhat) using CMake's own CTest feature, like using ENABLE_TESTING() command and some testing constructs (some of them are only needed for older CMake versions (probably 2.6) and can be simplified/modernized now as the minimum usable version is in CMake 2.8 series now); on the other hand you are creating a custom 'test' target (ENABLE_TESTING() creates a test target itself).

I'd like to know if test target is intentionally overridden, and provides something that cmake's own 'test' target doesn't provide. Currently, cmake gives me a warning about this:
----------------------------------------------------------------------------------------------------
CMake Warning (dev) at CMakeLists.txt:300 (ADD_CUSTOM_TARGET):
  Policy CMP0037 is not set: Target names should not be reserved and should
  match a validity pattern.  Run "cmake --help-policy CMP0037" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  The target name "test" is reserved or not valid for certain CMake features,
  such as generator expressions, and may result in undefined behavior.
This warning is for project developers.  Use -Wno-dev to suppress it.
----------------------------------------------------------------------------------------------------
So, if it is necessary, we can explicitly set CMP0037 policy to be clear that we want to override test target. If not, it might be helpful to re-consider testing framework again considering related features in more recent CMake versions (things like AddCxxtest.cmake can probably be removed completely as mentioned in the referenced page: http://www.cmake.org/Wiki/CMakeMacroAddCxxTest).

Regards,
Hedayat

Linas Vepstas

unread,
Nov 6, 2015, 4:35:49 AM11/6/15
to opencog
I don't know about cmake, but `make test` is a standard target that almost all packages provide.  For gnu autoconf targets, its usually called `make check`.

--linas

--
You received this message because you are subscribed to the Google Groups "opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opencog+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/opencog.
To view this discussion on the web visit https://groups.google.com/d/msgid/opencog/563C5143.6040201%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hedayat Vatankhah

unread,
Nov 6, 2015, 5:12:18 AM11/6/15
to ope...@googlegroups.com
 

Linas Vepstas wrote on Fri, 6 Nov 2015 17:35:28 +0800:
I don't know about cmake, but `make test` is a standard target that almost all packages provide.  For gnu autoconf targets, its usually called `make check`.
Maybe I didn't explain well. CMake also considers it a standard target, but, by default, it creates this target itself when ENABLE_TESTING() is used so it doesn't expect us to define this target manually. What I'd like to know is if there is any problems with CMake's own test support. If current test scenario is superior to CMake's own one, we can simply tell cmake to not complain about our test target.

Regards,
Hedayat

Reply all
Reply to author
Forward
0 new messages