summaryrefslogtreecommitdiff
path: root/src/third_party
diff options
context:
space:
mode:
authorChenhao Qu <chenhao.qu@mongodb.com>2022-10-12 13:36:57 +1100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-10-12 03:07:31 +0000
commitbdfa6a7478dcf13aebece3e3d7f7c46ccfa6f6ca (patch)
tree77ce8255a89601085f215dbbe611b717336c2554 /src/third_party
parentb68a2c71f177541b838a011796f12cbba278ef13 (diff)
downloadmongo-bdfa6a7478dcf13aebece3e3d7f7c46ccfa6f6ca.tar.gz
Import wiredtiger: 5bdc537e0de2917192a0ffd5be07c4c2937c454f from branch mongodb-master
ref: a3980b988e..5bdc537e0d for: 6.2.0-rc0 WT-9963 Create a new option to list all the cpp tests (#8354)
Diffstat (limited to 'src/third_party')
-rw-r--r--src/third_party/wiredtiger/import.data2
-rwxr-xr-xsrc/third_party/wiredtiger/test/cppsuite/tests/run.cpp32
2 files changed, 17 insertions, 17 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index c4424fe6cac..89f6285273b 100644
--- a/src/third_party/wiredtiger/import.data
+++ b/src/third_party/wiredtiger/import.data
@@ -2,5 +2,5 @@
"vendor": "wiredtiger",
"github": "wiredtiger/wiredtiger.git",
"branch": "mongodb-master",
- "commit": "a3980b988e304ba0597409ab26a2554ad1c0ad69"
+ "commit": "5bdc537e0de2917192a0ffd5be07c4c2937c454f"
}
diff --git a/src/third_party/wiredtiger/test/cppsuite/tests/run.cpp b/src/third_party/wiredtiger/test/cppsuite/tests/run.cpp
index 404ed04b7af..dbe5214b475 100755
--- a/src/third_party/wiredtiger/test/cppsuite/tests/run.cpp
+++ b/src/third_party/wiredtiger/test/cppsuite/tests/run.cpp
@@ -92,6 +92,7 @@ print_help()
std::cout << "\trun -c [TEST_FRAMEWORK_CONFIGURATION]" << std::endl;
std::cout << "\trun -f [FILE]" << std::endl;
std::cout << "\trun -l [TRACE_LEVEL]" << std::endl;
+ std::cout << "\trun --list" << std::endl;
std::cout << "\trun -t [TEST_NAME]" << std::endl;
std::cout << std::endl;
std::cout << "DESCRIPTION" << std::endl;
@@ -107,12 +108,13 @@ print_help()
std::cout << std::endl;
std::cout << "OPTIONS" << std::endl;
std::cout << "\t-h Output a usage message and exit." << std::endl;
- std::cout << "\t-C Additional wiredtiger open configuration." << std::endl;
+ std::cout << "\t-C Additional WiredTiger open configuration." << std::endl;
std::cout << "\t-c Test framework configuration. Cannot be used with -f." << std::endl;
std::cout << "\t-f File that contains the configuration. Cannot be used with -C." << std::endl;
std::cout << "\t-l Trace level from 0 to 3. "
"1 is the default level, all warnings and errors are logged."
<< std::endl;
+ std::cout << "\t--list List all the tests that can be executed." << std::endl;
std::cout << "\t-t Test name to be executed." << std::endl;
}
@@ -187,20 +189,13 @@ main(int argc, char *argv[])
/* Set the program name for error messages. */
(void)testutil_set_progname(argv);
- /* Parse args
- * -C : Additional wiredtiger_open configuration.
- * -c : Test framework configuration. Cannot be used with -f. If no specific test is specified
- * to be run, the same configuration will be used for all existing tests.
- * -f : Filename that contains the configuration. Cannot be used with -C. If no specific test
- * is specified to be run, the same configuration will be used for all existing tests.
- * -l : Trace level.
- * -t : Test to run. All tests are run if not specified.
- */
+ /* See print_help() for all the different options and their description. */
for (size_t i = 1; (i < argc) && (error_code == 0); ++i) {
- if (std::string(argv[i]) == "-h") {
+ const std::string option = std::string(argv[i]);
+ if (option == "-h" || option == "--help") {
print_help();
return 0;
- } else if (std::string(argv[i]) == "-C") {
+ } else if (option == "-C") {
if ((i + 1) < argc) {
wt_open_config = argv[++i];
/* Add a comma to the front if the user didn't supply one. */
@@ -208,7 +203,7 @@ main(int argc, char *argv[])
wt_open_config.insert(0, 1, ',');
} else
error_code = -1;
- } else if (std::string(argv[i]) == "-c") {
+ } else if (option == "-c") {
if (!config_filename.empty()) {
test_harness::logger::log_msg(LOG_ERROR, "Option -C cannot be used with -f");
error_code = -1;
@@ -216,7 +211,7 @@ main(int argc, char *argv[])
cfg = argv[++i];
else
error_code = -1;
- } else if (std::string(argv[i]) == "-f") {
+ } else if (option == "-f") {
if (!cfg.empty()) {
test_harness::logger::log_msg(LOG_ERROR, "Option -f cannot be used with -C");
error_code = -1;
@@ -224,16 +219,21 @@ main(int argc, char *argv[])
config_filename = argv[++i];
else
error_code = -1;
- } else if (std::string(argv[i]) == "-t") {
+ } else if (option == "-t") {
if ((i + 1) < argc)
test_name = argv[++i];
else
error_code = -1;
- } else if (std::string(argv[i]) == "-l") {
+ } else if (option == "-l") {
if ((i + 1) < argc)
test_harness::logger::trace_level = std::stoi(argv[++i]);
else
error_code = -1;
+ } else if (option == "--list") {
+ std::cout << "The tests are:" << std::endl;
+ for (const auto &test_name : all_tests)
+ std::cout << "\t" << test_name << std::endl;
+ return 0;
} else
error_code = -1;
}