View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0015553 | CMake | Modules | public | 2015-05-02 09:22 | 2015-11-02 09:15 | ||||
Reporter | Thiago M. | ||||||||
Assigned To | |||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | fixed | ||||||
Platform | OS | OS Version | |||||||
Product Version | CMake 3.2.2 | ||||||||
Target Version | CMake 3.3 | Fixed in Version | CMake 3.3 | ||||||
Summary | 0015553: FindGTest.cmake doesn't handle all spaces in TEST / TEST_F macro | ||||||||
Description | The GTEST_ADD_TESTS() macro does not handle all space configurations in the test macros: - Spaces between the test suíte name and the comma: "TEST(TestSuite ,TestName)" - Spaces between the macro name and the open parenthesis: "TEST (TestSuite,TestName)" For the first one, the test is not detected. For the second one, the test name is wrongly parsed and results in errors when trying to run it. | ||||||||
Steps To Reproduce | 1. Create a test file with the following content: #include <gtest/gtest.h> TEST (TestSuite,Test1) { } TEST(TestSuite ,Test2) { } 2. Create a CMakeLists.txt that creates an executable for this test file and uses GTEST_ADD_TESTS() to create the CTest targets. An example list file in attached to this issue. 3. Configure and compile the CMake project and run the test executable. The GTest output shows the two tests are executed with success: $ ./GTestParseError Running main() from gtest_main.cc [==========] Running 2 tests from 1 test case. [----------] Global test environment set-up. [----------] 2 tests from TestSuite [ RUN ] TestSuite.Test1 [ OK ] TestSuite.Test1 (0 ms) [ RUN ] TestSuite.Test2 [ OK ] TestSuite.Test2 (0 ms) [----------] 2 tests from TestSuite (1 ms total) [----------] Global test environment tear-down [==========] 2 tests from 1 test case ran. (1 ms total) [ PASSED ] 2 tests. 4. Run CTest (with "make test", for instance). Only one test will be executed, with the wrong name, and it will fail. $ make test Running tests... Test project /home/myUser/Test-build Start 1: TEST Could not find executable ( Looked in the following places: ( ( Release/( Release/( Debug/( Debug/( MinSizeRel/( MinSizeRel/( RelWithDebInfo/( RelWithDebInfo/( Deployment/( Deployment/( Development/( Development/( Unable to find executable: ( 1/1 Test #1: TEST .............................***Not Run 0.00 sec 0% tests passed, 1 tests failed out of 1 Total Test time (real) = 0.00 sec The following tests FAILED: 1 - TEST (Not Run) Errors while running CTest Makefile:75: recipe for target 'test' failed make: *** [test] Error 8 | ||||||||
Additional Information | The GTEST_ADD_TESTS() macro already support spaces between: - The open parenthesis and the test suíte name - The test name and the close parenthesis This support was added in issue 0010065. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | CMakeLists.txt [^] (285 bytes) 2015-05-02 09:22 [Show Content]
Tests.cpp [^] (83 bytes) 2015-05-02 09:22 | ||||||||
Relationships | ||||||
|
Relationships |
Notes | |
(0038713) Brad King (manager) 2015-05-04 11:30 |
Currently FindGTest has no module maintainer: http://www.cmake.org/Wiki/CMake:Module_Maintainers [^] However, the fix seems easy enough: FindGTest: Fix parsing of test macro calls with spaces http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0f927b44 [^] |
(0039801) Robert Maynard (manager) 2015-11-02 09:15 |
Closing resolved issues that have not been updated in more than 4 months. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2015-05-02 09:22 | Thiago M. | New Issue | |
2015-05-02 09:22 | Thiago M. | File Added: CMakeLists.txt | |
2015-05-02 09:22 | Thiago M. | File Added: Tests.cpp | |
2015-05-04 10:06 | Brad King | Relationship added | related to 0010065 |
2015-05-04 11:30 | Brad King | Note Added: 0038713 | |
2015-05-04 11:30 | Brad King | Status | new => resolved |
2015-05-04 11:30 | Brad King | Resolution | open => fixed |
2015-05-04 11:30 | Brad King | Fixed in Version | => CMake 3.3 |
2015-05-04 11:30 | Brad King | Target Version | => CMake 3.3 |
2015-11-02 09:15 | Robert Maynard | Note Added: 0039801 | |
2015-11-02 09:15 | Robert Maynard | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |