10 #include <sys/types.h>
21 std::vector<Test>* tests;
26 tests =
new std::vector<Test>;
37 const char* matcher = getenv(
"LEVELDB_TESTS");
41 for (
int i = 0; i < tests->size(); i++) {
42 const Test& t = (*tests)[i];
43 if (matcher != NULL) {
44 std::string name = t.base;
47 if (strstr(name.c_str(), matcher) == NULL) {
51 fprintf(stderr,
"==== Test %s.%s\n", t.base, t.name);
56 fprintf(stderr,
"==== PASSED %d tests\n", num);
68 const char* env = getenv(
"TEST_RANDOM_SEED");
69 int result = (env != NULL ?
atoi(env) : 301);
bool RegisterTest(const char *base, const char *name, void(*func)())
virtual Status GetTestDirectory(std::string *path)=0
int atoi(const std::string &str)
std::string ToString() const