rocksdb/test_util
Peter Dillinger 0ef88538c6 Improve support for using regexes (#8740)
Summary:
* Consolidate use of std::regex for testing to testharness.cc, to
minimize Facebook linters constantly flagging uses in non-production
code.
* Improve syntax and error messages for asserting some string matches a
regex in tests.
* Add a public Regex wrapper class to encapsulate existing usage in
ObjectRegistry.
* Remove unnecessary include <regex>
* Put warnings that use of Regex in production code could cause bad
performance or stack overflow.

Intended follow-up work:
* Replace std::regex with another underlying implementation like RE2
* Improve ObjectRegistry interface in terms of possibly confusing literal
string matching vs. regex and in terms of reporting invalid regex.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/8740

Test Plan:
tests updated, basic unit test for public Regex, and some manual
testing of temporary changes to see example error messages:

utilities/backupable/backupable_db_test.cc:917: Failure
000010_1162373755_138626.blob (child.name)
does not match regex
[0-9]+_[0-9]+_[0-9]+[.]blobHAHAHA (pattern)

db/db_basic_test.cc:74: Failure
R3SHSBA8C4U0CIMV2ZB0 (sid3)
does not match regex [0-9A-Z]{20}HAHAHA

Reviewed By: mrambacher

Differential Revision: D30706246

Pulled By: pdillinger

fbshipit-source-id: ba845e8f563ccad39bdb58f44f04e9da8f78c3fd
2021-09-07 13:05:23 -07:00
..
mock_time_env.cc Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
mock_time_env.h Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
sync_point.cc Refactor kill point (#8241) 2021-05-05 15:50:29 -07:00
sync_point.h Refactor kill point (#8241) 2021-05-05 15:50:29 -07:00
sync_point_impl.cc Use bloom filter to speed up sync point (#8337) 2021-05-27 13:14:29 -07:00
sync_point_impl.h Use bloom filter to speed up sync point (#8337) 2021-05-27 13:14:29 -07:00
testharness.cc Improve support for using regexes (#8740) 2021-09-07 13:05:23 -07:00
testharness.h Improve support for using regexes (#8740) 2021-09-07 13:05:23 -07:00
testutil.cc Fix some minor issues in the Customizable infrastructure (#8566) 2021-08-19 10:10:47 -07:00
testutil.h Fix some minor issues in the Customizable infrastructure (#8566) 2021-08-19 10:10:47 -07:00
testutil_test.cc More Makefile Cleanup (#7097) 2020-07-09 14:35:17 -07:00
transaction_test_util.cc Fix unchecked statuses for transaction_test (#7572) 2020-10-21 14:03:59 -07:00
transaction_test_util.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00