[Cmake-commits] CMake branch, next, updated. v2.8.3-1457-g48f7f11

Ben Boeckel ben.boeckel at kitware.com
Thu Jan 20 14:09:30 EST 2011


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  48f7f1121be292e941ab1eb4f710e23ff9ac95a6 (commit)
       via  d94f9c6487b324e7453deff15c8968acba23d98f (commit)
       via  b6c302b1aac9d903e5904febcec0902605dacee2 (commit)
       via  0594287606dad64904935901d5625b4f47d61ef6 (commit)
      from  ad4e4f64662f5387b539edde5fd09231cab1b5b4 (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=48f7f1121be292e941ab1eb4f710e23ff9ac95a6
commit 48f7f1121be292e941ab1eb4f710e23ff9ac95a6
Merge: ad4e4f6 d94f9c6
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Thu Jan 20 14:09:26 2011 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jan 20 14:09:26 2011 -0500

    Merge topic 'dev/add_test-working-directory' into next
    
    d94f9c6 Only set the property if the property was given
    b6c302b Default the working dir to the current binary dir
    0594287 Add more tests for WorkingDirectory for tests


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d94f9c6487b324e7453deff15c8968acba23d98f
commit d94f9c6487b324e7453deff15c8968acba23d98f
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Thu Jan 20 14:05:39 2011 -0500
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Thu Jan 20 14:05:39 2011 -0500

    Only set the property if the property was given

diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx
index 72a6e93..a9165f5 100644
--- a/Source/cmAddTestCommand.cxx
+++ b/Source/cmAddTestCommand.cxx
@@ -74,8 +74,7 @@ bool cmAddTestCommand::HandleNameMode(std::vector<std::string> const& args)
 {
   std::string name;
   std::vector<std::string> configurations;
-  std::string working_directory = this->Makefile->GetCurrentOutputDirectory();
-  bool working_directory_set = false;
+  std::string working_directory;
   std::vector<std::string> command;
 
   // Read the arguments.
@@ -109,13 +108,12 @@ bool cmAddTestCommand::HandleNameMode(std::vector<std::string> const& args)
       }
     else if(args[i] == "WORKING_DIRECTORY")
       {
-      if(working_directory_set)
+      if(!working_directory.empty())
         {
         this->SetError(" may be given at most one WORKING_DIRECTORY.");
         return false;
         }
       doing = DoingWorkingDirectory;
-      working_directory_set = true;
       }
     else if(doing == DoingName)
       {
@@ -172,7 +170,10 @@ bool cmAddTestCommand::HandleNameMode(std::vector<std::string> const& args)
   cmTest* test = this->Makefile->CreateTest(name.c_str());
   test->SetOldStyle(false);
   test->SetCommand(command);
-  test->SetProperty("WORKING_DIRECTORY", working_directory.c_str());
+  if(!working_directory.empty())
+    {
+    test->SetProperty("WORKING_DIRECTORY", working_directory.c_str());
+    }
   this->Makefile->AddTestGenerator(new cmTestGenerator(test, configurations));
 
   return true;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b6c302b1aac9d903e5904febcec0902605dacee2
commit b6c302b1aac9d903e5904febcec0902605dacee2
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Thu Jan 20 13:52:42 2011 -0500
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Thu Jan 20 13:52:42 2011 -0500

    Default the working dir to the current binary dir
    
    Keep backwards compatability with CMake <= 2.8.3.

diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx
index 11ca9e7..72a6e93 100644
--- a/Source/cmAddTestCommand.cxx
+++ b/Source/cmAddTestCommand.cxx
@@ -74,7 +74,8 @@ bool cmAddTestCommand::HandleNameMode(std::vector<std::string> const& args)
 {
   std::string name;
   std::vector<std::string> configurations;
-  std::string working_directory;
+  std::string working_directory = this->Makefile->GetCurrentOutputDirectory();
+  bool working_directory_set = false;
   std::vector<std::string> command;
 
   // Read the arguments.
@@ -108,12 +109,13 @@ bool cmAddTestCommand::HandleNameMode(std::vector<std::string> const& args)
       }
     else if(args[i] == "WORKING_DIRECTORY")
       {
-      if(!working_directory.empty())
+      if(working_directory_set)
         {
         this->SetError(" may be given at most one WORKING_DIRECTORY.");
         return false;
         }
       doing = DoingWorkingDirectory;
+      working_directory_set = true;
       }
     else if(doing == DoingName)
       {

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0594287606dad64904935901d5625b4f47d61ef6
commit 0594287606dad64904935901d5625b4f47d61ef6
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Thu Jan 20 13:47:53 2011 -0500
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Thu Jan 20 13:47:53 2011 -0500

    Add more tests for WorkingDirectory for tests

diff --git a/Tests/TestsWorkingDirectory/CMakeLists.txt b/Tests/TestsWorkingDirectory/CMakeLists.txt
index 0fef19d..a0fd18a 100644
--- a/Tests/TestsWorkingDirectory/CMakeLists.txt
+++ b/Tests/TestsWorkingDirectory/CMakeLists.txt
@@ -7,6 +7,8 @@ enable_testing()
 
 set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
 
+add_test(NAME WorkingDirectory0 COMMAND WorkingDirectory "${CMAKE_BINARY_DIR}")
+
 add_test(NAME WorkingDirectory1 COMMAND WorkingDirectory "${CMAKE_BINARY_DIR}")
 set_tests_properties(WorkingDirectory1 PROPERTIES
   WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
@@ -19,7 +21,7 @@ set_tests_properties(WorkingDirectory2 PROPERTIES
   WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/.."
 )
 
-get_filename_component(_default_cwd "${EXECUTABLE_OUTPUT_PATH}" PATH)
+set(_default_cwd "${CMAKE_BINARY_DIR}")
 
 # FIXME: How to deal with /debug, /release, etc. with VS or XCode?
 if(${CMAKE_GENERATOR} MATCHES "Makefiles")
@@ -36,3 +38,5 @@ add_test(NAME WorkingDirectory5 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/.. COMMAND
 if(${CMAKE_GENERATOR} MATCHES "Makefiles")
 add_test(WorkingDirectory6 ${EXECUTABLE_OUTPUT_PATH}/WorkingDirectory ${_default_cwd} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/..)
 endif()
+
+add_subdirectory(subdir)
diff --git a/Tests/TestsWorkingDirectory/subdir/CMakeLists.txt b/Tests/TestsWorkingDirectory/subdir/CMakeLists.txt
new file mode 100644
index 0000000..523f02e
--- /dev/null
+++ b/Tests/TestsWorkingDirectory/subdir/CMakeLists.txt
@@ -0,0 +1,31 @@
+add_test(NAME WorkingDirectory-Subdir0 COMMAND WorkingDirectory "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_test(NAME WorkingDirectory-Subdir1 COMMAND WorkingDirectory "${CMAKE_CURRENT_BINARY_DIR}")
+set_tests_properties(WorkingDirectory-Subdir1 PROPERTIES
+  WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+)
+
+string(REGEX REPLACE "/[^/]*$" "" _parent_dir "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_test(NAME WorkingDirectory-Subdir2 COMMAND WorkingDirectory "${_parent_dir}")
+set_tests_properties(WorkingDirectory-Subdir2 PROPERTIES
+  WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+)
+
+set(_default_cwd "${CMAKE_CURRENT_BINARY_DIR}")
+
+# FIXME: How to deal with /debug, /release, etc. with VS or XCode?
+if(${CMAKE_GENERATOR} MATCHES "Makefiles")
+add_test(WorkingDirectory-Subdir3 ${EXECUTABLE_OUTPUT_PATH}/WorkingDirectory ${_default_cwd})
+endif()
+
+add_test(NAME WorkingDirectory-Subdir4 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND WorkingDirectory ${CMAKE_CURRENT_BINARY_DIR})
+
+string(REGEX REPLACE "/[^/]*$" "" _parent_dir "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_test(NAME WorkingDirectory-Subdir5 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.. COMMAND WorkingDirectory ${_parent_dir})
+
+# FIXME: How to deal with /debug, /release, etc. with VS or XCode?
+if(${CMAKE_GENERATOR} MATCHES "Makefiles")
+add_test(WorkingDirectory-Subdir6 ${EXECUTABLE_OUTPUT_PATH}/WorkingDirectory ${_default_cwd} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/..)
+endif()

-----------------------------------------------------------------------

Summary of changes:
 Source/cmAddTestCommand.cxx                       |    5 +++-
 Tests/TestsWorkingDirectory/CMakeLists.txt        |    6 +++-
 Tests/TestsWorkingDirectory/subdir/CMakeLists.txt |   31 +++++++++++++++++++++
 3 files changed, 40 insertions(+), 2 deletions(-)
 create mode 100644 Tests/TestsWorkingDirectory/subdir/CMakeLists.txt


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list