summaryrefslogtreecommitdiff
path: root/src/mongo/base/SConscript
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@10gen.com>2012-09-10 10:35:08 -0400
committerAndy Schwerin <schwerin@10gen.com>2012-09-17 10:37:54 -0400
commitace5fac55b6ec2becf3758b8bdd4039438f23745 (patch)
tree9dbae6a6336d5f1d5525cf2128cbab9ede79a040 /src/mongo/base/SConscript
parent3b738b913f169d816cc8ea7bdf6c4c3b51812ea7 (diff)
downloadmongo-ace5fac55b6ec2becf3758b8bdd4039438f23745.tar.gz
Implement and test InitializerDependencyGraph.
An InitializerDependencyGraph is a directed acyclic graph (DAG) of named initialization operations. Every node in the graph has a unique name, a behavior function, and a set of prerequisites. The graph supports two inspection functions, one to get the behavior function for a node with a given name, and the other to produce a vector of node names, ordered in a manner that does not violate any preprequisite dependneces. InitializerDependencyGraph is exception-free, and because it is for use very early in process startup, it does no logging itself. This patch also introduces a utility macro, MONGO_MAKE_STRING_VECTOR, which is useful for constructing std::vector<std::string> from a sequence of string literals. This patch uses it for testing, but subsequent MONGO_INIT-related work will rely on it, as well. Part of work on SERVER-5112.
Diffstat (limited to 'src/mongo/base/SConscript')
-rw-r--r--src/mongo/base/SConscript10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mongo/base/SConscript b/src/mongo/base/SConscript
index bb500cd21ed..5c5f385fcac 100644
--- a/src/mongo/base/SConscript
+++ b/src/mongo/base/SConscript
@@ -2,9 +2,13 @@
Import("env")
-env.StaticLibrary("base", ['status.cpp'])
+env.StaticLibrary('base', ['initializer_dependency_graph.cpp',
+ 'make_string_vector.cpp',
+ 'status.cpp'])
-env.CppUnitTest('status_test', 'status_test.cpp',
+env.CppUnitTest('initializer_dependency_graph_test',
+ ['initializer_dependency_graph_test.cpp'],
LIBDEPS=['base'])
-
+env.CppUnitTest('status_test', 'status_test.cpp',
+ LIBDEPS=['base'])