View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011041CMakeModulespublic2010-07-27 05:432010-11-09 22:58
ReporterDroscy 
Assigned ToPhilip Lowman 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionCMake 2.8.3Fixed in VersionCMake 2.8.3 
Summary0011041: FindCxxTest doesn't look for Python or Perl, but CxxTest requires one of them (patch attached)
DescriptionFindCxxTest doesn't look for Python or Perl, but CxxTest requires one of them. The attached patch implements
- find_package(PythonInterp QUIET)
- find_package(Perl QUIET)
and set the right generator using the user preference (CXXTEST_USE_PYTHON) and the found interpreter.
TagsNo tags attached.
Attached Filespatch file icon search_python_and_perl.patch [^] (3,984 bytes) 2010-07-27 05:43 [Show Content]
patch file icon search_python_and_perl_new01.patch [^] (4,074 bytes) 2010-07-31 07:56 [Show Content]
? file icon FindCxxTest.cmake [^] (6,902 bytes) 2010-08-15 19:13

 Relationships

  Notes
(0021583)
Kovarththanan Rajaratnam (developer)
2010-07-31 02:53

Thanks for the patch. Sadly the patch isn't backwards compatible. CXXTEST_PYTHON_TESTGEN_EXECUTABLE and CXXTEST_PERL_TESTGEN_EXECUTABLE has been removed. Can you rework the patch to retain CXXTEST_PYTHON_TESTGEN_EXECUTABLE and CXXTEST_PERL_TESTGEN_EXECUTABLE?
(0021584)
Droscy (reporter)
2010-07-31 07:56

Yes, of course, you are right, I forgot that "MUST".
Attached the new patch:
- CXXTEST_PYTHON_TESTGEN_EXECUTABLE and CXXTEST_PERL_TESTGEN_EXECUTABLE are still present
- CXXTEST_TESTGEN_EXECUTABLE points to the used generator
(0021764)
Philip Lowman (developer)
2010-08-15 19:13

I've merged Droscy's patch into the attached versions and made some additional improvements.

Some additional changes...
1. I've removed the warning if CXXTEST_USE_PYTHON is set wrong. The system now automatically uses python or perl if they are the only interpreter detected. The CXXTEST_USE_PYTHON variable is only used now if both interpreters are detected.
2. The interpreter that is being used (perl | python) is used to run the script now.

Feedback and testing would be appreciated.
(0021802)
Droscy (reporter)
2010-08-18 08:24

Hi Philip,
I think that your version is not fully backward compatible because if, for some reason, a user uses Python for the macro CXXTEST_ADD_TEST but uses also CXXTEST_PERL_TESTGEN_EXECUTABLE for manually creating a test suite, this behaviour is no more possible because CXXTEST_PERL_TESTGEN_EXECUTABLE is not set.

Let me explain better, consider the following code (Python and Perl both present):
   set(CXXTEST_USE_PYTHON true)
   find_package(CxxTest)
   cxxtest_add_test(...) # python used
   add_custom_command(
      OUTPUT ${myoutput}
      COMMAND ${CXXTEST_PERL_TESTGEN_EXECUTABLE})
this will no work any more: CXXTEST_PERL_TESTGEN_EXECUTABLE is not set.

The same problem if the code is:
   find_package(CxxTest)
   cxxtest_add_test(...) # perl used
   add_custom_command(
      OUTPUT ${myoutput}
      COMMAND ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE})
because CXXTEST_PYTHON_TESTGEN_EXECUTABLE is not set.

Probably it's better to set both
  CXXTEST_PERL_TESTGEN_EXECUTABLE
  CXXTEST_PYTHON_TESTGEN_EXECUTABLE
independently from the actually used generator in the macro CXXTEST_ADD_TEST and provide, as the script already does, a variable with the used generator. So the user can let the macro choose and can also manually use the other generator.

Maybe I've misunderstood your code, am I right?
(0021817)
Philip Lowman (developer)
2010-08-18 23:17

Yeah, that thought occurred to me too, the day after I uploaded the file. I will amend the code to always set both CXXTEST_PERL_TESTGEN_EXECUTABLE & CXXTEST_PYTHON_TESTGEN_EXECUTABLE. I'll post here when the code has been checked in. Thanks for the patch and opening the ticket.
(0021855)
Philip Lowman (developer)
2010-08-19 21:47

Will be in 2.8.3

To git@cmake.org:stage/cmake.git
 * [new branch] HEAD -> FindCxxTest_11041
(0022048)
Philip Lowman (developer)
2010-09-01 00:25

Reopening to set "Target Release" / "Fixed In Version" fields
(0022049)
Philip Lowman (developer)
2010-09-01 00:27

Fix checked into cmake.git master
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ed78a72a9b3b199e2c3ae55da7e8fe37b07a65ca [^]

 Issue History
Date Modified Username Field Change
2010-07-27 05:43 Droscy New Issue
2010-07-27 05:43 Droscy File Added: search_python_and_perl.patch
2010-07-31 02:53 Kovarththanan Rajaratnam Note Added: 0021583
2010-07-31 07:56 Droscy Note Added: 0021584
2010-07-31 07:56 Droscy File Added: search_python_and_perl_new01.patch
2010-08-02 15:29 Philip Lowman Status new => assigned
2010-08-02 15:29 Philip Lowman Assigned To => Philip Lowman
2010-08-15 19:05 Philip Lowman File Added: FindCxxTest.cmake
2010-08-15 19:13 Philip Lowman Note Added: 0021764
2010-08-15 19:13 Philip Lowman File Deleted: FindCxxTest.cmake
2010-08-15 19:13 Philip Lowman File Added: FindCxxTest.cmake
2010-08-18 08:24 Droscy Note Added: 0021802
2010-08-18 23:17 Philip Lowman Note Added: 0021817
2010-08-19 21:47 Philip Lowman Note Added: 0021855
2010-08-19 21:47 Philip Lowman Status assigned => resolved
2010-08-19 21:47 Philip Lowman Resolution open => fixed
2010-09-01 00:25 Philip Lowman Note Added: 0022048
2010-09-01 00:25 Philip Lowman Status resolved => assigned
2010-09-01 00:25 Philip Lowman Target Version => CMake 2.8.3
2010-09-01 00:27 Philip Lowman Note Added: 0022049
2010-09-01 00:27 Philip Lowman Status assigned => resolved
2010-09-01 00:27 Philip Lowman Fixed in Version => CMake 2.8.3
2010-11-09 22:58 Philip Lowman Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team