summaryrefslogtreecommitdiff
path: root/src/mongo/unittest/unittest.h
Commit message (Collapse)AuthorAgeFilesLines
* SERVER-46219 Unit Tests should log with jsonMark Benvenuto2020-02-251-0/+15
|
* SERVER-46156 Deprecate LogstreamBuilder and more manual log conversionsHenrik Edin2020-02-231-2/+2
| | | | | | | * Remove setPlainConsoleLogger() * Update errorcodes linter to work with custom user defined log macros rename src/mongo/embedded/{embedded_log_appender.h => embedded_log_backend.h} (61%)
* SERVER-45583 Unittests are using logv2.Henrik Edin2020-01-211-9/+6
| | | | Capture log system uses logv2, tests can handle converted log statements.
* SERVER-43371 StringData for unit test registrationBilly Donahue2020-01-061-12/+21
|
* SERVER-44715 C++ Unit Tests cannot be filtered by test fileMark Benvenuto2019-12-181-7/+19
|
* SERVER-43418 ASSERT macro repairsBilly Donahue2019-10-021-60/+83
| | | | | - fix dangling else - all ASSERT* yield a stream expression for appending detail
* SERVER-43367 unittest framework refactor/fixesBilly Donahue2019-10-021-255/+250
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Segregate old-style dbtests into their own Suite initialization system: OldStyleSuiteSpecification. This is where the funky deprecated features can live on without interfering with the Suite API. It also gives us a searchable base class to identify them in the future. OldStyleSuite has `setupTests()` and an `add<T>()` that Suite does not have. Suite API can shrink when it doesn't have to support these dbtest adaptor features. Suite only needs non-template `add(name, callback)`. - Add OldStyleSuiteInitializer to some dbtests that were missing it! These didn't use SuiteInstance to register themselves and were incorrect. They would self register, resulting in _allSuites() holding a std::shared_ptr to a static-duration Suite object! - Change `getSuite()` to return `Suite&` instead of `Suite*`. - No more "self-registering" in Suite constructor. Registration must be done as a separate post-construction step. This removes some unusual lifetime management code and is easier to document. Suite::getSuite(name) is the only way to make a Suite, and it does the make_shared and registration calls with a pseudo-private ConstructorEnable idiom. - Suite->run() returns std::unique_ptr<Result> instead of raw `Result*`. It's virtual to support OldStyleSuite behavior. - Suite._ran does nothing. Removed. - Result.cur does nothing. Removed. - Switch to pass-by-value and std::move for most ctor args. - Add explicit on 1-arg ctors. - Get rid of TestHolder. It's just a 2-field struct. - use fmt instead of snprintf - TEST and TEST_F macros: generate TEST_TYPE once. - TEST and TEST_F macros: inline the _agent variable. - Mark _doRun as `override`. - Terminology: replace CASE_NAME with SUITE_NAME. - rename DeathTestImpl -> DeathTestBase - move getDeathTestPattern into the test as a static member function - refactor out some repetition from the comparator decl macros - use if-constexpr and diamond relops to clean up the ComparisonAssertion class. - dbtests: conditionally skip some add<T> calls - further dedup (DEATH_)TEST(_F) macros
* SERVER-41961 Remove the `NOINLINE_DECL` and replace with ↵ADAM David Alan Martin2019-08-151-6/+6
| | | | | | `MONGO_COMPILER_NOINLINE` Also removed the `PACKED_DECL`, since it isn't used.
* SERVER-42667 Make `ASSERT_THROWS` only catch exceptions from the expression.ADAM David Alan Martin2019-08-071-23/+28
| | | | | The `FAIL(...)` invocation should be outside of the try/catch block for this construct.
* SERVER-41626 Fix lint.ADAM David Alan Martin2019-06-131-19/+25
|
* SERVER-41626 Correct use of illegal names in macros for unittestsADAM David Alan Martin2019-06-131-11/+11
| | | | | | | | | | Names which match either of these RegExes are reserved for C++ implementations: - "__" - "^_[A-Z]" The unittest macros should not have these names, nor should they have the capacity to generate these names by token composition.
* Revert "SERVER-4999 Normalize all hostnames to lowercase"A. Jesse Jiryu Davis2019-06-111-5/+0
| | | | This reverts commit ad9267a722e21268d1005c1428ccad85d5a98946 (SERVER-41614).
* SERVER-39338 Remove `stdx/functional.h`ADAM David Alan Martin2019-06-101-2/+2
|
* SERVER-41047 errnoWithDescription only check __ANDROID_API__ if it's definedKevin Pulo2019-05-291-0/+12
|
* SERVER-4999 Normalize all hostnames to lowercaseA. Jesse Jiryu Davis2019-05-141-0/+5
| | | | | | | | | | Hostnames passed to replSetInitiate, replSetReconfig, addShard, etc. are all normalized by replacing ASCII uppercase characters with lowercase characters, consistent with how MongoDB drivers treat hostnames. The shell's getHostName() function now returns the hostname lowercased. Fixes undefined behavior in mongo::str::toLower().
* SERVER-40802 move some expensive and commonly instantiated functions out of lineMathias Stearn2019-05-011-20/+114
|
* SERVER-40634 Emulation of C++20 requires-clauses for C++17Mathias Stearn2019-05-011-0/+29
|
* Revert "SERVER-4999 Normalize all hostnames to lowercase"A. Jesse Jiryu Davis2019-04-241-5/+0
| | | | This reverts commit 5e346eb4b9bb3ec678d4eac36b3f0a18c1c10939.
* SERVER-4999 Normalize all hostnames to lowercaseA. Jesse Jiryu Davis2019-04-241-0/+5
| | | | | | | | Hostnames passed to replSetInitiate, replSetReconfig, addShard, etc. are all normalized by replacing ASCII uppercase characters with lowercase characters, consistent with how MongoDB drivers treat hostnames. Fixes undefined behavior in mongo::str::toLower().
* SERVER-40476 remove mongoutils::strBilly Donahue2019-04-091-2/+2
| | | | | | Rename utils/mongoutils/str.h => utils/str.h Rename namespace mongoutils::str => str Rename mongo::strcasecmp => str::caseInsensitiveCompare.
* SERVER-40357 expand all calls to MONGO_DISALLOW_COPYINGBilly Donahue2019-03-281-4/+8
| | | | | | | | | | | produced by: hits="$(git grep -n MONGO_DISALLOW_COPYING | cut -d: -f1 )" for f in "$hits"; do sed -i.orig ' s/^\( *\)MONGO_DISALLOW_COPYING(\(.*\));/\1\2(const \2\&) = delete;\n\1\2\& operator=(const \2\&) = delete;/; ' $f done
* SERVER-38760 Serialize update commands to BSONJacob Evans2019-02-281-1/+17
|
* SERVER-39560 - remove leading blank line on all C++ filesBilly Donahue2019-02-131-1/+0
| | | | | | Remove leading comments that are just stating the filename. Move any file-level comments below the copyright banner. Remove leading blank lines.
* SERVER-39000 Fix Unittest Framework initialization.ADAM David Alan Martin2019-01-251-10/+10
| | | | | | | | | | | | | | Some tests in `dbtest` do not use the `mongo::unittest::Test` class as a basis for their implementation and thus need some way to benefit from global DB Environment initialization functions. Specifically the changes in SERVER-32630 required `serverCompatibilityVersion` to be set sensibly. Some tests in `dbtest` were not correctly getting this benefit; instead only incidentally getting a correct setting by accident, as the results of an unintended residue of an earlier operation. This can lead to inconsistentcies in which tests pass, as link order changes -- the tests are registered using static initialization, whose instability of order can cause mysterious failures in `dbtest`.
* SERVER-37245 Use the SessionCatalog to track sessions on MongoSKaloian Manassiev2018-11-191-8/+18
|
* SERVER-37909 Fix GCC-8 in some tests.ADAM David Alan Martin2018-11-081-16/+3
| | | | | | | GCC-8 doesn't treat `_Pragma(...)` ignore directives in macros the way that Clang does. Instead of this technique, we'll make the requirement on `ASSERT_THROWS`' parameter an expression, not a statement.
* SERVER-37651 Update header files with new licenseRamon Fernandez2018-10-221-26/+28
|
* SERVER-37365 Don't use `ignore()` in some tests.ADAM David Alan Martin2018-10-021-1/+31
| | | | | | It shouldn't be necessary to explicitly ignore status returns in functions when testing their throw behavior - the test is sufficient to indicate that `Status` is ignored.
* SERVER-33758 Make mongo::logger classes use more unique_ptrsBen Caimano2018-03-211-1/+1
| | | | | Appenders and LogDomains now use unique ptrs internally and on signature.
* SERVER-32630 Ensure the fCV parameter is initialized before readingMaria van Keulen2018-03-091-1/+1
|
* SERVER-33628 Handle a mongo/unittest TODO c++11Billy Donahue2018-03-051-48/+82
| | | | | | | | | | | | Use unique_ptr instead of shared_ptr. Simplify with range-based for loops and auto where appropriate. Change ASSERT_EQ guts to rely less on macros. Change the reserved _[A-Z] names (use trailing underscore instead). Change a vector<T*> to vector<unique_ptr<T>>. Change shared_ptr<T*> to unique_ptr<T>. Add a comment to mongoutils::str::stream lamenting missing relops. Add static to comparator() members. Add static constexpr to name() members.
* SERVER-32373 building android targets as TARGET_OS=androidGabriel Russell2018-02-151-0/+2
|
* SERVER-32070 remove stdx::bind (final patch)Billy Donahue2018-01-161-15/+9
|
* SERVER-6024 add stacktrace to unittestsKevin Albertson2018-01-081-0/+5
|
* SERVER-30235 Improve failure messages from ASSERT_THROWS_CODE and friendsMathias Stearn2017-07-261-33/+26
|
* SERVER-24879 Add $mergeObjects aggregation expressionnzolnierzmdb2017-03-311-4/+4
|
* SERVER-24398 Remove use of boost NOEXCEPT macros in favor of true C++11 noexceptMark Benvenuto2016-12-221-3/+1
|
* SERVER-24508 BSONObj::ComparatorInterfaceDavid Storch2016-08-181-0/+1
| | | | | | | | | | | BSONObj instances should now be compared via the comparator interface's evaluate() method. This preferred over using BSONObj::woCompare() directly. If the comparison doesn't require any database semantics (e.g. there is no collation), there is a global instance of the SimpleBSONObjComparator which should be used for BSONObj comparisons. If the comparison requires special semantics, then callers must instantiate their own comparator object.
* SERVER-23750: unit test cleanupScott Hernandez2016-06-301-13/+20
|
* SERVER-24273 moved writeOpsToOplog to repl storage interfaceBenety Goh2016-06-011-0/+6
|
* SERVER-23971 Clang-Format codeMark Benvenuto2016-05-281-20/+18
|
* SERVER-22774 Copied BackgroundSync::_fetcherCallback logic to OplogFetcherBenety Goh2016-04-081-0/+13
|
* SERVER-23010: general cleanup and test fixture changesScott Hernandez2016-03-271-0/+5
|
* SERVER-7244 added tests for rolling back index creation and operations with ↵Benety Goh2015-09-221-0/+5
| | | | no _id
* SERVER-19769 Use std::function to back stdx::function on windowsAndrew Morrow2015-08-311-7/+6
| | | | | | While std::function has some broken edge cases on VS2013, so does boost::function in boost 1.56. Rather than upgrade boost, use MSVC's std::function and fix up the few places that need adjustment.
* SERVER-9666 Remove test watchdog and support codeAndrew Morrow2015-07-211-6/+0
|
* SERVER-19127 Fix race condition in unittest log line capturing.Andy Schwerin2015-06-251-0/+1
| | | | | | | | | | | | The approach of this fix is to first make the appender for capturing log lines thread safe, and then to make it very unlikely that bad things happen if a test races between logging and detaching the special capture appender. We make it unlikely by taking advantage of the fact that appenders are removed by setting a pointer in a vector to NULL, and make sure that the capture appender is not destroyed when it is detached, but rather when the test fixture destructor runs. This means that if logging only occurs while a test fixture exists (likely if tests don't start threads outside of fixtures), tests will not try to use a capture appender that has gone out of scope.
* SERVER-18579: Clang-Format - reformat code, no comment reflowMark Benvenuto2015-06-201-361/+377
|
* SERVER-19005 Support DEATH_TEST and DEATH_TEST_FAndy Schwerin2015-06-171-5/+6
|
* SERVER-18991 Replace all usages of boost::noncopyable with ↵Andrew Morrow2015-06-161-5/+8
| | | | MONGO_DISALLOW_COPYING