diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2018-05-14 16:34:53 -0400 |
---|---|---|
committer | Billy Donahue <billy.donahue@mongodb.com> | 2018-05-16 15:12:06 -0400 |
commit | 373aae274364751eec424a3665c50b53b06f6746 (patch) | |
tree | 131d1bed40e861b7b1f84b87f3af9dbf6c10a3f3 /src/mongo/db/commands/test_commands_enabled.h | |
parent | def040cc178a7726559e7796557c98384119b16e (diff) | |
download | mongo-373aae274364751eec424a3665c50b53b06f6746.tar.gz |
SERVER-34653 MONGO_REGISTER_TEST_COMMAND
Diffstat (limited to 'src/mongo/db/commands/test_commands_enabled.h')
-rw-r--r-- | src/mongo/db/commands/test_commands_enabled.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/mongo/db/commands/test_commands_enabled.h b/src/mongo/db/commands/test_commands_enabled.h index 633c18153b8..f8f48a63c95 100644 --- a/src/mongo/db/commands/test_commands_enabled.h +++ b/src/mongo/db/commands/test_commands_enabled.h @@ -33,15 +33,11 @@ namespace mongo { /** * If true, then testing commands are available. Defaults to false. * - * Testing commands should conditionally register themselves by consulting this flag: - * - * MONGO_INITIALIZER(RegisterMyTestCommand)(InitializerContext* context) { - * if (getTestCommandsEnabled()) { - * // Leaked intentionally: a Command registers itself when constructed. - * new MyTestCommand(); - * } - * return Status::OK(); - * } + * Testing commands should conditionally register themselves by using + * MONGO_REGISTER_TEST_COMMAND (in src/mongo/db/commands.h), which consults this flag: + * + * class MyTestCommand ...; + * MONGO_REGISTER_TEST_COMMAND(MyTestCommand); * * To make testing commands available by default, change the value to true before running any * mongo initializers: |