You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by nn...@apache.org on 2014/10/23 21:06:13 UTC
git commit: Added --modules flag for tests.
Repository: mesos
Updated Branches:
refs/heads/master 6e3ab0e5d -> 5348496aa
Added --modules flag for tests.
This allows the user to specify the modules to load during tests.
The modules are made available to the master and slave subsystems.
Review: https://reviews.apache.org/r/26796
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5348496a
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5348496a
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5348496a
Branch: refs/heads/master
Commit: 5348496aafa9b09f2b85f84822b5b05308c6c844
Parents: 6e3ab0e
Author: Kapil Arya <ka...@mesosphere.io>
Authored: Thu Oct 23 18:24:32 2014 +0000
Committer: Niklas Q. Nielsen <ni...@mesosphere.io>
Committed: Thu Oct 23 18:49:06 2014 +0000
----------------------------------------------------------------------
src/tests/flags.hpp | 34 ++++++++++++++++++++++++++++++++++
src/tests/main.cpp | 4 +---
2 files changed, 35 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/5348496a/src/tests/flags.hpp
----------------------------------------------------------------------
diff --git a/src/tests/flags.hpp b/src/tests/flags.hpp
index 189fad9..80f0cee 100644
--- a/src/tests/flags.hpp
+++ b/src/tests/flags.hpp
@@ -25,7 +25,10 @@
#include <stout/flags.hpp>
#include <stout/os.hpp>
+#include "common/parse.hpp"
+#include "common/type_utils.hpp"
#include "logging/logging.hpp"
+#include "messages/messages.hpp"
namespace mesos {
namespace internal {
@@ -71,6 +74,36 @@ public:
"docker",
"Where to find docker executable",
"docker");
+
+ add(&modules,
+ "modules",
+ "List of modules to be loaded and be available to the internal\n"
+ "subsystems.\n"
+ "\n"
+ "Use --modules=filepath to specify the list of modules via a\n"
+ "file containing a JSON formatted string. 'filepath' can be\n"
+ "of the form 'file:///path/to/file' or '/path/to/file'.\n"
+ "\n"
+ "Use --modules=\"{...}\" to specify the list of modules inline.\n"
+ "\n"
+ "Example:\n"
+ "{\n"
+ " \"libraries\": [\n"
+ " {\n"
+ " \"file\": \"/path/to/libfoo.so\",\n"
+ " \"modules\": [\n"
+ " \"org_apache_mesos_bar\",\n"
+ " \"org_apache_mesos_baz\"\n"
+ " ]\n"
+ " },\n"
+ " {\n"
+ " \"name\": \"qux\",\n"
+ " \"modules\": [\n"
+ " \"org_apache_mesos_norf\",\n"
+ " ]\n"
+ " }\n"
+ " ]\n"
+ "}");
}
bool verbose;
@@ -78,6 +111,7 @@ public:
std::string source_dir;
std::string build_dir;
std::string docker;
+ Option<Modules> modules;
};
// Global flags for running the tests.
http://git-wip-us.apache.org/repos/asf/mesos/blob/5348496a/src/tests/main.cpp
----------------------------------------------------------------------
diff --git a/src/tests/main.cpp b/src/tests/main.cpp
index fc83fd0..e3fff5d 100644
--- a/src/tests/main.cpp
+++ b/src/tests/main.cpp
@@ -86,9 +86,7 @@ int main(int argc, char** argv)
}
// Initialize Modules.
- // TODO(karya): Add --modules flag to populate "modules".
- Option<Modules> modules;
- Try<Nothing> result = tests::initModules(modules);
+ Try<Nothing> result = tests::initModules(flags.modules);
if (result.isError()) {
EXIT(1) << "Error initializing modules: " << result.error();
}