summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2015-04-15 23:44:27 -0400
committerBenety Goh <benety@mongodb.com>2015-04-22 14:57:45 -0400
commit27fdd81021e50d352a3de9e85432ff44c6913220 (patch)
treeaa7b90fbebadbe60a694887b8caf7083989cef95 /src
parent14d3b48316f6e2ed075d01c3a9e7dcb28c0f2b63 (diff)
downloadmongo-27fdd81021e50d352a3de9e85432ff44c6913220.tar.gz
SERVER-17894 moved CurOp into its own library
Diffstat (limited to 'src')
-rw-r--r--src/mongo/SConscript33
-rw-r--r--src/mongo/db/auth/SConscript27
-rw-r--r--src/mongo/util/SConscript19
-rw-r--r--src/mongo/util/progress_meter_test.cpp43
4 files changed, 112 insertions, 10 deletions
diff --git a/src/mongo/SConscript b/src/mongo/SConscript
index ba060fad16a..9abc6ccd67c 100644
--- a/src/mongo/SConscript
+++ b/src/mongo/SConscript
@@ -257,10 +257,31 @@ env.CppUnitTest('sock_test', ['util/net/sock_test.cpp'],
'synchronization',
])
-env.CppUnitTest('curop_test',
- ['db/curop_test.cpp'],
- LIBDEPS=['serveronly', 'coredb', 'coreserver', 'ntservice_mock'],
- NO_CRUTCH=True)
+env.Library(
+ target='curop',
+ source=[
+ 'db/curop.cpp',
+ ],
+ LIBDEPS=[
+ 'fail_point',
+ 'network',
+ 'service_context',
+ '$BUILD_DIR/mongo/db/commands/server_status_core',
+ '$BUILD_DIR/mongo/db/concurrency/lock_manager',
+ '$BUILD_DIR/mongo/db/stats/top',
+ '$BUILD_DIR/mongo/util/progress_meter',
+ ],
+)
+
+env.CppUnitTest(
+ target='curop_test',
+ source=[
+ 'db/curop_test.cpp',
+ ],
+ LIBDEPS=[
+ 'curop',
+ ],
+)
env.Library('index_names',["db/index_names.cpp"])
@@ -407,7 +428,6 @@ env.Library('namespace_string', ['db/namespace_string.cpp'], LIBDEPS=['foundatio
commonFiles = [ "shell/mongo.cpp",
"util/file_allocator.cpp",
"util/paths.cpp",
- "util/progress_meter.cpp",
"util/concurrency/task.cpp",
"util/password.cpp",
"util/concurrency/rwlockimpl.cpp",
@@ -481,6 +501,7 @@ env.Library('mongocommon', commonFiles,
'$BUILD_DIR/third_party/murmurhash3/murmurhash3',
'$BUILD_DIR/third_party/shim_boost',
'$BUILD_DIR/mongo/util/options_parser/options_parser',
+ '$BUILD_DIR/mongo/util/progress_meter',
] +
extraCommonLibdeps)
@@ -766,7 +787,6 @@ serverOnlyFiles = [ "db/background.cpp",
"db/commands/write_commands/batch_executor.cpp",
"db/commands/write_commands/write_commands.cpp",
"db/commands/writeback_compatibility_shim.cpp",
- "db/curop.cpp",
"db/dbcommands.cpp",
"db/dbdirectclient.cpp",
"db/dbeval.cpp",
@@ -1038,6 +1058,7 @@ env.CppUnitTest('range_deleter_test',
serveronlyEnv = env.Clone()
serveronlyEnv.InjectThirdPartyIncludePaths(libraries=['snappy'])
serveronlyLibdeps = ["coreshard",
+ 'curop',
"db/auth/authmongod",
"db/fts/ftsmongod",
"db/common",
diff --git a/src/mongo/db/auth/SConscript b/src/mongo/db/auth/SConscript
index f6966b09e56..1b23425eb52 100644
--- a/src/mongo/db/auth/SConscript
+++ b/src/mongo/db/auth/SConscript
@@ -28,8 +28,10 @@ env.Library('authcore', ['action_set.cpp',
'user_management_commands_parser.cpp',
'user_name.cpp',
'user_set.cpp'],
- LIBDEPS=['$BUILD_DIR/mongo/base/base',
+ LIBDEPS=['sasl_options',
+ '$BUILD_DIR/mongo/base/base',
'$BUILD_DIR/mongo/bson',
+ '$BUILD_DIR/mongo/crypto/scramauth',
'$BUILD_DIR/mongo/db/common',
'$BUILD_DIR/mongo/db/ops/update_driver',
'$BUILD_DIR/mongo/md5',
@@ -41,25 +43,42 @@ env.Library('authcommon',
['internal_user_auth.cpp'],
LIBDEPS=['$BUILD_DIR/mongo/bson'])
-env.Library('authservercommon',
+env.Library('authorization_manager_global',
[
'auth_decorations.cpp',
'authorization_manager_global.cpp',
+ ],
+ LIBDEPS=[
+ 'authcore',
+ '$BUILD_DIR/mongo/service_context',
+ ])
+
+env.Library('authservercommon',
+ [
'authz_session_external_state_server_common.cpp',
'sasl_commands.cpp',
'security_key.cpp',
],
- LIBDEPS=['authcommon', 'authcore', 'authmocks', 'saslauth'])
+ LIBDEPS=[
+ 'authcommon',
+ 'authcore',
+ 'authmocks',
+ 'authorization_manager_global',
+ 'saslauth',
+ ])
+
+env.Library('sasl_options',
+ ['sasl_options.cpp'])
env.Library('saslauth',
['native_sasl_authentication_session.cpp',
'sasl_authentication_session.cpp',
- 'sasl_options.cpp',
'sasl_plain_server_conversation.cpp',
'sasl_scramsha1_server_conversation.cpp',
'sasl_server_conversation.cpp'],
LIBDEPS=[
'authcore',
+ 'sasl_options',
'$BUILD_DIR/mongo/crypto/scramauth',
'$BUILD_DIR/mongo/network'])
diff --git a/src/mongo/util/SConscript b/src/mongo/util/SConscript
index 150ad2842af..188e7ccdf46 100644
--- a/src/mongo/util/SConscript
+++ b/src/mongo/util/SConscript
@@ -44,3 +44,22 @@ env.CppUnitTest(
]
)
+env.Library(
+ target='progress_meter',
+ source=[
+ 'progress_meter.cpp',
+ ],
+ LIBDEPS=[
+ '$BUILD_DIR/mongo/logger/logger',
+ ],
+)
+
+env.CppUnitTest(
+ target='progress_meter_test',
+ source=[
+ 'progress_meter_test.cpp',
+ ],
+ LIBDEPS=[
+ 'progress_meter',
+ ],
+)
diff --git a/src/mongo/util/progress_meter_test.cpp b/src/mongo/util/progress_meter_test.cpp
new file mode 100644
index 00000000000..9324b355feb
--- /dev/null
+++ b/src/mongo/util/progress_meter_test.cpp
@@ -0,0 +1,43 @@
+/**
+ * Copyright (C) 2015 MongoDB Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the GNU Affero General Public License in all respects for
+ * all of the code used other than as permitted herein. If you modify file(s)
+ * with this exception, you may extend this exception to your version of the
+ * file(s), but you are not obligated to do so. If you do not wish to do so,
+ * delete this exception statement from your version. If you delete this
+ * exception statement from all source files in the program, then also delete
+ * it in the license file.
+ */
+
+#include "mongo/platform/basic.h"
+
+#include "mongo/util/progress_meter.h"
+#include "mongo/unittest/unittest.h"
+
+namespace {
+
+ using namespace mongo;
+
+ // Trivial unit test to validate build dependencies.
+ TEST(ProgressMeterTest, ToString) {
+ ASSERT_FALSE(ProgressMeter(1).toString().empty());
+ }
+
+} // namespace