summaryrefslogtreecommitdiff
path: root/src/mongo/idl/config_option_test.idl
diff options
context:
space:
mode:
authorSara Golemon <sara.golemon@mongodb.com>2018-11-07 14:31:23 +0000
committerSara Golemon <sara.golemon@mongodb.com>2018-11-24 18:36:50 +0000
commitda22c83c0e2d4d9b1e014b183a21898443dbc128 (patch)
tree2e092cba3d1cbfa7d4d19e1421797fa726df0d27 /src/mongo/idl/config_option_test.idl
parentef9dc1e966374196badef69b88fa87f119feac16 (diff)
downloadmongo-da22c83c0e2d4d9b1e014b183a21898443dbc128.tar.gz
SERVER-37093 Implement code-gen for IDL config options
Diffstat (limited to 'src/mongo/idl/config_option_test.idl')
-rw-r--r--src/mongo/idl/config_option_test.idl154
1 files changed, 154 insertions, 0 deletions
diff --git a/src/mongo/idl/config_option_test.idl b/src/mongo/idl/config_option_test.idl
new file mode 100644
index 00000000000..6c85b939421
--- /dev/null
+++ b/src/mongo/idl/config_option_test.idl
@@ -0,0 +1,154 @@
+# Copyright (C) 2018-present MongoDB, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the Server Side Public License, version 1,
+# as published by MongoDB, Inc.
+#
+# 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
+# Server Side Public License for more details.
+#
+# You should have received a copy of the Server Side Public License
+# along with this program. If not, see
+# <http://www.mongodb.com/licensing/server-side-public-license>.
+#
+# 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 Server Side 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.
+#
+
+global:
+ cpp_namespace: "mongo::test"
+ cpp_includes:
+ - "mongo/idl/server_parameter_with_storage_test.h"
+ configs:
+ initializer_name: TestConfigs
+
+imports:
+ - "mongo/idl/basic_types.idl"
+
+configs:
+ "test.config.opt1":
+ short_name: testConfigOpt1
+ description: "Basic switch"
+ arg_vartype: Switch
+ source: [ cli, yaml, ini ]
+
+ "test.config.opt2":
+ short_name: testConfigOpt2
+ description: "Boolean option without implicit value"
+ arg_vartype: Bool
+ source: cli
+
+ "test.config.opt3":
+ short_name: testConfigOpt3
+ description: "Boolean option with implicit value"
+ arg_vartype: Bool
+ source: cli
+ implicit: true
+
+ "test.config.opt4":
+ short_name: testConfigOpt4
+ description: "String option with a default value"
+ arg_vartype: String
+ source: cli
+ default: "Default Value"
+
+ "test.config.opt5":
+ short_name: testConfigOpt5
+ description: "Int option only settable from INI"
+ arg_vartype: Int
+ source: ini
+
+ # Positional options must be configured with a "short name" only.
+ "testConfigOpt6":
+ description: "Positional string argument"
+ arg_vartype: String
+ source: [ cli, ini ]
+ positional: 1
+ hidden: true
+
+ "testConfigOpt7":
+ description: "Muilti-value positional string arguments"
+ arg_vartype: StringVector
+ source: cli
+ positional: 2-
+ hidden: true
+
+ "test.config.opt8":
+ short_name: testConfigOpt8
+ deprecated_name: [ "test.config.opt8a", "test.config.opt8b" ]
+ deprecated_short_name: [ testConfigOpt8a, testConfigOpt8b ]
+ description: "Option with deprecated names"
+ source: [ cli, yaml ]
+ arg_vartype: Long
+
+ "test.config.opt9":
+ short_name: testConfigOpt9
+ description: "Option with dependencies"
+ arg_vartype: Unsigned
+ source: [ cli, ini, yaml ]
+ requires: "test.config.opt9a"
+ conflicts: "test.config.opt9b"
+
+ "test.config.opt9a":
+ short_name: testConfigOpt9a
+ description: "Required with opt9"
+ arg_vartype: Long
+ source: [ cli, ini, yaml ]
+
+ "test.config.opt9b":
+ short_name: testConfigOpt9b
+ description: "Conflicts with opt9"
+ arg_vartype: UnsignedLongLong
+ source: [ cli, ini, yaml ]
+
+ "test.config.opt10a":
+ short_name: testConfigOpt10a
+ description: "Integer from 0 to 100 exclusive"
+ arg_vartype: Int
+ source: cli
+ validator:
+ gt: 0
+ lt: 100
+
+ "test.config.opt10b":
+ short_name: testConfigOpt10b
+ description: "Integer from 0 to 100 inclusive"
+ arg_vartype: Int
+ source: cli
+ validator:
+ gte: 0
+ lte: 100
+
+ "test.config.opt11":
+ short_name: testConfigOpt11
+ description: "Odd integer (callback test)"
+ arg_vartype: Int
+ source: cli
+ validator:
+ callback: "validateOdd"
+
+ "test.config.opt12":
+ short_name: testConfigOpt12
+ description: "Test declared storage"
+ arg_vartype: String
+ source: cli
+ cpp_vartype: std::string
+ cpp_varname: gTestConfigOpt12
+
+ "test.config.opt13":
+ description: "Test with single name"
+ short_name: testConfigOpt13
+ single_name: o
+ arg_vartype: String
+ source: cli