MantisBT - CMake
View Issue Details
0014738CMake(No Category)public2014-02-06 08:052016-06-10 14:31
Mathieu Malaterre 
Kitware Robot 
normalminorhave not tried
closedmoved 
CMake 2.8.11.1 
 
0014738: add_test should report duplicate test
When working in large projects is happen sometimes that two tests have the same name. It would be nice if cmake would report that.
$ cat CMakeLists.txt
project(t)
enable_testing()
add_test(foobar ls)
add_test(foobar uptime)
$ cmake .
$ make test
-> uptime is used
No tags attached.
Issue History
2014-02-06 08:05Mathieu MalaterreNew Issue
2015-09-21 16:21Ruslan BaratovNote Added: 0039465
2016-06-10 14:29Kitware RobotNote Added: 0042478
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0039465)
Ruslan Baratov   
2015-09-21 16:21   
Hit same issue. CMake 3.3.2.

By the way NAME/COMMAND variant do report the duplication.

> cat CMakeLists.txt
cmake_minimum_required(VERSION 3.3.2)
project(t)
enable_testing()

add_test(NAME foobar COMMAND ls)
add_test(NAME foobar COMMAND uptime)

> rm -rf _builds && cmake -H. -B_builds
...
CMake Error at CMakeLists.txt:6 (add_test):
  add_test given test NAME "foobar" which already exists in this directory.
(0042478)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.