Unverified Commit 95d6297d authored by sundb's avatar sundb Committed by GitHub
Browse files

Add run all test support with define REDIS_TEST (#8570)

1. Add `redis-server test all` support to run all tests.
2. Add redis test to daily ci.
3. Add `--accurate` option to run slow tests for more iterations (so that
   by default we run less cycles (shorter time, and less prints).
4. Move dict benchmark to REDIS_TEST.
5. fix some leaks in tests
6. make quicklist tests run on a specific fill set of options rather than huge ranges
7. move some prints in quicklist test outside their loops to reduce prints
8. removing sds.h from dict.c since it is now used in both redis-server and
   redis-cli (uses hiredis sds)
parent 53774e69
......@@ -67,7 +67,7 @@ void ziplistRandomPairs(unsigned char *zl, unsigned int count, ziplistEntry *key
unsigned int ziplistRandomPairsUnique(unsigned char *zl, unsigned int count, ziplistEntry *keys, ziplistEntry *vals);
#ifdef REDIS_TEST
int ziplistTest(int argc, char *argv[]);
int ziplistTest(int argc, char *argv[], int accurate);
#endif
#endif /* _ZIPLIST_H */
......@@ -473,11 +473,12 @@ static void zipmapRepr(unsigned char *p) {
}
#define UNUSED(x) (void)(x)
int zipmapTest(int argc, char *argv[]) {
int zipmapTest(int argc, char *argv[], int accurate) {
unsigned char *zm;
UNUSED(argc);
UNUSED(argv);
UNUSED(accurate);
zm = zipmapNew();
......@@ -532,6 +533,7 @@ int zipmapTest(int argc, char *argv[]) {
printf(" %d:%.*s => %d:%.*s\n", klen, klen, key, vlen, vlen, value);
}
}
zfree(zm);
return 0;
}
#endif
......@@ -48,7 +48,7 @@ void zipmapRepr(unsigned char *p);
int zipmapValidateIntegrity(unsigned char *zm, size_t size, int deep);
#ifdef REDIS_TEST
int zipmapTest(int argc, char *argv[]);
int zipmapTest(int argc, char *argv[], int accurate);
#endif
#endif
......@@ -675,11 +675,12 @@ size_t zmalloc_get_memory_size(void) {
#ifdef REDIS_TEST
#define UNUSED(x) ((void)(x))
int zmalloc_test(int argc, char **argv) {
int zmalloc_test(int argc, char **argv, int accurate) {
void *ptr;
UNUSED(argc);
UNUSED(argv);
UNUSED(accurate);
printf("Malloc prefix size: %d\n", (int) PREFIX_SIZE);
printf("Initial used memory: %zu\n", zmalloc_used_memory());
ptr = zmalloc(123);
......
......@@ -135,7 +135,7 @@ size_t zmalloc_usable_size(void *ptr);
#endif
#ifdef REDIS_TEST
int zmalloc_test(int argc, char **argv);
int zmalloc_test(int argc, char **argv, int accurate);
#endif
#endif /* __ZMALLOC_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment