summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLib/run_compile_commands.cxx8
-rw-r--r--Tests/CMakeLib/testGeneratedFileStream.cxx2
-rw-r--r--Tests/CMakeLib/testSystemTools.cxx5
-rw-r--r--Tests/CMakeLib/testUTF8.cxx2
-rw-r--r--Tests/CMakeLib/testXMLParser.cxx2
-rw-r--r--Tests/CMakeLib/testXMLSafe.cxx2
-rw-r--r--Tests/CMakeLists.txt89
-rw-r--r--Tests/CPackComponents/Issue 7470.html4
-rw-r--r--Tests/CTestLimitDashJ/CMakeLists.txt2
-rw-r--r--Tests/ExternalProjectSourceSubdir/CMakeLists.txt10
-rw-r--r--Tests/ExternalProjectSourceSubdir/Example/subdir/CMakeLists.txt2
-rw-r--r--Tests/FindPackageTest/Baz 1.3/lib/cmake/Baz/BazConfig.cmake1
-rw-r--r--Tests/FindPackageTest/Baz 1.3/lib/cmake/Baz/BazConfigVersion.cmake7
-rw-r--r--Tests/FindPackageTest/Baz 2.0/share/Baz 2/BazConfig.cmake1
-rw-r--r--Tests/FindPackageTest/Baz 2.0/share/Baz 2/BazConfigVersion.cmake7
-rw-r--r--Tests/FindPackageTest/Baz 2.1/lib/Baz 2/cmake/BazConfig.cmake1
-rw-r--r--Tests/FindPackageTest/Baz 2.1/lib/Baz 2/cmake/BazConfigVersion.cmake7
-rw-r--r--Tests/FindPackageTest/CMakeLists.txt12
-rw-r--r--Tests/QtAutogen/CMakeLists.txt4
-rw-r--r--Tests/QtAutogen/sameName/CMakeLists.txt21
-rw-r--r--Tests/QtAutogen/sameName/aaa/bbb/data.qrc6
-rw-r--r--Tests/QtAutogen/sameName/aaa/bbb/item.cpp10
-rw-r--r--Tests/QtAutogen/sameName/aaa/bbb/item.hpp18
-rw-r--r--Tests/QtAutogen/sameName/aaa/data.qrc6
-rw-r--r--Tests/QtAutogen/sameName/aaa/item.cpp8
-rw-r--r--Tests/QtAutogen/sameName/aaa/item.hpp16
-rw-r--r--Tests/QtAutogen/sameName/bbb/aaa/data.qrc6
-rw-r--r--Tests/QtAutogen/sameName/bbb/aaa/item.cpp10
-rw-r--r--Tests/QtAutogen/sameName/bbb/aaa/item.hpp18
-rw-r--r--Tests/QtAutogen/sameName/bbb/data.qrc6
-rw-r--r--Tests/QtAutogen/sameName/bbb/item.cpp8
-rw-r--r--Tests/QtAutogen/sameName/bbb/item.hpp16
-rw-r--r--Tests/QtAutogen/sameName/ccc/data.qrc6
-rw-r--r--Tests/QtAutogen/sameName/ccc/item.cpp23
-rw-r--r--Tests/QtAutogen/sameName/ccc/item.hpp16
-rw-r--r--Tests/QtAutogen/sameName/data.qrc5
-rw-r--r--Tests/QtAutogen/sameName/item.cpp5
-rw-r--r--Tests/QtAutogen/sameName/item.hpp13
-rw-r--r--Tests/QtAutogen/sameName/main.cpp16
-rw-r--r--Tests/RunCMake/CommandLine/E_capabilities-arg-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_capabilities-arg-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_capabilities-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake2
43 files changed, 349 insertions, 57 deletions
diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx
index b811c7f..502ffe7 100644
--- a/Tests/CMakeLib/run_compile_commands.cxx
+++ b/Tests/CMakeLib/run_compile_commands.cxx
@@ -1,5 +1,13 @@
#include "cmSystemTools.h"
+#include <fstream>
+#include <iostream>
+#include <map>
+#include <stdlib.h>
+#include <string>
+#include <utility>
+#include <vector>
+
class CompileCommandParser
{
public:
diff --git a/Tests/CMakeLib/testGeneratedFileStream.cxx b/Tests/CMakeLib/testGeneratedFileStream.cxx
index 67dd69a..e5a2f4d 100644
--- a/Tests/CMakeLib/testGeneratedFileStream.cxx
+++ b/Tests/CMakeLib/testGeneratedFileStream.cxx
@@ -16,7 +16,7 @@
std::cout << "FAILED: " << m1 << m2 << "\n"; \
failed = 1
-int testGeneratedFileStream(int, char* [])
+int testGeneratedFileStream(int /*unused*/, char* /*unused*/ [])
{
int failed = 0;
cmGeneratedFileStream gm;
diff --git a/Tests/CMakeLib/testSystemTools.cxx b/Tests/CMakeLib/testSystemTools.cxx
index a3846c0..8e8d4c4 100644
--- a/Tests/CMakeLib/testSystemTools.cxx
+++ b/Tests/CMakeLib/testSystemTools.cxx
@@ -11,12 +11,15 @@
============================================================================*/
#include "cmSystemTools.h"
+#include <iostream>
+#include <string>
+
#define cmPassed(m) std::cout << "Passed: " << m << "\n"
#define cmFailed(m) \
std::cout << "FAILED: " << m << "\n"; \
failed = 1
-int testSystemTools(int, char* [])
+int testSystemTools(int /*unused*/, char* /*unused*/ [])
{
int failed = 0;
// ----------------------------------------------------------------------
diff --git a/Tests/CMakeLib/testUTF8.cxx b/Tests/CMakeLib/testUTF8.cxx
index 1da23fe..019a2dd 100644
--- a/Tests/CMakeLib/testUTF8.cxx
+++ b/Tests/CMakeLib/testUTF8.cxx
@@ -97,7 +97,7 @@ static bool decode_bad(test_utf8_char const s)
return true;
}
-int testUTF8(int, char* [])
+int testUTF8(int /*unused*/, char* /*unused*/ [])
{
int result = 0;
for (test_utf8_entry const* e = good_entry; e->n; ++e) {
diff --git a/Tests/CMakeLib/testXMLParser.cxx b/Tests/CMakeLib/testXMLParser.cxx
index 1fd5113..d5e9764 100644
--- a/Tests/CMakeLib/testXMLParser.cxx
+++ b/Tests/CMakeLib/testXMLParser.cxx
@@ -4,7 +4,7 @@
#include <iostream>
-int testXMLParser(int, char* [])
+int testXMLParser(int /*unused*/, char* /*unused*/ [])
{
// TODO: Derive from parser and check attributes.
cmXMLParser parser;
diff --git a/Tests/CMakeLib/testXMLSafe.cxx b/Tests/CMakeLib/testXMLSafe.cxx
index 34c38fb..4970ccc 100644
--- a/Tests/CMakeLib/testXMLSafe.cxx
+++ b/Tests/CMakeLib/testXMLSafe.cxx
@@ -28,7 +28,7 @@ static test_pair const pairs[] = {
{ 0, 0 }
};
-int testXMLSafe(int, char* [])
+int testXMLSafe(int /*unused*/, char* /*unused*/ [])
{
int result = 0;
for (test_pair const* p = pairs; p->in; ++p) {
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 2d234db..c119cfd 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -569,60 +569,43 @@ if(BUILD_TESTING)
ADD_LINK_FLAGS_TEST(mod_flags_config dll_flags_config)
ADD_LINK_FLAGS_TEST(exe_flags_config mod_flags_config)
- # If we are running right now with a UnixMakefiles based generator,
+ # If we are running right now with a Unix Makefiles or Ninja based generator,
# build the "Simple" test with the ExtraGenerators, if available
# This doesn't test whether the generated project files work (unfortunately),
# mainly it tests that cmake doesn't crash when generating these project files.
- if(${CMAKE_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_GENERATOR} MATCHES "KDevelop")
+ if(${CMAKE_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_GENERATOR} MATCHES "Ninja")
+
# check which generators we have
execute_process(COMMAND ${CMAKE_CMAKE_COMMAND} --help
OUTPUT_VARIABLE cmakeOutput ERROR_VARIABLE cmakeOutput)
- # check for the Eclipse generator
- if ("${cmakeOutput}" MATCHES Eclipse)
- add_test(Simple_EclipseGenerator ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Simple"
- "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator"
- --build-two-config
- --build-generator "Eclipse CDT4 - Unix Makefiles"
- --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
- --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
- --build-project Simple
- --build-options ${build_options}
- --test-command Simple)
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator")
- endif ()
- # check for the CodeBlocks generator
- if ("${cmakeOutput}" MATCHES CodeBlocks)
- add_test(Simple_CodeBlocksGenerator ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Simple"
- "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator"
- --build-two-config
- --build-generator "CodeBlocks - Unix Makefiles"
- --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
- --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
- --build-project Simple
- --build-options ${build_options}
- --test-command Simple)
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator")
- endif ()
- # check for the KDevelop3 generator
- if ("${cmakeOutput}" MATCHES KDevelop3)
- add_test(Simple_KDevelop3Generator ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Simple"
- "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator"
- --build-two-config
- --build-generator "KDevelop3 - Unix Makefiles"
- --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
- --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
- --build-project Simple
- --build-options ${build_options}
- --test-command Simple)
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator")
- endif ()
+ set(extraGenerators
+ "CodeBlocks"
+ "CodeLite"
+ "Eclipse CDT4"
+ "Kate"
+ "KDevelop3"
+ "Sublime Text 2")
+
+ foreach(extraGenerator ${extraGenerators})
+ if ("${cmakeOutput}" MATCHES "${extraGenerator} - ${CMAKE_GENERATOR}")
+ set(extraGeneratorTestName "Simple_${extraGenerator}Generator")
+ string(REPLACE " " "" extraGeneratorTestName ${extraGeneratorTestName})
+
+ add_test(${extraGeneratorTestName} ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/Simple"
+ "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}"
+ --build-two-config
+ --build-generator "${extraGenerator} - ${CMAKE_GENERATOR}"
+ --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
+ --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
+ --build-project Simple
+ --build-options ${build_options}
+ --test-command Simple)
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}")
+ endif ()
+ endforeach(extraGenerator)
endif()
@@ -1464,6 +1447,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSubdir")
+ add_test(NAME ExternalProjectSourceSubdir
+ COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/ExternalProjectSourceSubdir"
+ "${CMake_BINARY_DIR}/Tests/ExternalProjectSourceSubdir"
+ ${build_generator_args}
+ --build-project ExternalProjectSourceSubdir
+ --force-new-ctest-process
+ --build-options ${build_options}
+ )
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSourceSubdir")
+
add_test(ExternalProjectLocal ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/ExternalProjectLocal"
diff --git a/Tests/CPackComponents/Issue 7470.html b/Tests/CPackComponents/Issue 7470.html
index 12df2c8..c2a1688 100644
--- a/Tests/CPackComponents/Issue 7470.html
+++ b/Tests/CPackComponents/Issue 7470.html
@@ -3,7 +3,7 @@
The install rule for this file demonstrates the problem described in<br/>
CMake issue #7470:<br/>
<br/>
-<a href="http://public.kitware.com/Bug/view.php?id=7470">
-http://public.kitware.com/Bug/view.php?id=7470</a><br/>
+<a href="https://gitlab.kitware.com/cmake/cmake/issues/7470">
+https://gitlab.kitware.com/cmake/cmake/issues/7470</a><br/>
</body>
</html>
diff --git a/Tests/CTestLimitDashJ/CMakeLists.txt b/Tests/CTestLimitDashJ/CMakeLists.txt
index 0c5950c..92d743f 100644
--- a/Tests/CTestLimitDashJ/CMakeLists.txt
+++ b/Tests/CTestLimitDashJ/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.8)
project(CTestLimitDashJ NONE)
-# This file demonstrates http://public.kitware.com/Bug/view.php?id=12904
+# This file demonstrates https://gitlab.kitware.com/cmake/cmake/issues/12904
# when configured with CMake 2.8.10.2 and earlier, and when running
# "ctest -j 4" in the resulting build tree. This example is hard-coded
# to assume -j 4 just to reproduce the issue easily. Adjust the
diff --git a/Tests/ExternalProjectSourceSubdir/CMakeLists.txt b/Tests/ExternalProjectSourceSubdir/CMakeLists.txt
new file mode 100644
index 0000000..4688acf
--- /dev/null
+++ b/Tests/ExternalProjectSourceSubdir/CMakeLists.txt
@@ -0,0 +1,10 @@
+cmake_minimum_required(VERSION 3.6)
+project(ExternalProjectSourceSubdir NONE)
+include(ExternalProject)
+
+ExternalProject_Add(Example
+ SOURCE_SUBDIR subdir
+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Example
+ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Example
+ INSTALL_COMMAND ""
+ )
diff --git a/Tests/ExternalProjectSourceSubdir/Example/subdir/CMakeLists.txt b/Tests/ExternalProjectSourceSubdir/Example/subdir/CMakeLists.txt
new file mode 100644
index 0000000..bbc3ca0
--- /dev/null
+++ b/Tests/ExternalProjectSourceSubdir/Example/subdir/CMakeLists.txt
@@ -0,0 +1,2 @@
+cmake_minimum_required(VERSION 3.0)
+project(empty)
diff --git a/Tests/FindPackageTest/Baz 1.3/lib/cmake/Baz/BazConfig.cmake b/Tests/FindPackageTest/Baz 1.3/lib/cmake/Baz/BazConfig.cmake
new file mode 100644
index 0000000..deffa57
--- /dev/null
+++ b/Tests/FindPackageTest/Baz 1.3/lib/cmake/Baz/BazConfig.cmake
@@ -0,0 +1 @@
+# Test config file.
diff --git a/Tests/FindPackageTest/Baz 1.3/lib/cmake/Baz/BazConfigVersion.cmake b/Tests/FindPackageTest/Baz 1.3/lib/cmake/Baz/BazConfigVersion.cmake
new file mode 100644
index 0000000..d8cac77
--- /dev/null
+++ b/Tests/FindPackageTest/Baz 1.3/lib/cmake/Baz/BazConfigVersion.cmake
@@ -0,0 +1,7 @@
+set(PACKAGE_VERSION 1.3)
+if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
+ set(PACKAGE_VERSION_COMPATIBLE 1)
+ if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 3)
+ set(PACKAGE_VERSION_EXACT 1)
+ endif()
+endif()
diff --git a/Tests/FindPackageTest/Baz 2.0/share/Baz 2/BazConfig.cmake b/Tests/FindPackageTest/Baz 2.0/share/Baz 2/BazConfig.cmake
new file mode 100644
index 0000000..deffa57
--- /dev/null
+++ b/Tests/FindPackageTest/Baz 2.0/share/Baz 2/BazConfig.cmake
@@ -0,0 +1 @@
+# Test config file.
diff --git a/Tests/FindPackageTest/Baz 2.0/share/Baz 2/BazConfigVersion.cmake b/Tests/FindPackageTest/Baz 2.0/share/Baz 2/BazConfigVersion.cmake
new file mode 100644
index 0000000..5026fad
--- /dev/null
+++ b/Tests/FindPackageTest/Baz 2.0/share/Baz 2/BazConfigVersion.cmake
@@ -0,0 +1,7 @@
+set(PACKAGE_VERSION 2.0)
+if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2)
+ set(PACKAGE_VERSION_COMPATIBLE 1)
+ if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0)
+ set(PACKAGE_VERSION_EXACT 1)
+ endif()
+endif()
diff --git a/Tests/FindPackageTest/Baz 2.1/lib/Baz 2/cmake/BazConfig.cmake b/Tests/FindPackageTest/Baz 2.1/lib/Baz 2/cmake/BazConfig.cmake
new file mode 100644
index 0000000..deffa57
--- /dev/null
+++ b/Tests/FindPackageTest/Baz 2.1/lib/Baz 2/cmake/BazConfig.cmake
@@ -0,0 +1 @@
+# Test config file.
diff --git a/Tests/FindPackageTest/Baz 2.1/lib/Baz 2/cmake/BazConfigVersion.cmake b/Tests/FindPackageTest/Baz 2.1/lib/Baz 2/cmake/BazConfigVersion.cmake
new file mode 100644
index 0000000..a180143
--- /dev/null
+++ b/Tests/FindPackageTest/Baz 2.1/lib/Baz 2/cmake/BazConfigVersion.cmake
@@ -0,0 +1,7 @@
+set(PACKAGE_VERSION 2.1)
+if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2)
+ set(PACKAGE_VERSION_COMPATIBLE 1)
+ if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
+ set(PACKAGE_VERSION_EXACT 1)
+ endif()
+endif()
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index d3e68bc..04bbbc6 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -102,6 +102,7 @@ endif()
set(PACKAGES
foo Foo Bar Blub TFramework Tframework TApp Tapp Special
VersionedA VersionedB VersionedC VersionedD VersionedE
+ VersionedF VersionedG VersionedH
WrongA WrongB WrongC WrongD
wibbleA wibbleB
RecursiveA RecursiveB RecursiveC
@@ -142,6 +143,10 @@ find_package(VersionedB 3.1 EXACT NAMES zot)
find_package(VersionedC 4.0 EXACT NAMES zot)
find_package(VersionedD 1.1 EXACT NAMES Baz)
find_package(VersionedE 1.2 EXACT NAMES Baz)
+find_package(VersionedF 1.3 EXACT NAMES Baz)
+find_package(VersionedG 2.0 EXACT NAMES Baz)
+find_package(VersionedH 2.1 EXACT NAMES Baz)
+
# Test Config files which set Xyz_FOUND themselves:
find_package(SetFoundTRUE NO_MODULE)
@@ -158,12 +163,12 @@ find_package(WrongB 1.2 EXACT NAMES Baz)
# Test wrong initial path when result is missing.
set(WrongC_DIR "${VersionedD_DIR}")
-find_package(WrongC 1.3 EXACT QUIET NAMES Baz)
+find_package(WrongC 1.4 EXACT QUIET NAMES Baz)
# Test wrong initial cache entry of UNINITIALIZED type when result is missing.
set(WrongD_DIR "${VersionedD_DIR}" CACHE UNINITIALIZED "Wrong Value" FORCE)
get_property(type CACHE WrongD_DIR PROPERTY TYPE)
-find_package(WrongD 1.3 EXACT QUIET NAMES Baz)
+find_package(WrongD 1.4 EXACT QUIET NAMES Baz)
# HINTS should override the system but PATHS should not
list(INSERT CMAKE_SYSTEM_PREFIX_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/A")
@@ -216,6 +221,9 @@ set(VersionedB_EXPECTED "lib/zot-3.1/zot-config.cmake")
set(VersionedC_EXPECTED "lib/cmake/zot-4.0/zot-config.cmake")
set(VersionedD_EXPECTED "Baz 1.1/BazConfig.cmake")
set(VersionedE_EXPECTED "Baz 1.2/CMake/BazConfig.cmake")
+set(VersionedF_EXPECTED "Baz 1.3/lib/cmake/Baz/BazConfig.cmake")
+set(VersionedG_EXPECTED "Baz 2.0/share/Baz 2/BazConfig.cmake")
+set(VersionedH_EXPECTED "Baz 2.1/lib/Baz 2/cmake/BazConfig.cmake")
set(WrongA_EXPECTED "${VersionedE_EXPECTED}")
set(WrongB_EXPECTED "${VersionedE_EXPECTED}")
set(WrongC_MISSING "WrongC_DIR-NOTFOUND")
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index d5aca55..e35e1d1 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -110,6 +110,10 @@ set_target_properties(
AUTOMOC TRUE
)
+# Test AUTOMOC and AUTORCC on source files with the same name
+# but in different subdirectories
+add_subdirectory(sameName)
+
include(GenerateExportHeader)
# The order is relevant here. B depends on A, and B headers depend on A
# headers both subdirectories use CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE and we
diff --git a/Tests/QtAutogen/sameName/CMakeLists.txt b/Tests/QtAutogen/sameName/CMakeLists.txt
new file mode 100644
index 0000000..ed045fb
--- /dev/null
+++ b/Tests/QtAutogen/sameName/CMakeLists.txt
@@ -0,0 +1,21 @@
+# Test AUTOMOC and AUTORCC on source files with the same name
+# but in different subdirectories
+
+add_executable(sameName
+ aaa/bbb/item.cpp
+ aaa/bbb/data.qrc
+ aaa/item.cpp
+ aaa/data.qrc
+ bbb/aaa/item.cpp
+ bbb/aaa/data.qrc
+ bbb/item.cpp
+ bbb/data.qrc
+ ccc/item.cpp
+ ccc/data.qrc
+ item.cpp
+ data.qrc
+ main.cpp
+)
+target_include_directories(sameName PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+target_link_libraries(sameName ${QT_LIBRARIES})
+set_target_properties( sameName PROPERTIES AUTOMOC TRUE AUTORCC TRUE )
diff --git a/Tests/QtAutogen/sameName/aaa/bbb/data.qrc b/Tests/QtAutogen/sameName/aaa/bbb/data.qrc
new file mode 100644
index 0000000..0ea3537
--- /dev/null
+++ b/Tests/QtAutogen/sameName/aaa/bbb/data.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="aaa/bbb">
+ <file>item.hpp</file>
+ <file>item.cpp</file>
+</qresource>
+</RCC>
diff --git a/Tests/QtAutogen/sameName/aaa/bbb/item.cpp b/Tests/QtAutogen/sameName/aaa/bbb/item.cpp
new file mode 100644
index 0000000..20d0044
--- /dev/null
+++ b/Tests/QtAutogen/sameName/aaa/bbb/item.cpp
@@ -0,0 +1,10 @@
+#include "item.hpp"
+
+namespace aaa {
+namespace bbb {
+
+void Item::go()
+{
+}
+}
+}
diff --git a/Tests/QtAutogen/sameName/aaa/bbb/item.hpp b/Tests/QtAutogen/sameName/aaa/bbb/item.hpp
new file mode 100644
index 0000000..0855043
--- /dev/null
+++ b/Tests/QtAutogen/sameName/aaa/bbb/item.hpp
@@ -0,0 +1,18 @@
+#ifndef AAA_BBB_ITEM_HPP
+#define AAA_BBB_ITEM_HPP
+
+#include <QObject>
+
+namespace aaa {
+namespace bbb {
+
+class Item : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go();
+};
+}
+}
+
+#endif
diff --git a/Tests/QtAutogen/sameName/aaa/data.qrc b/Tests/QtAutogen/sameName/aaa/data.qrc
new file mode 100644
index 0000000..379af60
--- /dev/null
+++ b/Tests/QtAutogen/sameName/aaa/data.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="aaa/">
+ <file>item.hpp</file>
+ <file>item.cpp</file>
+</qresource>
+</RCC>
diff --git a/Tests/QtAutogen/sameName/aaa/item.cpp b/Tests/QtAutogen/sameName/aaa/item.cpp
new file mode 100644
index 0000000..95dd3b6
--- /dev/null
+++ b/Tests/QtAutogen/sameName/aaa/item.cpp
@@ -0,0 +1,8 @@
+#include "item.hpp"
+
+namespace aaa {
+
+void Item::go()
+{
+}
+}
diff --git a/Tests/QtAutogen/sameName/aaa/item.hpp b/Tests/QtAutogen/sameName/aaa/item.hpp
new file mode 100644
index 0000000..b63466f
--- /dev/null
+++ b/Tests/QtAutogen/sameName/aaa/item.hpp
@@ -0,0 +1,16 @@
+#ifndef AAA_ITEM_HPP
+#define AAA_ITEM_HPP
+
+#include <QObject>
+
+namespace aaa {
+
+class Item : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go();
+};
+}
+
+#endif
diff --git a/Tests/QtAutogen/sameName/bbb/aaa/data.qrc b/Tests/QtAutogen/sameName/bbb/aaa/data.qrc
new file mode 100644
index 0000000..da98009
--- /dev/null
+++ b/Tests/QtAutogen/sameName/bbb/aaa/data.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="bbb/aaa/">
+ <file>item.hpp</file>
+ <file>item.cpp</file>
+</qresource>
+</RCC>
diff --git a/Tests/QtAutogen/sameName/bbb/aaa/item.cpp b/Tests/QtAutogen/sameName/bbb/aaa/item.cpp
new file mode 100644
index 0000000..ac4b2c2
--- /dev/null
+++ b/Tests/QtAutogen/sameName/bbb/aaa/item.cpp
@@ -0,0 +1,10 @@
+#include "item.hpp"
+
+namespace bbb {
+namespace aaa {
+
+void Item::go()
+{
+}
+}
+}
diff --git a/Tests/QtAutogen/sameName/bbb/aaa/item.hpp b/Tests/QtAutogen/sameName/bbb/aaa/item.hpp
new file mode 100644
index 0000000..be07ca8
--- /dev/null
+++ b/Tests/QtAutogen/sameName/bbb/aaa/item.hpp
@@ -0,0 +1,18 @@
+#ifndef BBB_AAA_ITEM_HPP
+#define BBB_AAA_ITEM_HPP
+
+#include <QObject>
+
+namespace bbb {
+namespace aaa {
+
+class Item : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go();
+};
+}
+}
+
+#endif
diff --git a/Tests/QtAutogen/sameName/bbb/data.qrc b/Tests/QtAutogen/sameName/bbb/data.qrc
new file mode 100644
index 0000000..5b080f5
--- /dev/null
+++ b/Tests/QtAutogen/sameName/bbb/data.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="bbb/">
+ <file>item.hpp</file>
+ <file>item.cpp</file>
+</qresource>
+</RCC>
diff --git a/Tests/QtAutogen/sameName/bbb/item.cpp b/Tests/QtAutogen/sameName/bbb/item.cpp
new file mode 100644
index 0000000..f97a143
--- /dev/null
+++ b/Tests/QtAutogen/sameName/bbb/item.cpp
@@ -0,0 +1,8 @@
+#include "item.hpp"
+
+namespace bbb {
+
+void Item::go()
+{
+}
+}
diff --git a/Tests/QtAutogen/sameName/bbb/item.hpp b/Tests/QtAutogen/sameName/bbb/item.hpp
new file mode 100644
index 0000000..5b7f985
--- /dev/null
+++ b/Tests/QtAutogen/sameName/bbb/item.hpp
@@ -0,0 +1,16 @@
+#ifndef BBB_ITEM_HPP
+#define BBB_ITEM_HPP
+
+#include <QObject>
+
+namespace bbb {
+
+class Item : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go();
+};
+}
+
+#endif
diff --git a/Tests/QtAutogen/sameName/ccc/data.qrc b/Tests/QtAutogen/sameName/ccc/data.qrc
new file mode 100644
index 0000000..f934c39
--- /dev/null
+++ b/Tests/QtAutogen/sameName/ccc/data.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="ccc/">
+ <file>item.hpp</file>
+ <file>item.cpp</file>
+</qresource>
+</RCC>
diff --git a/Tests/QtAutogen/sameName/ccc/item.cpp b/Tests/QtAutogen/sameName/ccc/item.cpp
new file mode 100644
index 0000000..d90b2b8
--- /dev/null
+++ b/Tests/QtAutogen/sameName/ccc/item.cpp
@@ -0,0 +1,23 @@
+#include "item.hpp"
+
+namespace ccc {
+
+void Item::go()
+{
+}
+
+class MocTest : public QObject
+{
+ Q_OBJECT;
+ Q_SLOT
+ void go();
+};
+
+void MocTest::go()
+{
+}
+}
+
+// Include own moc files
+#include "item.moc"
+#include "moc_item.cpp"
diff --git a/Tests/QtAutogen/sameName/ccc/item.hpp b/Tests/QtAutogen/sameName/ccc/item.hpp
new file mode 100644
index 0000000..96fcc24
--- /dev/null
+++ b/Tests/QtAutogen/sameName/ccc/item.hpp
@@ -0,0 +1,16 @@
+#ifndef CCC_ITEM_HPP
+#define CCC_ITEM_HPP
+
+#include <QObject>
+
+namespace ccc {
+
+class Item : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go();
+};
+}
+
+#endif
diff --git a/Tests/QtAutogen/sameName/data.qrc b/Tests/QtAutogen/sameName/data.qrc
new file mode 100644
index 0000000..4ce0b4e
--- /dev/null
+++ b/Tests/QtAutogen/sameName/data.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>main.cpp</file>
+</qresource>
+</RCC>
diff --git a/Tests/QtAutogen/sameName/item.cpp b/Tests/QtAutogen/sameName/item.cpp
new file mode 100644
index 0000000..e013cf3
--- /dev/null
+++ b/Tests/QtAutogen/sameName/item.cpp
@@ -0,0 +1,5 @@
+#include "item.hpp"
+
+void Item::go()
+{
+}
diff --git a/Tests/QtAutogen/sameName/item.hpp b/Tests/QtAutogen/sameName/item.hpp
new file mode 100644
index 0000000..91bba3b
--- /dev/null
+++ b/Tests/QtAutogen/sameName/item.hpp
@@ -0,0 +1,13 @@
+#ifndef ITEM_HPP
+#define ITEM_HPP
+
+#include <QObject>
+
+class Item : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go();
+};
+
+#endif
diff --git a/Tests/QtAutogen/sameName/main.cpp b/Tests/QtAutogen/sameName/main.cpp
new file mode 100644
index 0000000..a4ffcb3
--- /dev/null
+++ b/Tests/QtAutogen/sameName/main.cpp
@@ -0,0 +1,16 @@
+#include "aaa/bbb/item.hpp"
+#include "aaa/item.hpp"
+#include "bbb/aaa/item.hpp"
+#include "bbb/item.hpp"
+#include "ccc/item.hpp"
+
+int main(int argv, char** args)
+{
+ // Object instances
+ ::aaa::Item aaa_item;
+ ::aaa::bbb::Item aaa_bbb_item;
+ ::bbb::Item bbb_item;
+ ::bbb::aaa::Item bbb_aaa_item;
+ ::ccc::Item ccc_item;
+ return 0;
+}
diff --git a/Tests/RunCMake/CommandLine/E_capabilities-arg-result.txt b/Tests/RunCMake/CommandLine/E_capabilities-arg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_capabilities-arg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_capabilities-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_capabilities-arg-stderr.txt
new file mode 100644
index 0000000..f74cebe
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_capabilities-arg-stderr.txt
@@ -0,0 +1 @@
+^-E capabilities accepts no additional arguments$
diff --git a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
new file mode 100644
index 0000000..6c5ea44
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
@@ -0,0 +1 @@
+^{.*}$
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 077a19d..6ae47a8 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -8,6 +8,8 @@ run_cmake_command(lists-no-file ${CMAKE_COMMAND} nosuchsubdir/CMakeLists.txt)
run_cmake_command(D-no-arg ${CMAKE_COMMAND} -D)
run_cmake_command(U-no-arg ${CMAKE_COMMAND} -U)
run_cmake_command(E-no-arg ${CMAKE_COMMAND} -E)
+run_cmake_command(E_capabilities ${CMAKE_COMMAND} -E capabilities)
+run_cmake_command(E_capabilities-arg ${CMAKE_COMMAND} -E capabilities --extra-arg)
run_cmake_command(E_echo_append ${CMAKE_COMMAND} -E echo_append)
run_cmake_command(E_rename-no-arg ${CMAKE_COMMAND} -E rename)
run_cmake_command(E_touch_nocreate-no-arg ${CMAKE_COMMAND} -E touch_nocreate)