View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014913CMakeModulespublic2014-05-12 12:082014-11-03 08:38
Reportertrsystran 
Assigned ToRolf Eike Beer 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 2.8.8 
Target VersionCMake 3.1Fixed in VersionCMake 3.1 
Summary0014913: GTEST_ADD_TESTS doesn't use new signature ADD_TEST(NAME name COMMAND command): generated executable is then not found
DescriptionGTEST_ADD_TESTS doesn't use new signature ADD_TEST(NAME name COMMAND command):
From 2.8.8 (and today's git master) FindGTest.cmake:

add_test(${test_name} ${executable} --gtest_filter=${test_name} ${extra_args})

generated executable is then not found:
Test project /home/.....
    Start 1: AUnitTest.Base
Could not find executable AUnitTest
Looked in the following places:
AUnitTest
AUnitTest
Release/AUnitTest
Release/AUnitTest
Debug/AUnitTest
Debug/AUnitTest
MinSizeRel/AUnitTest
MinSizeRel/AUnitTest
RelWithDebInfo/AUnitTest
RelWithDebInfo/AUnitTest
Deployment/AUnitTest
Deployment/AUnitTest
Development/AUnitTest
Development/AUnitTest
Unable to find executable: AUnitTest
1/4 Test #1: AUnitTest.Base ..............***Not Run 0.00 sec
Steps To ReproduceCMakeLists.txt:

set(AUnitTestSources
  Test.cc
  )

create_executable(AUnitTest
  ${AUnitTestSources}
  )

target_link_libraries(AUnitTest
  ${GTEST_BOTH_LIBRARIES}
  )

set(AUnitTestArgs "")
gtest_add_tests(AUnitTest
  "${AUnitTestArgs}"
  ${AUnitTestSources}
  )

Shell:
ctest -R "AUnitTest*"

Output:
"Could not find executable AUnitTest"
Additional InformationUsing the old signature for add_test is the cause of the binary not found, see bugs 14766, 12033, 8139.

By replacing the invocation of add_test by the following, it works:
add_test(NAME ${test_name} COMMAND ${executable} --gtest_filter=${test_name} ${extra_args})
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0035851)
Rolf Eike Beer (developer)
2014-05-12 12:23

Fix merged to next: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=293bcf7a6059af2293ee4d3f0509fcaf1eb66f72 [^]
(0037136)
Robert Maynard (manager)
2014-11-03 08:38

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2014-05-12 12:08 trsystran New Issue
2014-05-12 12:23 Rolf Eike Beer Note Added: 0035851
2014-05-12 12:23 Rolf Eike Beer Assigned To => Rolf Eike Beer
2014-05-12 12:23 Rolf Eike Beer Status new => resolved
2014-05-12 12:23 Rolf Eike Beer Resolution open => fixed
2014-05-12 12:23 Rolf Eike Beer OS Linux =>
2014-05-12 12:23 Rolf Eike Beer OS Version Ubuntu 10.04 =>
2014-05-12 12:23 Rolf Eike Beer Platform Intel =>
2014-05-12 12:23 Rolf Eike Beer Fixed in Version => CMake 3.1
2014-05-12 12:23 Rolf Eike Beer Target Version => CMake 3.1
2014-11-03 08:38 Robert Maynard Note Added: 0037136
2014-11-03 08:38 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team