You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2014/11/13 20:07:21 UTC

[1/3] mesos git commit: Added c++11 initializer_list check to configure.

Repository: mesos
Updated Branches:
  refs/heads/master a06da4e48 -> 7cec663fa


Added c++11 initializer_list check to configure.

Review: https://reviews.apache.org/r/27945


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/623d6a0d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/623d6a0d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/623d6a0d

Branch: refs/heads/master
Commit: 623d6a0d0f0eb90be80b7e95c91ece89de513367
Parents: a06da4e
Author: Cody Maloney <co...@mesosphere.io>
Authored: Thu Nov 13 10:57:50 2014 -0800
Committer: Benjamin Mahler <bm...@twitter.com>
Committed: Thu Nov 13 10:59:46 2014 -0800

----------------------------------------------------------------------
 m4/ax_cxx_compile_stdcxx_11.m4 | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/623d6a0d/m4/ax_cxx_compile_stdcxx_11.m4
----------------------------------------------------------------------
diff --git a/m4/ax_cxx_compile_stdcxx_11.m4 b/m4/ax_cxx_compile_stdcxx_11.m4
index d166aa1..07e20bb 100644
--- a/m4/ax_cxx_compile_stdcxx_11.m4
+++ b/m4/ax_cxx_compile_stdcxx_11.m4
@@ -36,8 +36,11 @@
 #serial 3
 
 m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [
+  #include <initializer_list>
   #include <memory>
   #include <mutex>
+  #include <string>
+  #include <vector>
 
   template <typename T, typename ...Args>
     struct check
@@ -105,6 +108,21 @@ m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [
   // construct a new shared_ptr using shared_from_this().
   std::shared_ptr<SharedStruct> object =
     std::shared_ptr<SharedStruct>(new SharedStruct())->get();
+
+  // initializer lists.
+  std::vector<std::string> g = {"hello", "world"};
+
+  struct InitializerList
+  {
+    InitializerList(std::initializer_list<int>) {}
+    void doSomething(std::initializer_list<int>) {}
+  };
+
+  void initializerListClassTest()
+  {
+    InitializerList il{1,2,3,4};
+    il.doSomething({5,6,7,8});
+  }
 ])
 
 AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [


[2/3] mesos git commit: Added a unit test for path::join.

Posted by bm...@apache.org.
Added a unit test for path::join.

Review: https://reviews.apache.org/r/27605


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/fea27355
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/fea27355
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/fea27355

Branch: refs/heads/master
Commit: fea27355b9254edbf29f7ab996d49ef5020ac17f
Parents: 623d6a0
Author: Cody Maloney <co...@mesosphere.io>
Authored: Thu Nov 13 11:01:05 2014 -0800
Committer: Benjamin Mahler <bm...@twitter.com>
Committed: Thu Nov 13 11:01:05 2014 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/stout/Makefile.am  |  1 +
 .../3rdparty/stout/include/stout/path.hpp       |  2 +-
 .../3rdparty/stout/tests/path_tests.cpp         | 47 ++++++++++++++++++++
 3 files changed, 49 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/fea27355/3rdparty/libprocess/3rdparty/stout/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/Makefile.am b/3rdparty/libprocess/3rdparty/stout/Makefile.am
index 7aac3fd..8e51957 100644
--- a/3rdparty/libprocess/3rdparty/stout/Makefile.am
+++ b/3rdparty/libprocess/3rdparty/stout/Makefile.am
@@ -32,6 +32,7 @@ EXTRA_DIST =					\
   tests/os_tests.cpp				\
   tests/os/sendfile_tests.cpp			\
   tests/os/signals_tests.cpp			\
+  tests/path_tests.cpp				\
   tests/proc_tests.cpp				\
   tests/protobuf_tests.cpp			\
   tests/protobuf_tests.pb.cc			\

http://git-wip-us.apache.org/repos/asf/mesos/blob/fea27355/3rdparty/libprocess/3rdparty/stout/include/stout/path.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/path.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/path.hpp
index bc6920a..4f7153e 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/path.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/path.hpp
@@ -17,7 +17,7 @@
 #include <string>
 #include <vector>
 
-#include "strings.hpp"
+#include <stout/strings.hpp>
 
 namespace path {
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/fea27355/3rdparty/libprocess/3rdparty/stout/tests/path_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/path_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/path_tests.cpp
new file mode 100644
index 0000000..18dd8e7
--- /dev/null
+++ b/3rdparty/libprocess/3rdparty/stout/tests/path_tests.cpp
@@ -0,0 +1,47 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <gtest/gtest.h>
+
+#include <string>
+#include <vector>
+
+#include <stout/path.hpp>
+
+using std::string;
+using std::vector;
+
+
+TEST(PathTest, Join)
+{
+  // Raw strings and std::strings can be mixed.
+  EXPECT_EQ("a/b/c", path::join("a", "b", "c"));
+  EXPECT_EQ("a/b/c", path::join(string("a"), string("b"), string("c")));
+  EXPECT_EQ("a/b/c", path::join(string("a"), "b", string("c")));
+
+  // Joining a vector of strings.
+  EXPECT_EQ("a/b/c", path::join(vector<string>({"a", "b", "c"})));
+  EXPECT_EQ("", path::join(vector<string>()));
+  //TODO(cmaloney): This should join to ""
+  EXPECT_EQ("/", path::join(vector<string>({"", "", ""})));
+
+  // Interesting corner cases around being the first, middle, last.
+  EXPECT_EQ("/asdf", path::join("/", "asdf"));
+  EXPECT_EQ("/", path::join("", "/", ""));
+
+  // Check trailing and leading slashes get cleaned up how we expect.
+  EXPECT_EQ("a/b/c/", path::join("a/", "b/", "c/"));
+  EXPECT_EQ("/a/b/c", path::join("/a", "/b", "/c"));
+  EXPECT_EQ("/a/b/c/", path::join("/a/", "/b/", "/c/"));
+  EXPECT_EQ("a/b/c/", path::join("a/", "/b/", "/c/"));
+}


[3/3] mesos git commit: Added new test to the libprocess Makefile.

Posted by bm...@apache.org.
Added new <stout/path> test to the libprocess Makefile.

Review: https://reviews.apache.org/r/27946


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7cec663f
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7cec663f
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7cec663f

Branch: refs/heads/master
Commit: 7cec663fa0cebee10c0a84413c24e1d0e5fa3f52
Parents: fea2735
Author: Cody Maloney <co...@mesosphere.io>
Authored: Thu Nov 13 11:06:05 2014 -0800
Committer: Benjamin Mahler <bm...@twitter.com>
Committed: Thu Nov 13 11:06:05 2014 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/Makefile.am                |  1 +
 3rdparty/libprocess/3rdparty/stout/tests/path_tests.cpp | 10 ++++------
 2 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/7cec663f/3rdparty/libprocess/3rdparty/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/Makefile.am b/3rdparty/libprocess/3rdparty/Makefile.am
index 0dc2871..85170a1 100644
--- a/3rdparty/libprocess/3rdparty/Makefile.am
+++ b/3rdparty/libprocess/3rdparty/Makefile.am
@@ -163,6 +163,7 @@ stout_tests_SOURCES =				\
   $(STOUT)/tests/none_tests.cpp			\
   $(STOUT)/tests/option_tests.cpp		\
   $(STOUT)/tests/os_tests.cpp			\
+  $(STOUT)/tests/path_tests.cpp			\
   $(STOUT)/tests/protobuf_tests.cpp		\
   $(STOUT)/tests/protobuf_tests.pb.cc		\
   $(STOUT)/tests/protobuf_tests.pb.h		\

http://git-wip-us.apache.org/repos/asf/mesos/blob/7cec663f/3rdparty/libprocess/3rdparty/stout/tests/path_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/path_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/path_tests.cpp
index 18dd8e7..cf35412 100644
--- a/3rdparty/libprocess/3rdparty/stout/tests/path_tests.cpp
+++ b/3rdparty/libprocess/3rdparty/stout/tests/path_tests.cpp
@@ -24,14 +24,12 @@ using std::vector;
 
 TEST(PathTest, Join)
 {
-  // Raw strings and std::strings can be mixed.
   EXPECT_EQ("a/b/c", path::join("a", "b", "c"));
-  EXPECT_EQ("a/b/c", path::join(string("a"), string("b"), string("c")));
-  EXPECT_EQ("a/b/c", path::join(string("a"), "b", string("c")));
+  EXPECT_EQ("/a/b/c", path::join("/a", "b", "c"));
 
-  // Joining a vector of strings.
-  EXPECT_EQ("a/b/c", path::join(vector<string>({"a", "b", "c"})));
   EXPECT_EQ("", path::join(vector<string>()));
+  EXPECT_EQ("a/b/c", path::join(vector<string>({"a", "b", "c"})));
+
   //TODO(cmaloney): This should join to ""
   EXPECT_EQ("/", path::join(vector<string>({"", "", ""})));
 
@@ -39,7 +37,7 @@ TEST(PathTest, Join)
   EXPECT_EQ("/asdf", path::join("/", "asdf"));
   EXPECT_EQ("/", path::join("", "/", ""));
 
-  // Check trailing and leading slashes get cleaned up how we expect.
+  // Check trailing and leading slashes get cleaned up.
   EXPECT_EQ("a/b/c/", path::join("a/", "b/", "c/"));
   EXPECT_EQ("/a/b/c", path::join("/a", "/b", "/c"));
   EXPECT_EQ("/a/b/c/", path::join("/a/", "/b/", "/c/"));