[Cmake-commits] CMake branch, next, updated. v3.5.1-955-gca24bb4
Jean-Christophe Fillion-Robin
jchris.fillionr at kitware.com
Fri Apr 15 12:07:01 EDT 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via ca24bb4eff3c972fdb38ef8958264a987b592284 (commit)
via 78077d705000986decbd0282014c09b214461d45 (commit)
via 7df92ec78dc22692f89a12ad6feec4e193c7edaa (commit)
from 46007cb42fda49cbdf012ed35c728749c1f27a1b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca24bb4eff3c972fdb38ef8958264a987b592284
commit ca24bb4eff3c972fdb38ef8958264a987b592284
Merge: 46007cb 78077d7
Author: Jean-Christophe Fillion-Robin <jchris.fillionr at kitware.com>
AuthorDate: Fri Apr 15 12:07:00 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Apr 15 12:07:00 2016 -0400
Merge topic 'fix-addtest-and-crosscompiling-emulator-to-work-globally' into next
78077d70 TestGenerator: Fix CROSSCOMPILING_EMULATOR support.
7df92ec7 TestGenerator: Extend crosscompiling emulator test case
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=78077d705000986decbd0282014c09b214461d45
commit 78077d705000986decbd0282014c09b214461d45
Author: Jean-Christophe Fillion-Robin <jchris.fillionr at kitware.com>
AuthorDate: Thu Apr 14 14:17:10 2016 -0400
Commit: Jean-Christophe Fillion-Robin <jchris.fillionr at kitware.com>
CommitDate: Thu Apr 14 14:17:10 2016 -0400
TestGenerator: Fix CROSSCOMPILING_EMULATOR support.
Improve support originally added in 9160d6c by ensuring test commands are
now consistently prefixed with the CROSSCOMPILING_EMULATOR property for
target executables.
diff --git a/Help/release/dev/fix-CROSSCOMPILING_EMULATOR-TestGenerator-support.rst b/Help/release/dev/fix-CROSSCOMPILING_EMULATOR-TestGenerator-support.rst
new file mode 100644
index 0000000..5be2e27
--- /dev/null
+++ b/Help/release/dev/fix-CROSSCOMPILING_EMULATOR-TestGenerator-support.rst
@@ -0,0 +1,6 @@
+Fix CROSSCOMPILING_EMULATOR TestGenerator support
+-------------------------------------------------
+
+If specified, emulator is now consistently added as a prefix
+to :command:`add_test` test commands for built target system
+executables. It works for tests added in a parent directory.
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index b411f15..152d48a 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -83,6 +83,8 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
// Get the test command line to be executed.
std::vector<std::string> const& command = this->Test->GetCommand();
+ const char * emulator = 0;
+
// Check whether the command executable is a target whose name is to
// be translated.
std::string exe = command[0];
@@ -93,30 +95,45 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
// Use the target file on disk.
exe = target->GetFullPath(config);
- // Prepend with the emulator when cross compiling if required.
- const char * emulator =
- target->GetProperty("CROSSCOMPILING_EMULATOR");
- if (emulator != 0)
+ // Lookup emulator
+ emulator = target->GetProperty("CROSSCOMPILING_EMULATOR");
+ }
+ else
+ {
+ // Use the command name given.
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(exe.c_str());
+ exe = cge->Evaluate(this->LG, config);
+ cmSystemTools::ConvertToUnixSlashes(exe);
+
+ // Lookup emulator
+ for(std::set<cmGeneratorTarget*>::const_iterator ci =
+ cge->GetTargets().begin();
+ ci != cge->GetTargets().end(); ++ci)
{
- std::vector<std::string> emulatorWithArgs;
- cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs);
- std::string emulatorExe(emulatorWithArgs[0]);
- cmSystemTools::ConvertToUnixSlashes(emulatorExe);
- os << cmOutputConverter::EscapeForCMake(emulatorExe) << " ";
- for(std::vector<std::string>::const_iterator ei =
- emulatorWithArgs.begin()+1;
- ei != emulatorWithArgs.end();
- ++ei)
+ target = (*ci);
+ emulator = target->GetProperty("CROSSCOMPILING_EMULATOR");
+ if (emulator != 0)
{
- os << cmOutputConverter::EscapeForCMake(*ei) << " ";
+ break;
}
}
}
- else
+
+ // Prepend with the emulator when cross compiling if required.
+ if (emulator != 0)
{
- // Use the command name given.
- exe = ge.Parse(exe.c_str())->Evaluate(this->LG, config);
- cmSystemTools::ConvertToUnixSlashes(exe);
+ std::vector<std::string> emulatorWithArgs;
+ cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs);
+ std::string emulatorExe(emulatorWithArgs[0]);
+ cmSystemTools::ConvertToUnixSlashes(emulatorExe);
+ os << cmOutputConverter::EscapeForCMake(emulatorExe) << " ";
+ for(std::vector<std::string>::const_iterator ei =
+ emulatorWithArgs.begin()+1;
+ ei != emulatorWithArgs.end();
+ ++ei)
+ {
+ os << cmOutputConverter::EscapeForCMake(*ei) << " ";
+ }
}
// Generate the command line with full escapes.
diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake
index 2dd6e85..750fcbf 100644
--- a/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake
+++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake
@@ -14,3 +14,6 @@ endif()
if(NOT testfile_contents MATCHES "add_test[(]UsesEmulatorWithExecTargetFromSubdirAddedWithoutGenex .+pseudo_emulator.+$")
message(SEND_ERROR "Did not use emulator when it should be used. ${error_details}")
endif()
+if(NOT testfile_contents MATCHES "add_test[(]UsesEmulatorWithExecTargetFromSubdirAddedWithGenex .+pseudo_emulator.+$")
+ message(SEND_ERROR "Did not use emulator when it should be used. ${error_details}")
+endif()
diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake
index b6eacf1..53a8544 100644
--- a/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake
+++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake
@@ -11,3 +11,6 @@ add_subdirectory(AddTest)
add_test(NAME UsesEmulatorWithExecTargetFromSubdirAddedWithoutGenex
COMMAND generated_exe_in_subdir_added_to_test_without_genex)
+
+add_test(NAME UsesEmulatorWithExecTargetFromSubdirAddedWithGenex
+ COMMAND $<TARGET_FILE:generated_exe_in_subdir_added_to_test_with_genex>)
diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest/CMakeLists.txt b/Tests/RunCMake/CrosscompilingEmulator/AddTest/CMakeLists.txt
index a10a694..f3d11d5 100644
--- a/Tests/RunCMake/CrosscompilingEmulator/AddTest/CMakeLists.txt
+++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest/CMakeLists.txt
@@ -1 +1,3 @@
add_executable(generated_exe_in_subdir_added_to_test_without_genex ${CMAKE_CURRENT_SOURCE_DIR}/../simple_src.cxx)
+
+add_executable(generated_exe_in_subdir_added_to_test_with_genex ${CMAKE_CURRENT_SOURCE_DIR}/../simple_src.cxx)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7df92ec78dc22692f89a12ad6feec4e193c7edaa
commit 7df92ec78dc22692f89a12ad6feec4e193c7edaa
Author: Jean-Christophe Fillion-Robin <jchris.fillionr at kitware.com>
AuthorDate: Thu Apr 14 13:21:15 2016 -0400
Commit: Jean-Christophe Fillion-Robin <jchris.fillionr at kitware.com>
CommitDate: Thu Apr 14 13:21:15 2016 -0400
TestGenerator: Extend crosscompiling emulator test case
diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake
index 0aae06c..2dd6e85 100644
--- a/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake
+++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake
@@ -4,9 +4,13 @@ if(EXISTS "${testfile}")
else()
message(FATAL_ERROR "Could not find expected CTestTestfile.cmake.")
endif()
+set(error_details "There is a problem with generated test file: ${testfile}")
if(testfile_contents MATCHES "add_test[(]DoesNotUseEmulator ^(pseudo_emulator)+$")
- message(SEND_ERROR "Used emulator when it should not be used.")
+ message(SEND_ERROR "Used emulator when it should not be used. ${error_details}")
endif()
if(NOT testfile_contents MATCHES "add_test[(]UsesEmulator .+pseudo_emulator.+$")
- message(SEND_ERROR "Did not use emulator when it should be used.")
+ message(SEND_ERROR "Did not use emulator when it should be used. ${error_details}")
+endif()
+if(NOT testfile_contents MATCHES "add_test[(]UsesEmulatorWithExecTargetFromSubdirAddedWithoutGenex .+pseudo_emulator.+$")
+ message(SEND_ERROR "Did not use emulator when it should be used. ${error_details}")
endif()
diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake
index 41850f2..b6eacf1 100644
--- a/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake
+++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake
@@ -6,3 +6,8 @@ add_test(NAME DoesNotUseEmulator
add_executable(generated_exe simple_src.cxx)
add_test(NAME UsesEmulator
COMMAND generated_exe)
+
+add_subdirectory(AddTest)
+
+add_test(NAME UsesEmulatorWithExecTargetFromSubdirAddedWithoutGenex
+ COMMAND generated_exe_in_subdir_added_to_test_without_genex)
diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest/CMakeLists.txt b/Tests/RunCMake/CrosscompilingEmulator/AddTest/CMakeLists.txt
new file mode 100644
index 0000000..a10a694
--- /dev/null
+++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest/CMakeLists.txt
@@ -0,0 +1 @@
+add_executable(generated_exe_in_subdir_added_to_test_without_genex ${CMAKE_CURRENT_SOURCE_DIR}/../simple_src.cxx)
-----------------------------------------------------------------------
Summary of changes:
...OSSCOMPILING_EMULATOR-TestGenerator-support.rst | 6 +++
Source/cmTestGenerator.cxx | 53 +++++++++++++-------
.../CrosscompilingEmulator/AddTest-check.cmake | 11 +++-
.../RunCMake/CrosscompilingEmulator/AddTest.cmake | 8 +++
.../CrosscompilingEmulator/AddTest/CMakeLists.txt | 3 ++
5 files changed, 61 insertions(+), 20 deletions(-)
create mode 100644 Help/release/dev/fix-CROSSCOMPILING_EMULATOR-TestGenerator-support.rst
create mode 100644 Tests/RunCMake/CrosscompilingEmulator/AddTest/CMakeLists.txt
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list