[Cmake-commits] CMake branch, next, updated. v2.8.9-880-ge38ce9e
Rolf Eike Beer
eike at sf-mail.de
Sat Sep 29 16:38:06 EDT 2012
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 e38ce9ed0f40a96125c7c07e73984f3ddbf51da7 (commit)
via 76247aeef5da0e8c723c50e0d9d47de6b241bf9e (commit)
via 87779df23acf0e3caafcf8cec8342460deb54ec0 (commit)
from 587a6f14e94a4a66bcab7f0fda6f838e27b43b34 (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=e38ce9ed0f40a96125c7c07e73984f3ddbf51da7
commit e38ce9ed0f40a96125c7c07e73984f3ddbf51da7
Merge: 587a6f1 76247ae
Author: Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Sat Sep 29 16:37:56 2012 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Sep 29 16:37:56 2012 -0400
Merge topic 'start-contributing-irc-session' into next
76247ae Add test to secure the file(GLOB empty) behavior.
87779df file: remove dead code
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=76247aeef5da0e8c723c50e0d9d47de6b241bf9e
commit 76247aeef5da0e8c723c50e0d9d47de6b241bf9e
Author: Amine Chadly <amine.chadly at gmail.com>
AuthorDate: Sat Sep 29 20:27:21 2012 +0200
Commit: Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Sat Sep 29 22:36:42 2012 +0200
Add test to secure the file(GLOB empty) behavior.
diff --git a/Tests/CMakeTests/FileTest.cmake.in b/Tests/CMakeTests/FileTest.cmake.in
index 700f40b..960d3c1 100644
--- a/Tests/CMakeTests/FileTest.cmake.in
+++ b/Tests/CMakeTests/FileTest.cmake.in
@@ -60,6 +60,11 @@ check_cmake_test(File
SHA512-Works
)
+file(GLOB hum)
+if (NOT hum STREQUAL "")
+ message(FATAL_ERROR "file(GLOB hum) did not return an empty string.")
+endif()
+
# Also execute each test listed in FileTestScript.cmake:
#
set(scriptname "@CMAKE_CURRENT_SOURCE_DIR@/FileTestScript.cmake")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=87779df23acf0e3caafcf8cec8342460deb54ec0
commit 87779df23acf0e3caafcf8cec8342460deb54ec0
Author: Amine Chadly <amine.chadly at gmail.com>
AuthorDate: Sat Sep 29 19:33:39 2012 +0200
Commit: Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Sat Sep 29 22:36:24 2012 +0200
file: remove dead code
The file command requires at least two arguments, so guarding the GLOB and
MAKE_DIRECTORY command is not necessary. Changed it for an assert to keep the
protection.
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 8de24b3..b877f3c 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -22,6 +22,7 @@
#endif
#undef GetCurrentDirectory
+#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -705,11 +706,8 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
bool recurse)
{
- if ( args.size() < 2 )
- {
- this->SetError("GLOB requires at least a variable name");
- return false;
- }
+ // File commands has at least one argument
+ assert(args.size() > 1);
std::vector<std::string>::const_iterator i = args.begin();
@@ -843,11 +841,8 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
bool cmFileCommand::HandleMakeDirectoryCommand(
std::vector<std::string> const& args)
{
- if(args.size() < 2 )
- {
- this->SetError("called with incorrect number of arguments");
- return false;
- }
+ // File command has at least one argument
+ assert(args.size() > 1);
std::vector<std::string>::const_iterator i = args.begin();
diff --git a/Tests/CMakeTests/File-Glob-NoArg.cmake b/Tests/CMakeTests/File-Glob-NoArg.cmake
new file mode 100644
index 0000000..486f366
--- /dev/null
+++ b/Tests/CMakeTests/File-Glob-NoArg.cmake
@@ -0,0 +1,2 @@
+# Checking that the call without arguments get caught by the file global protection.
+file(GLOB)
diff --git a/Tests/CMakeTests/FileTest.cmake.in b/Tests/CMakeTests/FileTest.cmake.in
index 3c3d85d..700f40b 100644
--- a/Tests/CMakeTests/FileTest.cmake.in
+++ b/Tests/CMakeTests/FileTest.cmake.in
@@ -12,6 +12,10 @@ set(Copy-NoDest-RESULT 1)
set(Copy-NoDest-STDERR "given no DESTINATION")
set(Copy-NoFile-RESULT 1)
set(Copy-NoFile-STDERR "COPY cannot find.*/does_not_exist\\.txt")
+set(Glob-NoArg-RESULT 1)
+set(Glob-NoArg-STDERR "file must be called with at least two arguments")
+set(Make_Directory-NoArg-RESULT 1)
+set(Make-Directory-NoArg-STDERR "file must be called with at least two arguments")
set(MD5-NoFile-RESULT 1)
set(MD5-NoFile-STDERR "file MD5 failed to read file")
set(MD5-BadArg1-RESULT 1)
@@ -42,6 +46,8 @@ check_cmake_test(File
Copy-LateArg
Copy-NoDest
Copy-NoFile
+ Glob-NoArg
+ Make_Directory-NoArg
MD5-NoFile
MD5-BadArg1
MD5-BadArg2
diff --git a/Tests/CMakeTests/Make_Directory-NoArg.cmake b/Tests/CMakeTests/Make_Directory-NoArg.cmake
new file mode 100644
index 0000000..25b6f89
--- /dev/null
+++ b/Tests/CMakeTests/Make_Directory-NoArg.cmake
@@ -0,0 +1 @@
+file(MAKE_DIRECTORY)
-----------------------------------------------------------------------
Summary of changes:
Source/cmFileCommand.cxx | 15 +++++----------
Tests/CMakeTests/File-Glob-NoArg.cmake | 2 ++
Tests/CMakeTests/FileTest.cmake.in | 11 +++++++++++
Tests/CMakeTests/Make_Directory-NoArg.cmake | 1 +
4 files changed, 19 insertions(+), 10 deletions(-)
create mode 100644 Tests/CMakeTests/File-Glob-NoArg.cmake
create mode 100644 Tests/CMakeTests/Make_Directory-NoArg.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list