You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2014/06/17 23:07:18 UTC

git commit: Exposed tests utils in stout.

Repository: mesos
Updated Branches:
  refs/heads/master cdbd8bb18 -> 7d7d94b1d


Exposed tests utils in stout.

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


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

Branch: refs/heads/master
Commit: 7d7d94b1d8bec6efe219ff4cb9fbbedfe7312492
Parents: cdbd8bb
Author: Jie Yu <yu...@gmail.com>
Authored: Tue Jun 17 14:05:55 2014 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Tue Jun 17 14:05:55 2014 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/stout/Makefile.am  |  2 +-
 .../stout/include/stout/tests/utils.hpp         | 61 ++++++++++++++++++++
 .../libprocess/3rdparty/stout/tests/utils.hpp   | 42 --------------
 3 files changed, 62 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/7d7d94b1/3rdparty/libprocess/3rdparty/stout/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/Makefile.am b/3rdparty/libprocess/3rdparty/stout/Makefile.am
index 00d8c61..eac7ab5 100644
--- a/3rdparty/libprocess/3rdparty/stout/Makefile.am
+++ b/3rdparty/libprocess/3rdparty/stout/Makefile.am
@@ -68,6 +68,7 @@ EXTRA_DIST =					\
   include/stout/stopwatch.hpp			\
   include/stout/stringify.hpp			\
   include/stout/strings.hpp			\
+  include/stout/tests/utils.hpp			\
   include/stout/thread.hpp			\
   include/stout/try.hpp				\
   include/stout/tuple.hpp			\
@@ -105,5 +106,4 @@ EXTRA_DIST =					\
   tests/some_tests.cpp				\
   tests/strings_tests.cpp			\
   tests/thread_tests.cpp			\
-  tests/utils.hpp				\
   tests/uuid_tests.cpp

http://git-wip-us.apache.org/repos/asf/mesos/blob/7d7d94b1/3rdparty/libprocess/3rdparty/stout/include/stout/tests/utils.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/tests/utils.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/tests/utils.hpp
new file mode 100644
index 0000000..ff4907b
--- /dev/null
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/tests/utils.hpp
@@ -0,0 +1,61 @@
+/**
+ * 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.
+ */
+
+#ifndef __STOUT_TESTS_UTILS_HPP__
+#define __STOUT_TESTS_UTILS_HPP__
+
+#include <gtest/gtest.h>
+
+#include <string>
+
+#include <stout/gtest.hpp>
+#include <stout/os.hpp>
+#include <stout/try.hpp>
+
+class TemporaryDirectoryTest : public ::testing::Test
+{
+protected:
+  virtual void SetUp()
+  {
+    // Save the current working directory.
+    cwd = os::getcwd();
+
+    // Create a temporary directory for the test.
+    Try<std::string> directory = os::mkdtemp();
+
+    ASSERT_SOME(directory) << "Failed to mkdtemp";
+
+    sandbox = directory.get();
+
+    // Run the test out of the temporary directory we created.
+    ASSERT_TRUE(os::chdir(sandbox.get()))
+      << "Failed to chdir into '" << sandbox.get() << "'";
+  }
+
+  virtual void TearDown()
+  {
+    // Return to previous working directory and cleanup the sandbox.
+    ASSERT_TRUE(os::chdir(cwd));
+
+    if (sandbox.isSome()) {
+      ASSERT_SOME(os::rmdir(sandbox.get()));
+    }
+  }
+
+private:
+  std::string cwd;
+  Option<std::string> sandbox;
+};
+
+#endif // __STOUT_TESTS_UTILS_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/7d7d94b1/3rdparty/libprocess/3rdparty/stout/tests/utils.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/utils.hpp b/3rdparty/libprocess/3rdparty/stout/tests/utils.hpp
deleted file mode 100644
index 070bc6e..0000000
--- a/3rdparty/libprocess/3rdparty/stout/tests/utils.hpp
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <gtest/gtest.h>
-
-#include <string>
-
-#include <stout/gtest.hpp>
-#include <stout/os.hpp>
-#include <stout/try.hpp>
-
-class TemporaryDirectoryTest : public ::testing::Test
-{
-protected:
-  virtual void SetUp()
-  {
-    // Save the current working directory.
-    cwd = os::getcwd();
-
-    // Create a temporary directory for the test.
-    Try<std::string> directory = os::mkdtemp();
-
-    ASSERT_SOME(directory) << "Failed to mkdtemp";
-
-    sandbox = directory.get();
-
-    // Run the test out of the temporary directory we created.
-    ASSERT_TRUE(os::chdir(sandbox.get()))
-      << "Failed to chdir into '" << sandbox.get() << "'";
-  }
-
-  virtual void TearDown()
-  {
-    // Return to previous working directory and cleanup the sandbox.
-    ASSERT_TRUE(os::chdir(cwd));
-
-    if (sandbox.isSome()) {
-      ASSERT_SOME(os::rmdir(sandbox.get()));
-    }
-  }
-
-private:
-  std::string cwd;
-  Option<std::string> sandbox;
-};